diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-08-22 20:52:03 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-22 20:52:03 -0700 |
commit | 53ccbaf4f50d6876e1f4d44acdac2268b3d75233 (patch) | |
tree | 80b8037a85bf3d46e7a64782aa0539ee04be3a46 /web/src/js/components/ContentView/UploadContentButton.jsx | |
parent | 62ab2f2fd5188f31e99560dce788ba85c2933a1a (diff) | |
parent | eddc4243791c2c2b1a91c1d8ae49b830206bc6df (diff) | |
download | mitmproxy-53ccbaf4f50d6876e1f4d44acdac2268b3d75233.tar.gz mitmproxy-53ccbaf4f50d6876e1f4d44acdac2268b3d75233.tar.bz2 mitmproxy-53ccbaf4f50d6876e1f4d44acdac2268b3d75233.zip |
Merge pull request #1489 from mitmproxy/web_refactor
Web refactor
Diffstat (limited to 'web/src/js/components/ContentView/UploadContentButton.jsx')
-rw-r--r-- | web/src/js/components/ContentView/UploadContentButton.jsx | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/web/src/js/components/ContentView/UploadContentButton.jsx b/web/src/js/components/ContentView/UploadContentButton.jsx index 0652b584..de349af4 100644 --- a/web/src/js/components/ContentView/UploadContentButton.jsx +++ b/web/src/js/components/ContentView/UploadContentButton.jsx @@ -1,28 +1,18 @@ import { PropTypes } from 'react' +import FileChooser from '../common/FileChooser' UploadContentButton.propTypes = { uploadContent: PropTypes.func.isRequired, } export default function UploadContentButton({ uploadContent }) { - - let fileInput; - + return ( - <a className="btn btn-default btn-xs" - onClick={() => fileInput.click()} - title="Upload a file to replace the content."> - <i className="fa fa-upload"/> - <input - ref={ref => fileInput = ref} - className="hidden" - type="file" - onChange={e => { - if (e.target.files.length > 0) uploadContent(e.target.files[0]) - }} - /> - </a> - + <FileChooser + icon="fa-upload" + title="Upload a file to replace the content." + onOpenFile={uploadContent} + className="btn btn-default btn-xs"/> ) } |