aboutsummaryrefslogtreecommitdiffstats
path: root/src/views/Authorization
diff options
context:
space:
mode:
authorLibravatar Mo Tarbin <mhed.t91@gmail.com>2024-09-06 01:22:55 -0400
committerLibravatar Mo Tarbin <mhed.t91@gmail.com>2024-09-06 01:22:55 -0400
commit2d2cf6d378d92aac31b3b09506bc6310466a0b07 (patch)
treea06c0135171256e9f28512dc840976615e802675 /src/views/Authorization
parentc35801d00fef528a87d226ed9e48cd3ba7856c50 (diff)
parent240633177cc646e6662f27e1334b5e83d962170d (diff)
downloaddonetick-frontend-2d2cf6d378d92aac31b3b09506bc6310466a0b07.tar.gz
donetick-frontend-2d2cf6d378d92aac31b3b09506bc6310466a0b07.tar.bz2
donetick-frontend-2d2cf6d378d92aac31b3b09506bc6310466a0b07.zip
- Add Cookie Permission component
- Add Filter button instead of chips in mychores view - show except days instead of showing evenything when days.length>4
Diffstat (limited to '')
-rw-r--r--src/views/Authorization/Signup.jsx17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/views/Authorization/Signup.jsx b/src/views/Authorization/Signup.jsx
index a1e312c..9e6cc70 100644
--- a/src/views/Authorization/Signup.jsx
+++ b/src/views/Authorization/Signup.jsx
@@ -7,6 +7,7 @@ import {
FormHelperText,
Input,
Sheet,
+ Snackbar,
Typography,
} from '@mui/joy'
import React from 'react'
@@ -25,6 +26,8 @@ const SignupView = () => {
const [emailError, setEmailError] = React.useState('')
const [displayNameError, setDisplayNameError] = React.useState('')
const [error, setError] = React.useState(null)
+ const [snackbarOpen, setSnackbarOpen] = React.useState(false)
+ const [snackbarMessage, setSnackbarMessage] = React.useState('')
const handleLogin = (username, password) => {
login(username, password).then(response => {
if (response.status === 200) {
@@ -39,6 +42,7 @@ const SignupView = () => {
})
} else {
console.log('Login failed', response)
+
// Navigate('/login')
}
})
@@ -101,7 +105,10 @@ const SignupView = () => {
handleLogin(username, password)
} else {
console.log('Signup failed')
- setError('Signup failed')
+ response.json().then(res => {
+ setError(res.error)
+ }
+ )
}
})
}
@@ -256,6 +263,14 @@ const SignupView = () => {
</Button>
</Sheet>
</Box>
+ <Snackbar
+ open={error !== null}
+ onClose={() => setError(null)}
+ autoHideDuration={5000}
+ message={error}
+ >
+ {error}
+ </Snackbar>
</Container>
)
}