Skip to content

Commit

Permalink
fix auth page layout and css
Browse files Browse the repository at this point in the history
  • Loading branch information
javtran committed Aug 28, 2024
1 parent ad2b79f commit 0a8c9f3
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 52 deletions.
7 changes: 0 additions & 7 deletions client/src/pages/auth/form.module.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.header {
text-align: center;
margin: 2rem 0;
}

.header > p {
Expand All @@ -19,9 +18,3 @@
color: #2b8a3e;
font-size: small;
}

@media (min-width: 48em) {
.header {
margin: 8.75rem 0 2rem 0;
}
}
2 changes: 1 addition & 1 deletion client/src/pages/auth/login/login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { StatusCodes } from 'http-status-codes';
import { useAuthorization } from '../../../hooks/useAuthorization';
import { LoginForm } from './LoginForm';

import classes from './login.module.css';
import classes from '../form.module.css';

/**
* Login page component.
Expand Down
11 changes: 0 additions & 11 deletions client/src/pages/auth/login/login.module.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
.header {
text-align: center;
margin: 2rem 0;
}

.email {
margin-bottom: 1.5rem;
}
Expand All @@ -17,12 +12,6 @@
padding-top: 0.5rem;
}

@media (min-width: 48em) {
.header {
margin: 8.75rem 0 2rem 0;
}
}

.loginBtn {
margin-top: 1.5rem;
}
53 changes: 25 additions & 28 deletions client/src/pages/auth/register/register.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react';
import classes from './register.module.css';
import classes from '../form.module.css';
import { RegisterForm } from './RegisterForm';
import { Flex } from '@mantine/core';
import { useParams } from 'react-router-dom';
Expand Down Expand Up @@ -158,34 +158,31 @@ function Register() {
}

return (
<div className={classes.register}>
<div className={classes.banner}>Image goes here</div>
<div>
<div className={classes.header}>
<h2>Interest Form</h2>
<p>
description of filling out interest form to start account
registration process
</p>
</div>
<Flex direction="column" gap="md">
<RegisterForm
user={user}
errors={errors}
isLoading={isLoading}
showLicenseHelper={showLicenseHelper}
onFormChange={onFormChange}
onSubmit={formState === 1 ? fetchLicenseNumber : handleRegister}
setShowLicenseHelper={() => {
setShowLicenseHelper(!showLicenseHelper);
}}
formState={formState}
showLicenseField={
!inviteId || (inviteId && user.role == 'FIRST_RESPONDER')
}
/>
</Flex>
<div>
<div className={classes.header}>
<h2>Interest Form</h2>
<p>
description of filling out interest form to start account registration
process
</p>
</div>
<Flex direction="column" gap="md">
<RegisterForm
user={user}
errors={errors}
isLoading={isLoading}
showLicenseHelper={showLicenseHelper}
onFormChange={onFormChange}
onSubmit={formState === 1 ? fetchLicenseNumber : handleRegister}
setShowLicenseHelper={() => {
setShowLicenseHelper(!showLicenseHelper);
}}
formState={formState}
showLicenseField={
!inviteId || (inviteId && user.role == 'FIRST_RESPONDER')
}
/>
</Flex>
</div>
);
}
Expand Down
4 changes: 3 additions & 1 deletion client/src/stories/AuthLayout/AuthLayout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ export default function AuthLayout() {
return (
<div className="auth-layout">
<div className="banner">testing</div>
<Outlet />
<div className="form">
<Outlet />
</div>
</div>
);
}
17 changes: 13 additions & 4 deletions client/src/stories/AuthLayout/authlayout.css
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
.auth-layout {
width: 100vw;
height: 100vh;
height: 100dvh;
min-height: 100vh;
min-height: 100dvh;
}

.banner {
display: none;
}

.form {
padding: 2rem 1rem;
}

@media (min-width: 48em) {
.auth-layout {
display: flex;
height: 100vh;
min-height: 100vh;

& > * {
flex: 1;
Expand All @@ -21,7 +25,12 @@
.banner {
display: block;
width: 100%;
height: 100%;
min-height: 100%;
background-color: aqua;
background-size: cover;
}

.form {
padding: 4rem 1rem;
}
}

0 comments on commit 0a8c9f3

Please sign in to comment.