From b43c68e16e8af8db474b879421369e66a6f5da5f Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 20 Jun 2022 07:41:25 -0700 Subject: Loading shimmer for items --- modern/src/settings/components/EditItemView.js | 28 +++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'modern/src/settings/components') diff --git a/modern/src/settings/components/EditItemView.js b/modern/src/settings/components/EditItemView.js index 8dca1e66..4d354a8f 100644 --- a/modern/src/settings/components/EditItemView.js +++ b/modern/src/settings/components/EditItemView.js @@ -1,9 +1,7 @@ import React from 'react'; import { useNavigate, useParams } from 'react-router-dom'; import makeStyles from '@mui/styles/makeStyles'; -import Container from '@mui/material/Container'; -import Button from '@mui/material/Button'; - +import { Container, Button, Accordion, AccordionDetails, AccordionSummary, Skeleton, Typography, TextField } from '@mui/material'; import { useCatch, useEffectAsync } from '../../reactHelper'; import { useTranslation } from '../../common/components/LocalizationProvider'; import PageLayout from '../../common/components/PageLayout'; @@ -21,6 +19,10 @@ const useStyles = makeStyles((theme) => ({ flexBasis: '33%', }, }, + details: { + display: 'flex', + flexDirection: 'column', + }, })); const EditItemView = ({ @@ -70,13 +72,29 @@ const EditItemView = ({ return ( - {children} + {item ? children : ( + + + + + + + + {[...Array(3)].map(() => ( + + + + ))} + + + )}
@@ -85,7 +103,7 @@ const EditItemView = ({ color="primary" variant="contained" onClick={handleSave} - disabled={!validate()} + disabled={!item || !validate()} > {t('sharedSave')} -- cgit v1.2.3