From 1f019e6368160f41595fecfef39948e3d7f5e366 Mon Sep 17 00:00:00 2001 From: "[poww10s]" <[theironminer@gmail.com]> Date: Mon, 14 Sep 2020 01:55:55 -0400 Subject: [PATCH] start InputComponents Refactor --- src/components/InputComponents.js | 111 ------------------------------ 1 file changed, 111 deletions(-) diff --git a/src/components/InputComponents.js b/src/components/InputComponents.js index 2d05575..85aed6a 100644 --- a/src/components/InputComponents.js +++ b/src/components/InputComponents.js @@ -1,112 +1 @@ import React, { useState, useEffect } from "react"; -import { makeStyles } from "@material-ui/styles"; -import Select from "@material-ui/core/Select"; -import MenuItem from "@material-ui/core/MenuItem"; -import InputLabel from "@material-ui/core/InputLabel"; -import FormControl from "@material-ui/core/FormControl"; -import TextField from "@material-ui/core/TextField"; -import Slider from "@material-ui/core/Slider"; - -const useStyles = makeStyles((theme) => ({ - formControl: { - margin: theme.spacing(1), - minWidth: 120, - }, - selectEmpty: { - marginTop: theme.spacing(2), - }, - root: { - width: 127, - }, -})); - -function SettingSlider() { - const classes = useStyles(); - const [value, setValue] = React.useState(0); - - const handleEvent = (event, newValue) => { - setValue(newValue); - }; - - const valuetext = (value) => { - return `${value}`; - }; - - return ( -
- -
- ); -} - -function NameInput(props) { - const [name, setName] = useState("init"); - - useEffect( - (props) => { - props.returnName(name); - }, - [name] - ); - - const handleChange = (e) => { - setName(e.target.value); - }; - - return ( -
- { - setName(handleChange); - }} - /> - - ); -} - -function SettingSelect(props) { - const classes = useStyles(); - const [setting, setSetting] = useState(""); - - useEffect( - { - //here we update the sysex / or the settings object when the value changes - }, - [setting] - ); - - const handleChange = (e) => { - setSetting(e.target.value); - }; - - return ( - - {props.name} - - - ); -} - -export default { - SettingSelect, - SettingSlider, - NameInput, -};