From bae88b6f71bfa8b36e14b18ec395a26bd92485b7 Mon Sep 17 00:00:00 2001 From: Andrew Watkins Date: Wed, 21 Jun 2017 14:35:41 -0700 Subject: [PATCH] Move footer into stateless functional component --- .../data_explorer/components/WriteDataBody.js | 38 ++++----------- .../components/WriteDataFooter.js | 47 +++++++++++++++++++ 2 files changed, 55 insertions(+), 30 deletions(-) create mode 100644 ui/src/data_explorer/components/WriteDataFooter.js diff --git a/ui/src/data_explorer/components/WriteDataBody.js b/ui/src/data_explorer/components/WriteDataBody.js index 89f36f056c..f1713b0536 100644 --- a/ui/src/data_explorer/components/WriteDataBody.js +++ b/ui/src/data_explorer/components/WriteDataBody.js @@ -1,4 +1,5 @@ import React, {PropTypes} from 'react' +import WriteDataFooter from 'src/data_explorer/components/WriteDataFooter' const WriteDataBody = ({ handleKeyUp, @@ -28,7 +29,7 @@ const WriteDataBody = ({ type="file" onChange={handleFile} className="write-data-form--upload" - ref={r => (inputRef = r)} + ref={r => inputRef = r} accept="text/*, application/gzip" /> - + ) } diff --git a/ui/src/data_explorer/components/WriteDataFooter.js b/ui/src/data_explorer/components/WriteDataFooter.js new file mode 100644 index 0000000000..db63dc9fb0 --- /dev/null +++ b/ui/src/data_explorer/components/WriteDataFooter.js @@ -0,0 +1,47 @@ +import React, {PropTypes} from 'react' + +const WriteDataFooter = ({ + isManual, + inputContent, + uploadContent, + handleSubmit, +}) => ( +
+ {isManual + ? + Need help writing InfluxDB Line Protocol? -  + + See Documentation + + + : + + File Upload Documentation + + } + +
+) + +const {bool, func, string} = PropTypes + +WriteDataFooter.propTypes = { + isManual: bool.isRequired, + uploadContent: string, + inputContent: string, + handleSubmit: func, +} + +export default WriteDataFooter