Skip to content

Commit

Permalink
chore: Update auth pages ui @Isaac-Tait (#257)
Browse files Browse the repository at this point in the history
* chore: Update auth pages ui @Isaac-Tait

* chore: fix error Submit is defined but never used
  • Loading branch information
Isaac-Tait authored Jul 25, 2022
1 parent ba96032 commit 433d5b5
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 28 deletions.
8 changes: 4 additions & 4 deletions web/src/pages/ForgotPasswordPage/ForgotPasswordPage.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { useEffect, useRef } from 'react'

import { useAuth } from '@redwoodjs/auth'
import { Form, Label, TextField, Submit, FieldError } from '@redwoodjs/forms'
import { Form, Label, TextField, FieldError } from '@redwoodjs/forms'
import { navigate, routes } from '@redwoodjs/router'
import { MetaTags } from '@redwoodjs/web'
import { toast, Toaster } from '@redwoodjs/web/toast'

import Button from 'src/components/Button'

const ForgotPasswordPage = () => {
const { forgotPassword } = useAuth()

Expand Down Expand Up @@ -68,9 +70,7 @@ const ForgotPasswordPage = () => {
<FieldError name="username" className="rw-field-error" />
</div>

<div className="rw-button-group">
<Submit className="rw-button rw-button-blue">Submit</Submit>
</div>
<Button>Submit</Button>
</Form>
</div>
</div>
Expand Down
10 changes: 4 additions & 6 deletions web/src/pages/LoginPage/LoginPage.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { useRef } from 'react'
import { useEffect } from 'react'
import { useRef, useEffect } from 'react'

import { useAuth } from '@redwoodjs/auth'
import {
Form,
Label,
EmailField,
PasswordField,
Submit,
FieldError,
} from '@redwoodjs/forms'
import { Link, routes } from '@redwoodjs/router'
import { MetaTags } from '@redwoodjs/web'
import { toast, Toaster } from '@redwoodjs/web/toast'

import Button from 'src/components/Button'

const LoginPage = () => {
const { logIn } = useAuth()

Expand Down Expand Up @@ -102,9 +102,7 @@ const LoginPage = () => {

<FieldError name="password" className="rw-field-error" />

<div className="rw-button-group">
<Submit className="rw-button rw-button-blue">Login</Submit>
</div>
<Button>Login</Button>
</Form>
</div>
</div>
Expand Down
12 changes: 3 additions & 9 deletions web/src/pages/ResetPasswordPage/ResetPasswordPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ import {
Form,
Label,
PasswordField,
Submit,
FieldError,
} from '@redwoodjs/forms'
import { navigate, routes } from '@redwoodjs/router'
import { MetaTags } from '@redwoodjs/web'
import { toast, Toaster } from '@redwoodjs/web/toast'

import Button from 'src/components/Button'

const ResetPasswordPage = ({ resetToken }) => {
const { reauthenticate, validateResetToken, resetPassword } = useAuth()
const [enabled, setEnabled] = useState(true)
Expand Down Expand Up @@ -92,14 +93,7 @@ const ResetPasswordPage = ({ resetToken }) => {
<FieldError name="password" className="rw-field-error" />
</div>

<div className="rw-button-group">
<Submit
className="rw-button rw-button-blue"
disabled={!enabled}
>
Submit
</Submit>
</div>
<Button disabled={!enabled}>Submit</Button>
</Form>
</div>
</div>
Expand Down
14 changes: 5 additions & 9 deletions web/src/pages/SignupPage/SignupPage.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { useRef } from 'react'
import { useEffect } from 'react'
import { useRef, useEffect } from 'react'

import { useAuth } from '@redwoodjs/auth'
import {
Form,
Label,
EmailField,
PasswordField,
FieldError,
Submit,
FieldError
} from '@redwoodjs/forms'
import { Link, routes } from '@redwoodjs/router'
import { MetaTags } from '@redwoodjs/web'
import { toast, Toaster } from '@redwoodjs/web/toast'

import Button from 'src/components/Button'

const SignupPage = () => {
const { signUp } = useAuth()

Expand Down Expand Up @@ -95,11 +95,7 @@ const SignupPage = () => {

<FieldError name="password" className="rw-field-error" />

<div className="rw-button-group">
<Submit className="rw-button rw-button-blue">
Sign Up
</Submit>
</div>
<Button>Sign Up</Button>
</Form>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions web/src/scaffold.css
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@
.rw-input {
display: block;
margin-top: 0.5rem;
margin-bottom: 0.5rem;
width: 100%;
padding: 0.5rem;
border-width: 1px;
Expand Down

0 comments on commit 433d5b5

Please sign in to comment.