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

MPDX-7948 Rebuilding the UI - Appeals initial page #968

Merged
merged 5 commits into from
Jul 1, 2024
Merged
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
110 changes: 39 additions & 71 deletions pages/accountLists/[accountListId]/tools/appeals.page.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,18 @@
import Head from 'next/head';
import React from 'react';
import { Box, Divider, Grid, Theme, Typography } from '@mui/material';
import { motion } from 'framer-motion';
import { useTranslation } from 'react-i18next';
import { makeStyles } from 'tss-react/mui';
import { loadSession } from 'pages/api/utils/pagePropsHelpers';
import Loading from 'src/components/Loading';
import AddAppealForm from 'src/components/Tool/Appeal/AddAppealForm';
import Appeals from 'src/components/Tool/Appeal/Appeals';
import { useAccountListId } from 'src/hooks/useAccountListId';
import useGetAppSettings from 'src/hooks/useGetAppSettings';
import { ToolsWrapper } from './ToolsWrapper';
import { useToolsHelper } from './useToolsHelper';

Check warning on line 10 in pages/accountLists/[accountListId]/tools/appeals.page.tsx

View check run for this annotation

Codecov / codecov/patch

pages/accountLists/[accountListId]/tools/appeals.page.tsx#L9-L10

Added lines #L9 - L10 were not covered by tests

const useStyles = makeStyles()((theme: Theme) => ({
container: {
padding: theme.spacing(3),
width: '70%',
padding: `${theme.spacing(3)} ${theme.spacing(3)} 0`,
display: 'flex',
[theme.breakpoints.down('lg')]: {
width: '90%',
},
[theme.breakpoints.down('md')]: {
width: '70%',
},
[theme.breakpoints.down('sm')]: {
width: '100%',
},
},
outer: {
display: 'flex',
Expand All @@ -40,71 +28,51 @@
const AppealsPage: React.FC = () => {
const { t } = useTranslation();
const { classes } = useStyles();
const accountListId = useAccountListId();
const { appName } = useGetAppSettings();

const variants = {
animate: {
transition: {
staggerChildren: 0.15,
},
},
exit: {
transition: {
staggerChildren: 0.1,
},
},
};
const { accountListId } = useToolsHelper();
const pageUrl = 'tools/fixCommitmentInfo';

Check warning on line 33 in pages/accountLists/[accountListId]/tools/appeals.page.tsx

View check run for this annotation

Codecov / codecov/patch

pages/accountLists/[accountListId]/tools/appeals.page.tsx#L32-L33

Added lines #L32 - L33 were not covered by tests

return (
<>
<Head>
<title>
{appName} | {t('Appeals')}
</title>
</Head>
<ToolsWrapper
pageTitle={t('Appeals')}
pageUrl={pageUrl}
selectedMenuId="fixCommitmentInfo"
>
{accountListId ? (
<motion.div
initial="initial"
animate="animate"
exit="exit"
variants={variants}
>
<Box className={classes.outer}>
<Grid container spacing={3} className={classes.container}>
<Grid item xs={12}>
<Box m={1}>
<Typography variant="h4">{t('Appeals')}</Typography>
</Box>
<Divider />
<Box m={1}>
<Typography variant="body2">
{t(
'You can track recurring support goals or special need ' +
'support goals through our appeals wizard. Track the ' +
'recurring support you raise for an increase ask for example, ' +
'or special gifts you raise for a summer mission trip or your ' +
'new staff special gift goal.',
)}
</Typography>
</Box>
</Grid>
<Box className={classes.outer}>

Check warning on line 42 in pages/accountLists/[accountListId]/tools/appeals.page.tsx

View check run for this annotation

Codecov / codecov/patch

pages/accountLists/[accountListId]/tools/appeals.page.tsx#L42

Added line #L42 was not covered by tests
<Grid container spacing={3} className={classes.container}>
<Grid item xs={12}>
<Box m={1}>
<Typography variant="h4">{t('Appeals')}</Typography>
</Box>
<Divider />
<Box m={1}>
<Typography variant="body2">
{t(
'You can track recurring support goals or special need ' +
'support goals through our appeals wizard. Track the ' +
'recurring support you raise for an increase ask for example, ' +
'or special gifts you raise for a summer mission trip or your ' +
'new staff special gift goal.',
)}
</Typography>
</Box>
</Grid>

<Grid item xs={12} sm={12} lg={6}>
<Appeals accountListId={accountListId} />
</Grid>
<Grid item xs={12} sm={12} lg={6}>
<Box width="100%" display="flex" justifyContent="center">
<AddAppealForm />
</Box>
</Grid>
<Grid item xs={12} sm={12} md={6}>
<Appeals accountListId={accountListId} />
</Grid>
<Grid item xs={12} sm={12} md={6}>
<Box width="100%" display="flex" justifyContent="center">
<AddAppealForm accountListId={accountListId} />
</Box>
</Grid>
</Box>
</motion.div>
</Grid>
</Box>
) : (
<Loading loading />
)}
</>
</ToolsWrapper>
);
};

Expand Down
Loading
Loading