From c036e13c6fcf94b1269abeb1300740c1193ab71b Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 21 Sep 2020 22:17:14 -0700 Subject: Additional device details --- modern/src/DevicePage.js | 84 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 59 insertions(+), 25 deletions(-) (limited to 'modern/src') diff --git a/modern/src/DevicePage.js b/modern/src/DevicePage.js index 48c6afd..900b279 100644 --- a/modern/src/DevicePage.js +++ b/modern/src/DevicePage.js @@ -3,38 +3,72 @@ import TextField from '@material-ui/core/TextField'; import t from './common/localization'; import EditItemView from './EditItemView'; +import { Accordion, AccordionSummary, AccordionDetails, makeStyles, Typography } from '@material-ui/core'; +import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; -const DevicePage = () => { - const [item, setItem] = useState(); +const useStyles = makeStyles(() => ({ + details: { + flexDirection: 'column', + }, +})); - const [name, setName] = useState(''); - const [uniqueId, setUniqueId] = useState(''); +const DevicePage = () => { + const classes = useStyles(); - const getItem = () => { - const updatedItem = item; - updatedItem.name = name || item.name; - updatedItem.uniqueId = uniqueId || item.uniqueId; - return updatedItem; - }; + const [item, setItem] = useState(); return ( - + item}> {item && <> - setName(event.target.value)} - label={t('sharedName')} - variant="filled" /> - setUniqueId(event.target.value)} - label={t('deviceIdentifier')} - variant="filled" /> + + }> + + {t('sharedRequired')} + + + + setItem({...item, name: event.target.value})} + label={t('sharedName')} + variant="filled" /> + setItem({...item, uniqueId: event.target.value})} + label={t('deviceIdentifier')} + variant="filled" /> + + + + }> + + {t('sharedExtra')} + + + + setItem({...item, phone: event.target.value})} + label={t('sharedPhone')} + variant="filled" /> + setItem({...item, model: event.target.value})} + label={t('deviceModel')} + variant="filled" /> + setItem({...item, contact: event.target.value})} + label={t('deviceContact')} + variant="filled" /> + + } -- cgit v1.2.3