Skip to content

Commit af8101a

Browse files
authored
Merge pull request #92 from Code-4-Community/89-Account-Instructions-Component
add in account instructions component
2 parents 53de608 + 5c94e2a commit af8101a

6 files changed

Lines changed: 99 additions & 0 deletions

File tree

apps/frontend/src/app.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import { AuthProvider } from '@components/AuthProvider';
1111
import { ProtectedRoute } from '@components/ProtectedRoute';
1212
import { AdminRoute } from '@components/AdminRoute';
1313
import { LoginPage } from '@containers/auth/LoginPage';
14+
import { Modal1Page } from '@containers/auth/Modal1Page';
15+
import { Modal2Page } from '@containers/auth/Modal2Page';
1416
import { DashboardPage } from '@containers/dashboard/DashboardPage';
1517
import { DonorStatsChart } from '@components/DonorStatsChart';
1618

@@ -24,6 +26,14 @@ const router = createBrowserRouter([
2426
path: '/login',
2527
element: <LoginPage />,
2628
},
29+
{
30+
path: '/modal1',
31+
element: <Modal1Page />,
32+
},
33+
{
34+
path: '/modal2',
35+
element: <Modal2Page />,
36+
},
2737
{
2838
path: '/dashboard',
2939
element: <ProtectedRoute />,
138 KB
Loading
2.78 MB
Loading
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import React from 'react';
2+
import { Card, CardContent } from '../ui/card';
3+
import { Button } from '../ui/button';
4+
import fccLogo from '../../assets/fcc-logo.png';
5+
6+
interface HeaderDetailModalProps {
7+
heading: string;
8+
details: string;
9+
onSignInClick?: () => void;
10+
}
11+
12+
export const HeaderDetailModal: React.FC<HeaderDetailModalProps> = ({
13+
heading,
14+
details,
15+
onSignInClick,
16+
}) => {
17+
return (
18+
<div className="fixed inset-0 z-50 flex items-center justify-center p-4">
19+
<Card className="w-full max-w-[420px] bg-white shadow-2xl ring-0 rounded-[30px] px-5">
20+
<CardContent className="flex flex-col items-center gap-3 py-24 px-8 text-center">
21+
<img src={fccLogo} alt="FCC logo" className="w-[145px] h-[145px]" />
22+
<h1 className="text-2xl font-semibold text-[#0c7962]">{heading}</h1>
23+
<p className="w-full text-base text-neutral-500 text-left whitespace-pre-line leading-tight">
24+
{details}
25+
</p>
26+
<Button
27+
variant="success"
28+
onClick={onSignInClick}
29+
className="w-full h-12 text-base rounded-[50px] mt-5"
30+
>
31+
Sign in
32+
</Button>
33+
</CardContent>
34+
</Card>
35+
</div>
36+
);
37+
};
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import React from 'react';
2+
import { useNavigate } from 'react-router-dom';
3+
import { HeaderDetailModal } from '@components/HeaderDetailModal/HeaderDetailModal';
4+
import bostonBg from '../../assets/green-boston-background.png';
5+
6+
export const Modal1Page: React.FC = () => {
7+
const navigate = useNavigate();
8+
9+
const handleSignIn = () => {
10+
navigate('/');
11+
};
12+
13+
return (
14+
<div
15+
className="relative min-h-screen w-full bg-cover bg-center bg-no-repeat"
16+
style={{ backgroundImage: `url(${bostonBg})` }}
17+
>
18+
<HeaderDetailModal
19+
heading="Check your email"
20+
details="Instructions have been sent to your inbox."
21+
onSignInClick={handleSignIn}
22+
/>
23+
</div>
24+
);
25+
};
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import React from 'react';
2+
import { useNavigate } from 'react-router-dom';
3+
import { HeaderDetailModal } from '@components/HeaderDetailModal/HeaderDetailModal';
4+
import bostonBg from '../../assets/green-boston-background.png';
5+
6+
export const Modal2Page: React.FC = () => {
7+
const navigate = useNavigate();
8+
9+
const handleSignIn = () => {
10+
navigate('/');
11+
};
12+
13+
return (
14+
<div
15+
className="relative min-h-screen w-full bg-cover bg-center bg-no-repeat"
16+
style={{ backgroundImage: `url(${bostonBg})` }}
17+
>
18+
<HeaderDetailModal
19+
heading="Welcome!"
20+
details={
21+
'Your account has been successfully created.\n\nPlease wait for confirmation that your account has been verified by an admin.'
22+
}
23+
onSignInClick={handleSignIn}
24+
/>
25+
</div>
26+
);
27+
};

0 commit comments

Comments
 (0)