Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/develop/resources/scripts/components/dashboard/AccountOverviewContainer.tsx
7428 views
1
import ContentBox from '@/components/elements/ContentBox';
2
import UpdatePasswordForm from '@/components/dashboard/forms/UpdatePasswordForm';
3
import UpdateEmailAddressForm from '@/components/dashboard/forms/UpdateEmailAddressForm';
4
import ConfigureTwoFactorForm from '@/components/dashboard/forms/ConfigureTwoFactorForm';
5
import PageContentBlock from '@/components/elements/PageContentBlock';
6
import tw from 'twin.macro';
7
import { breakpoint } from '@/theme';
8
import styled from 'styled-components';
9
import MessageBox from '@/components/MessageBox';
10
import { useLocation } from 'react-router-dom';
11
12
const Container = styled.div`
13
${tw`flex flex-wrap`};
14
15
& > div {
16
${tw`w-full`};
17
18
${breakpoint('sm')`
19
width: calc(50% - 1rem);
20
`}
21
22
${breakpoint('md')`
23
${tw`w-auto flex-1`};
24
`}
25
}
26
`;
27
28
export default () => {
29
const { state } = useLocation();
30
31
return (
32
<PageContentBlock title="Account Overview">
33
{state?.twoFactorRedirect && (
34
<MessageBox title="2-Factor Required" type="error">
35
Your account must have two-factor authentication enabled in order to continue.
36
</MessageBox>
37
)}
38
39
<Container css={[tw`lg:grid lg:grid-cols-3 mb-10`, state?.twoFactorRedirect ? tw`mt-4` : tw`mt-10`]}>
40
<ContentBox title="Update Password" showFlashes="account:password">
41
<UpdatePasswordForm />
42
</ContentBox>
43
44
<ContentBox css={tw`mt-8 sm:mt-0 sm:ml-8`} title="Update Email Address" showFlashes="account:email">
45
<UpdateEmailAddressForm />
46
</ContentBox>
47
48
<ContentBox css={tw`md:ml-8 mt-8 md:mt-0`} title="Two-Step Verification">
49
<ConfigureTwoFactorForm />
50
</ContentBox>
51
</Container>
52
</PageContentBlock>
53
);
54
};
55
56