diff options
author | Clemens <cle1000.cb@gmail.com> | 2016-08-16 12:37:35 +0200 |
---|---|---|
committer | Clemens <cle1000.cb@gmail.com> | 2016-08-16 12:37:35 +0200 |
commit | 779e5e84e37278b8f3255a1061f2137f5b6a3a7d (patch) | |
tree | fe91c08c5cdf87bfb99cf3cfe6bfcf3a7e67e933 /web/src/js/components/ContentView/UploadContentButton.jsx | |
parent | 57fafd3281af7a35f8e650fa9fb2cf5af70995f0 (diff) | |
download | mitmproxy-779e5e84e37278b8f3255a1061f2137f5b6a3a7d.tar.gz mitmproxy-779e5e84e37278b8f3255a1061f2137f5b6a3a7d.tar.bz2 mitmproxy-779e5e84e37278b8f3255a1061f2137f5b6a3a7d.zip |
refactor file up and download
Diffstat (limited to 'web/src/js/components/ContentView/UploadContentButton.jsx')
-rw-r--r-- | web/src/js/components/ContentView/UploadContentButton.jsx | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/web/src/js/components/ContentView/UploadContentButton.jsx b/web/src/js/components/ContentView/UploadContentButton.jsx index 0652b584..6764e234 100644 --- a/web/src/js/components/ContentView/UploadContentButton.jsx +++ b/web/src/js/components/ContentView/UploadContentButton.jsx @@ -1,4 +1,5 @@ import { PropTypes } from 'react' +import FileChooser from '../common/FileChooser' UploadContentButton.propTypes = { uploadContent: PropTypes.func.isRequired, @@ -9,20 +10,11 @@ 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"/> ) } |