From c5d78f828a48ba88b8a89a0564bcb8352e84b396 Mon Sep 17 00:00:00 2001
From: Christopher Speller <crspeller@gmail.com>
Date: Thu, 24 Sep 2015 10:17:58 -0400
Subject: Converting preview image modal to use react-bootstrap. Fixes issue
 where modal would appear behind background on iOS

---
 web/react/components/view_image_popover_bar.jsx | 66 +++++++++++++++++++++++++
 1 file changed, 66 insertions(+)
 create mode 100644 web/react/components/view_image_popover_bar.jsx

(limited to 'web/react/components/view_image_popover_bar.jsx')

diff --git a/web/react/components/view_image_popover_bar.jsx b/web/react/components/view_image_popover_bar.jsx
new file mode 100644
index 000000000..68817d751
--- /dev/null
+++ b/web/react/components/view_image_popover_bar.jsx
@@ -0,0 +1,66 @@
+// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved.
+// See License.txt for license information.
+
+export default class ViewImagePopoverBar extends React.Component {
+    constructor(props) {
+        super(props);
+    }
+    render() {
+        var publicLink = '';
+        if (global.window.config.EnablePublicLink === 'true') {
+            publicLink = (
+                <div>
+                    <a
+                        href='#'
+                        className='public-link text'
+                        data-title='Public Image'
+                        onClick={this.getPublicLink}
+                    >
+                        {'Get Public Link'}
+                    </a>
+                    <span className='text'>{' | '}</span>
+                </div>
+            );
+        }
+
+        var footerClass = 'modal-button-bar';
+        if (this.props.show) {
+            footerClass += ' footer--show';
+        }
+
+        return (
+            <div
+                ref='imageFooter'
+                className={footerClass}
+            >
+                <span className='pull-left text'>{'File ' + (this.props.fileId + 1) + ' of ' + this.props.totalFiles}</span>
+                <div className='image-links'>
+                    {publicLink}
+                    <a
+                        href={this.props.fileURL}
+                        download={this.props.filename}
+                        className='text'
+                    >
+                        {'Download'}
+                    </a>
+                </div>
+            </div>
+        );
+    }
+}
+ViewImagePopoverBar.defaultProps = {
+    show: false,
+    imgId: 0,
+    totalFiles: 0,
+    filename: '',
+    fileURL: ''
+};
+
+ViewImagePopoverBar.propTypes = {
+    show: React.PropTypes.bool.isRequired,
+    fileId: React.PropTypes.number.isRequired,
+    totalFiles: React.PropTypes.number.isRequired,
+    filename: React.PropTypes.string.isRequired,
+    fileURL: React.PropTypes.string.isRequired,
+    onGetPublicLinkPressed: React.PropTypes.func.isRequired
+};
-- 
cgit v1.2.3-1-g7c22

