({
isSignedIn,
updateQuincyEmail
}: EmailListOptInProps)
| 9 | } |
| 10 | |
| 11 | export function EmailListOptIn({ |
| 12 | isSignedIn, |
| 13 | updateQuincyEmail |
| 14 | }: EmailListOptInProps) { |
| 15 | const { t } = useTranslation(); |
| 16 | |
| 17 | if (isSignedIn) { |
| 18 | return ( |
| 19 | <Row className='email-list-opt'> |
| 20 | <Col md={4} mdOffset={2} sm={5} smOffset={1} xs={12}> |
| 21 | <Button |
| 22 | block={true} |
| 23 | variant='primary' |
| 24 | onClick={() => updateQuincyEmail(true)} |
| 25 | > |
| 26 | {t('buttons.yes-please')} |
| 27 | </Button> |
| 28 | <Spacer size='xs' /> |
| 29 | </Col> |
| 30 | <Col md={4} sm={5} xs={12}> |
| 31 | <Button |
| 32 | block={true} |
| 33 | variant='primary' |
| 34 | onClick={() => updateQuincyEmail(false)} |
| 35 | > |
| 36 | {t('buttons.no-thanks')} |
| 37 | </Button> |
| 38 | <Spacer size='xs' /> |
| 39 | </Col> |
| 40 | </Row> |
| 41 | ); |
| 42 | } else { |
| 43 | return ( |
| 44 | <Row> |
| 45 | <Col md={8} mdOffset={2} sm={10} smOffset={1} xs={12}> |
| 46 | <Spacer size='xs' /> |
| 47 | <p className='text-center'>{t('misc.email-signup-not-signed-in')}</p> |
| 48 | <Button |
| 49 | block={true} |
| 50 | variant='primary' |
| 51 | href={`${apiLocation}/signin`} |
| 52 | data-playwright-test-label='email-signup-sign-in-btn' |
| 53 | > |
| 54 | {t('buttons.sign-in')} |
| 55 | </Button> |
| 56 | <Spacer size='xs' /> |
| 57 | </Col> |
| 58 | </Row> |
| 59 | ); |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | interface EmailOptionsProps { |
| 64 | isSignedIn: boolean; |
nothing calls this directly
no test coverage detected