Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontend - Login #27

Merged
merged 21 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@

- [`server`](./server/): backend
- [`client`](./client/): frontend



### Useful Documentation Links:
- https://nextjs.org/docs/app/getting-started/layouts-and-pages (Creating new routes)
- Some components imported from https://mui.com/
WishingWell13 marked this conversation as resolved.
Show resolved Hide resolved
Binary file added client/public/assets/binary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
109 changes: 109 additions & 0 deletions client/public/assets/binary.svg
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this file used anywhere

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions client/public/assets/error.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 51 additions & 0 deletions client/src/app/login/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import Card from '@/components/Card';
import styles from '../page.module.scss';
import Heading from '@/components/Heading';
import Button from '@/components/Button';
import Typography from '@/components/Typography';
import TextField from '@/components/TextField';
import Link from 'next/link';
import Alert from '@/components/Alert';
import Binary from '@/../public/assets/binary.png';

export default function LoginPage() {
return (
<main className={`${styles.main}`}>
<div className={`${styles.login}`}>
<Card gap={1}>
<Heading centered>Log In</Heading>

<Alert marginBottom={0}>
<p>Oops, incorrect email or password.</p>
</Alert>

<TextField
id="outlined-basic"
variant="outlined"
label={'Email Address'}
defaultText={'Enter Email Address'}
/>

<TextField
id="outlined-basic"
variant="outlined"
label="Password"
defaultText={'Enter Password'}
/>

<Link href="/forgot-password">Forgot your password?</Link>

<Button variant="primary">Apply Now</Button>

<Typography variant="label/medium" component="p">
Don&apos;t have an account?{' '}
WishingWell13 marked this conversation as resolved.
Show resolved Hide resolved
<Link href="/register" className="link">
{' '}
Sign up!
</Link>{' '}
</Typography>
</Card>
</div>
</main>
);
}
14 changes: 14 additions & 0 deletions client/src/app/page.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@
flex-direction: column;
gap: 10rem;
padding: 6rem var(--side-padding);
background-image: url(/assets/binary.png);
background-size: cover;
background-position: center bottom;
width: 100%;
height: 100%;
}

.login {
padding: 32px;
align-self: center;
align-items: stretch;

max-width: 646px;
width: 100%;
}

.buttonRow {
Expand Down
21 changes: 21 additions & 0 deletions client/src/components/Alert/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import styles from './style.module.scss';
import Error from '../../../public/assets/error.svg';
import { PropsWithChildren } from 'react';

interface AlertProps {
marginBottom: 0 | 1 | 1.5 | 2;
}

const Alert = ({ marginBottom, children }: PropsWithChildren<AlertProps>) => {
return (
<div className={styles.alert} style={{ marginBottom: `${marginBottom}rem` }}>
<div className="error">
<Error />
</div>

{children}
</div>
);
};

export default Alert;
Comment on lines +1 to +21
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're doing font stuff here might as well just use Typography. Also, what's the difference between this and useToast from portal-v2? If it's similar, let's just use toasts

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

From the Figma it doesn't look like a pop up? Let me know if toasts can be non popup or if we want to change the error to a pop up

20 changes: 20 additions & 0 deletions client/src/components/Alert/style.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@use '@/styles/vars.scss' as vars;

.error {
flex: none;
}
.alert {
display: inline flex;
border-radius: 2rem;
gap: 0.5rem;
align-items: flex-start;
justify-content: flex-start;
color: vars.$btn-text;
// Corresponds to diamond-theme/label/small
font-weight: 500;
letter-spacing: 0.5px;

color: vars.$error-red;

flex-flow: row nowrap;
}
4 changes: 2 additions & 2 deletions client/src/components/DashboardStatus/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ const DashboardStatus = ({ status, timeline }: DashboardStatusProps) => {
{status === 'not-started'
? 'Apply Now'
: status === 'incomplete'
? 'Continue Application'
: 'Edit Application'}
? 'Continue Application'
: 'Edit Application'}
</Button>
)}
</>
Expand Down
8 changes: 8 additions & 0 deletions client/src/styles/globals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ body {
a {
color: inherit;
text-decoration: none;

&.link {
color: vars.$btn-primary;

&:hover {
text-decoration: underline;
}
}
}
button {
border: none;
Expand Down
2 changes: 2 additions & 0 deletions client/src/styles/vars.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ $side-padding-mobile: 1rem;

$card-padding: 2rem;
$card-padding-mobile: 1rem;

$error-red: #ffb3b4;
Loading
Loading