Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add loading animation to upload doc modal #654

Draft
wants to merge 2 commits into
base: Development
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions src/components/Modals/UploadDocumentModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import ClearIcon from '@mui/icons-material/Clear';
import DialogActions from '@mui/material/DialogActions';
import FileUploadIcon from '@mui/icons-material/FileUpload';
import FormControl from '@mui/material/FormControl';
import Backdrop from '@mui/material/Backdrop';
// import FormControlLabel from '@mui/material/FormControlLabel';
import FormHelperText from '@mui/material/FormHelperText';
// import Switch from '@mui/material/Switch';
Expand All @@ -20,6 +21,7 @@ import { useTheme } from '@mui/material/styles';
// Context Imports
import { DocumentListContext } from '@contexts';
// Component Imports
import { LoadingAnimation } from '@components/Notification';
import ModalBase from './ModalBase';
import { DocumentSelection, FormSection } from '../Form';
import UploadButtonGroup from './UploadButtonGroup';
Expand Down Expand Up @@ -222,7 +224,12 @@ const UploadDocumentModal = ({ showModal, setShowModal }) => {
</DialogActions>
</FormControl>
</form>
{/* {processing && <LoadingAnimation loadingItem={file.name} />} */}
{/* <LoadingAnimation loadingItem={'testfilename'} /> */}
</FormSection>
<Backdrop open={processing}>
<LoadingAnimation loadingItem="file name" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't loadingItem="file name" still be loadingItem={file.name}?

</Backdrop>
</ModalBase>
);
};
Expand Down
10 changes: 9 additions & 1 deletion src/components/Notification/LoadingAnimation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,15 @@ const LoadingAnimation = ({ loadingItem, children }) => (
padding: '20px'
}}
>
<Paper elevation={2} sx={{ display: 'inline-block', mx: '2px', padding: '20px' }}>
<Paper
elevation={2}
sx={{
display: 'inline-block',
mx: '2px',
padding: '20px',
backgroundColor: 'background.tint'
}}
>
Comment on lines +36 to +44
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this works for this animation, it consequently affects other uses of this animation as well, such as when loading contacts or documents.

2024-07-01 (1)

The box is now gray rather than white. Not a huge deal or anything, just an unintended side effect.

Best practice would be to carve out an exception for this. However, I'd like to do #643, which would refactor animations a tad anyway.

<Typography variant="h5" component="h2" mb={2} align="center">
Loading {loadingItem}...
</Typography>
Expand Down
Loading