import React from 'react'; import clsx from 'clsx'; import { makeStyles, Theme, createStyles } from '@material-ui/core/styles'; import IconButton from '@material-ui/core/IconButton'; import Input from '@material-ui/core/Input'; import FilledInput from '@material-ui/core/FilledInput'; import OutlinedInput from '@material-ui/core/OutlinedInput'; import InputLabel from '@material-ui/core/InputLabel'; import InputAdornment from '@material-ui/core/InputAdornment'; import FormHelperText from '@material-ui/core/FormHelperText'; import FormControl from '@material-ui/core/FormControl'; import TextField from '@material-ui/core/TextField'; import Visibility from '@material-ui/icons/Visibility'; import VisibilityOff from '@material-ui/icons/VisibilityOff'; const useStyles = makeStyles((theme: Theme) => createStyles({ root: { display: 'flex', flexWrap: 'wrap', }, margin: { margin: theme.spacing(1), }, withoutLabel: { marginTop: theme.spacing(3), }, textField: { width: '25ch', }, }), ); interface State { amount: string; password: string; weight: string; weightRange: string; showPassword: boolean; } export default function InputAdornments() { const classes = useStyles(); const [values, setValues] = React.useState({ amount: '', password: '', weight: '', weightRange: '', showPassword: false, }); const handleChange = (prop: keyof State) => (event: React.ChangeEvent) => { setValues({ ...values, [prop]: event.target.value }); }; const handleClickShowPassword = () => { setValues({ ...values, showPassword: !values.showPassword }); }; const handleMouseDownPassword = (event: React.MouseEvent) => { event.preventDefault(); }; return (
Kg, }} /> Kg} aria-describedby="standard-weight-helper-text" inputProps={{ 'aria-label': 'weight', }} /> Weight Password {values.showPassword ? : } } /> Amount $} />
Kg, }} variant="filled" /> Kg} aria-describedby="filled-weight-helper-text" inputProps={{ 'aria-label': 'weight', }} /> Weight Password {values.showPassword ? : } } /> Amount $} />
Kg, }} variant="outlined" /> Kg} aria-describedby="outlined-weight-helper-text" inputProps={{ 'aria-label': 'weight', }} labelWidth={0} /> Weight Password {values.showPassword ? : } } labelWidth={70} /> Amount $} labelWidth={60} />
); }