2019-06-22 18:53:50 -07:00
|
|
|
import ContentBox from '@/components/elements/ContentBox';
|
2019-06-25 21:28:56 -07:00
|
|
|
import UpdatePasswordForm from '@/components/dashboard/forms/UpdatePasswordForm';
|
|
|
|
import UpdateEmailAddressForm from '@/components/dashboard/forms/UpdateEmailAddressForm';
|
2019-12-22 17:03:44 -08:00
|
|
|
import ConfigureTwoFactorForm from '@/components/dashboard/forms/ConfigureTwoFactorForm';
|
2020-04-17 11:17:01 -07:00
|
|
|
import PageContentBlock from '@/components/elements/PageContentBlock';
|
2020-07-03 14:19:05 -07:00
|
|
|
import tw from 'twin.macro';
|
|
|
|
import { breakpoint } from '@/theme';
|
2022-11-25 13:25:03 -07:00
|
|
|
import styled from 'styled-components';
|
2020-12-06 13:56:14 -08:00
|
|
|
import MessageBox from '@/components/MessageBox';
|
2021-03-21 12:07:24 -07:00
|
|
|
import { useLocation } from 'react-router-dom';
|
2019-12-22 17:03:44 -08:00
|
|
|
|
|
|
|
const Container = styled.div`
|
2022-06-26 15:13:52 -04:00
|
|
|
${tw`flex flex-wrap`};
|
2019-12-22 17:03:44 -08:00
|
|
|
|
2022-06-26 15:13:52 -04:00
|
|
|
& > div {
|
|
|
|
${tw`w-full`};
|
2019-12-22 17:03:44 -08:00
|
|
|
|
2022-06-26 15:13:52 -04:00
|
|
|
${breakpoint('sm')`
|
2022-02-05 09:08:11 -08:00
|
|
|
width: calc(50% - 1rem);
|
|
|
|
`}
|
2019-12-22 17:03:44 -08:00
|
|
|
|
2022-06-26 15:13:52 -04:00
|
|
|
${breakpoint('md')`
|
2022-02-05 09:08:11 -08:00
|
|
|
${tw`w-auto flex-1`};
|
|
|
|
`}
|
2022-06-26 15:13:52 -04:00
|
|
|
}
|
2019-12-22 17:03:44 -08:00
|
|
|
`;
|
2019-06-22 18:53:50 -07:00
|
|
|
|
2021-03-21 12:07:24 -07:00
|
|
|
export default () => {
|
2022-11-25 13:25:03 -07:00
|
|
|
const { state } = useLocation();
|
2021-03-21 12:07:24 -07:00
|
|
|
|
2019-06-22 18:53:50 -07:00
|
|
|
return (
|
2022-11-25 13:25:03 -07:00
|
|
|
<PageContentBlock title="Account Overview">
|
2022-06-26 15:13:52 -04:00
|
|
|
{state?.twoFactorRedirect && (
|
2022-11-25 13:25:03 -07:00
|
|
|
<MessageBox title="2-Factor Required" type="error">
|
2022-06-26 15:13:52 -04:00
|
|
|
Your account must have two-factor authentication enabled in order to continue.
|
|
|
|
</MessageBox>
|
|
|
|
)}
|
2022-02-05 09:08:11 -08:00
|
|
|
|
2022-06-26 15:13:52 -04:00
|
|
|
<Container css={[tw`lg:grid lg:grid-cols-3 mb-10`, state?.twoFactorRedirect ? tw`mt-4` : tw`mt-10`]}>
|
2022-11-25 13:25:03 -07:00
|
|
|
<ContentBox title="Update Password" showFlashes="account:password">
|
2022-06-26 15:13:52 -04:00
|
|
|
<UpdatePasswordForm />
|
2020-04-17 11:17:01 -07:00
|
|
|
</ContentBox>
|
2022-11-25 13:25:03 -07:00
|
|
|
|
|
|
|
<ContentBox css={tw`mt-8 sm:mt-0 sm:ml-8`} title="Update Email Address" showFlashes="account:email">
|
2022-06-26 15:13:52 -04:00
|
|
|
<UpdateEmailAddressForm />
|
2020-04-17 11:17:01 -07:00
|
|
|
</ContentBox>
|
2022-11-25 13:25:03 -07:00
|
|
|
|
|
|
|
<ContentBox css={tw`md:ml-8 mt-8 md:mt-0`} title="Two-Step Verification">
|
2022-06-26 15:13:52 -04:00
|
|
|
<ConfigureTwoFactorForm />
|
2020-04-17 11:17:01 -07:00
|
|
|
</ContentBox>
|
|
|
|
</Container>
|
|
|
|
</PageContentBlock>
|
2019-06-22 18:53:50 -07:00
|
|
|
);
|
|
|
|
};
|