diff --git a/client/src/components/Forms/ChannelForm.js b/client/src/components/Forms/ChannelForm.js
index e0de30e8b..4c0ac6d73 100644
--- a/client/src/components/Forms/ChannelForm.js
+++ b/client/src/components/Forms/ChannelForm.js
@@ -6,84 +6,80 @@ import React, { Component } from 'react';
import Button from '@material-ui/core/Button';
import TextField from '@material-ui/core/TextField';
import { withStyles } from '@material-ui/core/styles';
+import FileInput from './FileInput';
const styles = theme => ({
- container: {
- display: 'flex',
- flexWrap: 'wrap',
- },
- form: {
- width: 310,
- },
- textField: {
- marginLeft: theme.spacing.unit,
- marginRight: theme.spacing.unit,
- width: 130,
- },
- fileField: {
- marginLeft: theme.spacing.unit,
- marginRight: theme.spacing.unit,
- width: 300,
- },
- menu: {
- width: 200,
- },
+ container: {
+ display: 'flex',
+ flexWrap: 'wrap'
+ },
+ form: {
+ width: 310
+ },
+ textField: {
+ marginLeft: theme.spacing.unit,
+ marginRight: theme.spacing.unit,
+ width: 130
+ },
+ fileField: {
+ marginLeft: theme.spacing.unit,
+ marginRight: theme.spacing.unit,
+ width: 300
+ },
+ menu: {
+ width: 200
+ },
+ button: {
+ fontSize: 16,
+ color: '#466bd4',
+ margin: 'auto',
+ display: 'block',
+ border: 'none'
+ }
});
class ChannelForm extends Component {
- render() {
- const { classes } = this.props;
+ render() {
+ const { classes } = this.props;
- return (
- // TODO : Replace with liform-react
-
-
-
-
-
- );
- }
+ return (
+ // TODO : Replace with liform-react
+
+
+
+
+ );
+ }
}
export default withStyles(styles)(ChannelForm);
diff --git a/client/src/components/Forms/FileInput.js b/client/src/components/Forms/FileInput.js
new file mode 100644
index 000000000..5bc8cd778
--- /dev/null
+++ b/client/src/components/Forms/FileInput.js
@@ -0,0 +1,84 @@
+/**
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+import React, { Component } from 'react';
+import { withStyles } from '@material-ui/core/styles';
+import Box from '@material-ui/core/Box';
+import TextField from '@material-ui/core/TextField';
+import ButtonBase from '@material-ui/core/ButtonBase';
+
+const styles = theme => ({
+ field: {
+ '& .MuiFormLabel-root.Mui-disabled': {
+ color: theme.palette.text.secondary
+ }
+ },
+ button: {
+ width: '100%',
+ height: '100%',
+ overflow: 'hidden'
+ },
+ box: {
+ marginLeft: theme.spacing.unit,
+ marginRight: theme.spacing.unit,
+ borderBottom: '1px #8b8e91 solid',
+ '&:hover': {
+ borderBottom: '2px #1f2020 solid'
+ }
+ }
+});
+
+class FileInput extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ attachment: null
+ };
+ this.ref = React.createRef();
+ }
+
+ handleChange = event => {
+ const files = Array.from(event.target.files);
+ const [file] = files;
+ this.setState({ attachment: file });
+ };
+
+ render() {
+ const { label, helperText, classes } = this.props;
+ const { attachment } = this.state;
+
+ return (
+
+
+
+
+ e.keyCode === 32 && this.ref.current.click()}
+ >
+
+
+
+ );
+ }
+}
+
+export default withStyles(styles)(FileInput);