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

fix: make subscribe dialog responsive #1998

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
3 changes: 0 additions & 3 deletions src/components/client/campaigns/CampaignDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,6 @@ export default function CampaignDetails({ campaign }: Props) {
showExpensesLink={(expensesList && expensesList?.length > 0) || canEditCampaign}
/>
<Grid container spacing={8}>
{subscribeIsOpen && (
<RenderCampaignSubscribeModal setOpen={setSubscribeOpen} campaign={campaign} />
Copy link
Member

Choose a reason for hiding this comment

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

Would you please confirm the removal of this fragment, doesnt cause regression in opening the subscription modal when user clicks on the Subscribe for email notifications for the campaign.

)}
<Grid item xs={12} display="flex" sx={{ mt: 1.5 }}>
<EmailIcon
color="primary"
Expand Down
31 changes: 24 additions & 7 deletions src/components/client/notifications/CampaignSubscribeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const classes = {
const StyledGrid = styled(Grid)(({ theme }) => ({
[`& .${classes.subscribeBtn}`]: {
fontSize: theme.typography.pxToRem(16),
background: `${theme.palette.primary}`,
},
}))

Expand Down Expand Up @@ -116,15 +115,20 @@ export default function RenderCampaignSubscribeModal({ campaign, setOpen }: Moda
<EmailField
label="common:notifications.email-descriptive"
name="email"
sx={{ maxWidth: theme.spacing(50) }}
sx={{
width: '100%',
[theme.breakpoints.up('sm')]: {
width: '70%',
},
}}
/>
</Grid>
<Grid item xs={12}>
<AcceptNewsLetterFieldCampaign name="consent" />
</Grid>
<Grid item xs={12} textAlign="center">
<SubmitButton
sx={{ width: '40%' }}
sx={{ minWidth: theme.spacing(25) }}
className={classes.subscribeBtn}
label="common:notifications.cta.subscribe-button"
loading={loading}
Expand Down Expand Up @@ -163,7 +167,7 @@ export default function RenderCampaignSubscribeModal({ campaign, setOpen }: Moda
}}>
<CloseModalButton onClose={handleClose} />
<React.Fragment>
<EmailIcon color="primary" sx={{ fontSize: '64px' }} />
<EmailIcon color="primary" sx={{ fontSize: theme.typography.pxToRem(64) }} />
<DialogTitle style={{ textAlign: 'center', width: '100%' }}>
{t('common:notifications.subscribe-campaign-title')}
</DialogTitle>
Expand All @@ -176,10 +180,23 @@ export default function RenderCampaignSubscribeModal({ campaign, setOpen }: Moda
: t('common:notifications.subscribe-text-loggedUser')}
</Typography>
</Grid>
<Grid item xs={12} display="flex" justifyContent="space-evenly">
<Grid
item
xs={12}
sx={{
display: 'flex',
justifyContent: 'space-evenly',
flexFlow: 'column',
gap: theme.spacing(2),
alignItems: 'center',

[theme.breakpoints.up('sm')]: {
flexFlow: 'row',
},
}}>
<SubmitButton
type="button"
sx={{ width: '40%' }}
sx={{ minWidth: theme.spacing(25) }}
className={classes.subscribeBtn}
label={
status !== 'authenticated'
Expand All @@ -191,7 +208,7 @@ export default function RenderCampaignSubscribeModal({ campaign, setOpen }: Moda
/>
<SubmitButton
type="button"
sx={{ width: '40%' }}
sx={{ minWidth: theme.spacing(25) }}
variant="outlined"
className={classes.subscribeBtn}
label={
Expand Down
9 changes: 7 additions & 2 deletions src/components/client/notifications/GeneralSubscribeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,20 @@ export default function RenderSubscribeModal({ setOpen }: ModalProps) {
<EmailField
label={t('common:notifications.email-descriptive')}
name="email"
sx={{ width: '70%' }}
sx={{
width: '100%',
[theme.breakpoints.up('sm')]: {
width: '70%',
},
}}
/>
</Grid>
<Grid item xs={12}>
<AcceptNewsLetterField name="consent" />
</Grid>
<Grid item xs={12} textAlign="center">
<SubmitButton
sx={{ width: '40%' }}
sx={{ minWidth: theme.spacing(25) }}
className={classes.subscribeBtn}
label="common:notifications.cta.subscribe-button"
loading={loading}
Expand Down
Loading