Skip to content

Commit

Permalink
Add Step 4 (Preview step)
Browse files Browse the repository at this point in the history
  • Loading branch information
wrandall22 committed Jun 26, 2024
1 parent 6fab3b5 commit cdee523
Show file tree
Hide file tree
Showing 5 changed files with 798 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pages/accountLists/[accountListId]/tools/csv.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { loadSession } from 'pages/api/utils/pagePropsHelpers';
import Loading from 'src/components/Loading';
import CsvHeaders from 'src/components/Tool/Import/Csv/CsvHeaders';
import { CsvImportProvider } from 'src/components/Tool/Import/Csv/CsvImportContext';
import CsvPreview from 'src/components/Tool/Import/Csv/CsvPreview';
import CsvUpload from 'src/components/Tool/Import/Csv/CsvUpload';
import CsvValues from 'src/components/Tool/Import/Csv/CsvValues';
import { HeaderBox } from 'src/components/Tool/Import/Csv/HeaderBox';
Expand Down Expand Up @@ -81,6 +82,13 @@ const CsvHome: React.FC = () => {
setCurrentTab={setCurrentTab}
/>
);
case 'tools.import.csv.preview':
return (

Check warning on line 86 in pages/accountLists/[accountListId]/tools/csv.page.tsx

View check run for this annotation

Codecov / codecov/patch

pages/accountLists/[accountListId]/tools/csv.page.tsx#L85-L86

Added lines #L85 - L86 were not covered by tests
<CsvPreview
accountListId={accountListId}
setCurrentTab={setCurrentTab}
/>
);
default:
return null;

Check warning on line 93 in pages/accountLists/[accountListId]/tools/csv.page.tsx

View check run for this annotation

Codecov / codecov/patch

pages/accountLists/[accountListId]/tools/csv.page.tsx#L92-L93

Added lines #L92 - L93 were not covered by tests
}
Expand Down
71 changes: 71 additions & 0 deletions src/components/Tool/Import/Csv/CsvImportSuccessModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import React from 'react';
import { Box, Button, Grid, Paper, Typography } from '@mui/material';
import { useTranslation } from 'react-i18next';
import Modal from 'src/components/common/Modal/Modal';

interface CsvImportSuccessModalProps {
handleClose: () => void;
}

export const CsvImportSuccessModal: React.FC<CsvImportSuccessModalProps> = ({
handleClose,
}) => {
const { t } = useTranslation();

return (
<Modal
isOpen={true}
title={t('Info')}
handleClose={handleClose}
size={'sm'}
>
<Box>
<Paper
elevation={3}
variant="outlined"
style={{
padding: '10px',
marginTop: '10px',
}}
>
<Grid
container
spacing={1}
alignItems="center"
justifyContent="space-between"
>
<Grid item>
<Typography variant="body1">
{t(
'Your CSV import has started and your contacts will be in MPDX shortly. We will email you when your import is complete.',
)}
</Typography>
</Grid>
<Grid item sx={{ width: '100%' }}>
<Box
sx={{
padding: '10px 15px',
display: 'flex',
justifyContent: 'right',
width: '100%',
}}
>
<Button
onClick={handleClose}
variant="contained"
sx={{
bgcolor: 'mpdxBlue.main',
color: 'white',
height: '34px',
}}
>
{t('Ok')}
</Button>
</Box>
</Grid>
</Grid>
</Paper>
</Box>
</Modal>
);
};
Loading

0 comments on commit cdee523

Please sign in to comment.