Skip to content

Commit

Permalink
disable submit buttons if inputs are empty, changed css to module css
Browse files Browse the repository at this point in the history
  • Loading branch information
javtran committed Sep 2, 2024
1 parent 0a8c9f3 commit 2d6b9d0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
11 changes: 9 additions & 2 deletions client/src/pages/admin/users/InviteModal.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { useEffect } from 'react';

Check failure on line 1 in client/src/pages/admin/users/InviteModal.jsx

View workflow job for this annotation

GitHub Actions / CI

'useEffect' is defined but never used
import { Modal, Select, TextInput, Group, Button } from '@mantine/core';
import { useForm } from '@mantine/form';
import { notifications } from '@mantine/notifications';
Expand Down 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
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
9 changes: 5 additions & 4 deletions client/src/stories/AuthLayout/AuthLayout.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
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>
<div className="form">
<div className={classes['auth-layout']}>
<div className={classes.banner}>testing</div>
<div className={classes.form}>
<Outlet />
</div>
</div>
Expand Down

0 comments on commit 2d6b9d0

Please sign in to comment.