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 () => {
const { t } = useTranslation('dashboard/account');
const { state } = useLocation<undefined | { twoFactorRedirect?: boolean }>();
return (
<PageContentBlock title={'Account Overview'}>
<PageContentBlock title={t('title')}>
{state?.twoFactorRedirect && (
<MessageBox title={'2-Factor Required'} type={'error'}>
Your account must have two-factor authentication enabled in order to continue.
<MessageBox title={t('two_factor.required.title')} type={'error'}>
{t('two_factor.required.description')}
</MessageBox>
)}
<BeforeContent />
<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 />
</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 />
</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 />
</ContentBox>
</Container>
<AfterContent />
</PageContentBlock>
);
};
};