Skip to content

Commit c46f2b0

Browse files
committed
Added signout button to intake forms
1 parent 84470d0 commit c46f2b0

File tree

3 files changed

+59
-0
lines changed

3 files changed

+59
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import React from 'react';
2+
import { Box, Flex, Text, Link } from '@chakra-ui/react';
3+
import { useRouter } from 'next/router';
4+
import { logout } from '@/APIClients/authAPIClient';
5+
import { COLORS } from '@/constants/form';
6+
7+
interface IntakeHeaderProps {
8+
title: string;
9+
}
10+
11+
export function IntakeHeader({ title }: IntakeHeaderProps) {
12+
const router = useRouter();
13+
14+
const handleSignOut = async () => {
15+
await logout();
16+
await router.push('/');
17+
};
18+
19+
return (
20+
<Flex
21+
w="full"
22+
maxW="1200px"
23+
justify="space-between"
24+
align="center"
25+
mb={8}
26+
px={4}
27+
>
28+
<Text
29+
fontFamily="system-ui, -apple-system, sans-serif"
30+
fontWeight={600}
31+
color={COLORS.veniceBlue}
32+
fontSize="28px"
33+
>
34+
{title}
35+
</Text>
36+
<Link
37+
onClick={handleSignOut}
38+
style={{
39+
color: COLORS.veniceBlue,
40+
textDecoration: 'underline',
41+
fontWeight: 400,
42+
fontFamily: 'system-ui, -apple-system, sans-serif',
43+
fontSize: '16px',
44+
cursor: 'pointer',
45+
}}
46+
>
47+
Sign out
48+
</Link>
49+
</Flex>
50+
);
51+
}

frontend/src/pages/participant/intake/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
} from '@/components/intake/demographic-cancer-form';
1111
import { LovedOneForm } from '@/components/intake/loved-one-form';
1212
import { AdditionalInfoForm } from '@/components/intake/additional-info-form';
13+
import { IntakeHeader } from '@/components/intake/IntakeHeader';
1314
import {
1415
COLORS,
1516
IntakeFormData,
@@ -236,9 +237,12 @@ export default function ParticipantIntakePage() {
236237
bg={COLORS.lightGray}
237238
justify="center"
238239
py={12}
240+
direction="column"
241+
align="center"
239242
overflow="visible"
240243
pb={hasDropdownOpen ? '50vh' : 12}
241244
>
245+
<IntakeHeader title="First Connection Participant Form" />
242246
<Box
243247
w="full"
244248
maxW="1200px"

frontend/src/pages/volunteer/intake/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
} from '@/components/intake/demographic-cancer-form';
1111
import { LovedOneForm } from '@/components/intake/loved-one-form';
1212
import { AdditionalInfoForm } from '@/components/intake/additional-info-form';
13+
import { IntakeHeader } from '@/components/intake/IntakeHeader';
1314
import {
1415
COLORS,
1516
IntakeFormData,
@@ -245,9 +246,12 @@ export default function VolunteerIntakePage() {
245246
bg={COLORS.lightGray}
246247
justify="center"
247248
py={12}
249+
direction="column"
250+
align="center"
248251
overflow="visible"
249252
pb={hasDropdownOpen ? '30vh' : 12}
250253
>
254+
<IntakeHeader title="First Connection Volunteer Form" />
251255
<Box
252256
w="full"
253257
maxW="1200px"

0 commit comments

Comments
 (0)