Skip to content

Commit

Permalink
Lazy load EmptyReport add donation modal contents
Browse files Browse the repository at this point in the history
  • Loading branch information
canac committed Apr 29, 2024
1 parent 406b014 commit 9f40496
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
18 changes: 9 additions & 9 deletions src/components/Reports/EmptyReport/EmptyReport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import LocalAtmIcon from '@mui/icons-material/LocalAtm';
import { Box, Button, Typography } from '@mui/material';
import { styled } from '@mui/material/styles';
import { useTranslation } from 'react-i18next';
import { AddDonation } from 'src/components/Layouts/Primary/TopBar/Items/AddMenu/Items/AddDonation/AddDonation';
import { NextLinkComposed } from 'src/components/common/Links/NextLinkComposed';
import {
DynamicModal,
preloadModal,
} from 'src/components/common/Modal/DynamicModal';
DynamicAddDonation,
preloadAddDonation,
} from 'src/components/Layouts/Primary/TopBar/Items/AddMenu/Items/AddDonation/DynamicAddDonation';
import { NextLinkComposed } from 'src/components/common/Links/NextLinkComposed';
import Modal from 'src/components/common/Modal/Modal';
import { useAccountListId } from 'src/hooks/useAccountListId';

interface Props {
Expand Down Expand Up @@ -59,26 +59,26 @@ export const EmptyReport: React.FC<Props> = ({
<Button
variant="contained"
color="primary"
onMouseEnter={preloadModal}
onMouseEnter={preloadAddDonation}
onClick={() => setAddDonationOpen(true)}
>
{t('Add New Donation')}
</Button>
)}
</Box>

<DynamicModal
<Modal
isOpen={addDonationOpen}
handleClose={handleCloseAddDonation}
title={t('Add Donation')}
fullWidth
size="sm"
>
<AddDonation
<DynamicAddDonation
accountListId={accountListId ?? ''}
handleClose={handleCloseAddDonation}
/>
</DynamicModal>
</Modal>
</BoxWrapper>
);
};
9 changes: 0 additions & 9 deletions src/components/common/Modal/DynamicModal.tsx

This file was deleted.

0 comments on commit 9f40496

Please sign in to comment.