Skip to content

Commit

Permalink
Merge branch 'dev' into password-progress-bar
Browse files Browse the repository at this point in the history
  • Loading branch information
francisli committed Sep 4, 2024
2 parents 4c74c44 + 3bf6d7f commit e548262
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 56 deletions.
9 changes: 8 additions & 1 deletion client/src/pages/admin/users/InviteModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,14 @@ export function InviteModal({ opened, close }) {
<Button variant="outline" color="gray" onClick={onClose}>
Cancel
</Button>
<Button type="submit">Send Invite</Button>
<Button
disabled={
!form.getValues().name.length || !form.getValues().email.length
}
type="submit"
>
Send Invite
</Button>
</Group>
</form>
</Modal>
Expand Down
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;
}
}
1 change: 1 addition & 0 deletions client/src/pages/auth/login/LoginForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export function LoginForm({
</Container>
<Container size="25rem">
<Button
disabled={!email.length || !password.length}
className={classes.loginBtn}
variant="filled"
fullWidth
Expand Down
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
11 changes: 7 additions & 4 deletions client/src/stories/AuthLayout/AuthLayout.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import React from 'react';
import { Outlet } from 'react-router-dom';

import './authlayout.css';
import classes from './authlayout.module.css';

/**
* Auth Layout for login, register, password reset
*/
export default function AuthLayout() {
return (
<div className="auth-layout">
<div className="banner">testing</div>
<Outlet />
<div className={classes['auth-layout']}>
<div className={classes.banner}>testing</div>
<div className={classes.form}>
<Outlet />
</div>
</div>
);
}
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 e548262

Please sign in to comment.