Update resources/scripts/components/dashboard/AccountOverviewContainer.tsx

This commit is contained in:
denis 2024-11-03 02:33:08 -05:00
parent c73b2a828d
commit da67cd4206

View file

@ -30,29 +30,30 @@ const Container = styled.div`
`; `;
export default () => { export default () => {
const { t } = useTranslation('dashboard/account');
const { state } = useLocation<undefined | { twoFactorRedirect?: boolean }>(); const { state } = useLocation<undefined | { twoFactorRedirect?: boolean }>();
return ( return (
<PageContentBlock title={'Account Overview'}> <PageContentBlock title={t('title')}>
{state?.twoFactorRedirect && ( {state?.twoFactorRedirect && (
<MessageBox title={'2-Factor Required'} type={'error'}> <MessageBox title={t('two_factor.required.title')} type={'error'}>
Your account must have two-factor authentication enabled in order to continue. {t('two_factor.required.description')}
</MessageBox> </MessageBox>
)} )}
<BeforeContent /> <BeforeContent />
<Container css={[tw`lg:grid lg:grid-cols-3 mb-10`, state?.twoFactorRedirect ? tw`mt-4` : tw`mt-10`]}> <Container css={[tw`lg:grid lg:grid-cols-3 mb-10`, state?.twoFactorRedirect ? tw`mt-4` : tw`mt-10`]}>
<ContentBox title={'Update Password'} showFlashes={'account:password'}> <ContentBox title={t('password.title')} showFlashes={'account:password'}>
<UpdatePasswordForm /> <UpdatePasswordForm />
</ContentBox> </ContentBox>
<ContentBox css={tw`mt-8 sm:mt-0 sm:ml-8`} title={'Update Email Address'} showFlashes={'account:email'}> <ContentBox css={tw`mt-8 sm:mt-0 sm:ml-8`} title={t('email.title')} showFlashes={'account:email'}>
<UpdateEmailAddressForm /> <UpdateEmailAddressForm />
</ContentBox> </ContentBox>
<ContentBox css={tw`md:ml-8 mt-8 md:mt-0`} title={'Two-Step Verification'}> <ContentBox css={tw`md:ml-8 mt-8 md:mt-0`} title={t('two_factor.title')}>
<ConfigureTwoFactorForm /> <ConfigureTwoFactorForm />
</ContentBox> </ContentBox>
</Container> </Container>
<AfterContent /> <AfterContent />
</PageContentBlock> </PageContentBlock>
); );
}; };