summaryrefslogtreecommitdiff
path: root/client/src/components/GuestLogin.tsx
diff options
context:
space:
mode:
authorMichael Hunteman <michael@huntm.net>2024-09-21 08:00:39 -0700
committerMichael Hunteman <michael@huntm.net>2024-09-21 11:39:18 -0700
commit2133253836de428e58b4ba1c9b7e863485b6b870 (patch)
tree9c175fd811975a21fcf60a5b14004443d32fe989 /client/src/components/GuestLogin.tsx
parenta54a93b724a6104213b17271fc298e37adedc1c5 (diff)
Use snackbar globally
Diffstat (limited to 'client/src/components/GuestLogin.tsx')
-rw-r--r--client/src/components/GuestLogin.tsx8
1 files changed, 3 insertions, 5 deletions
diff --git a/client/src/components/GuestLogin.tsx b/client/src/components/GuestLogin.tsx
index 0d3e8b1..9a9bf8e 100644
--- a/client/src/components/GuestLogin.tsx
+++ b/client/src/components/GuestLogin.tsx
@@ -5,8 +5,7 @@ import { Button, Paper, TextField, Typography } from '@mui/material';
import { useForm } from 'react-hook-form';
import { setGuest } from '../slices/auth/guestSlice';
import { useLoginGuestMutation } from '../slices/api/guestSlice';
-import Status from './Status';
-import { open } from '../slices/snackbarSlice';
+import { showSnackbar } from '../slices/snackbarSlice';
import { isFetchBaseQueryError } from '../error';
import type { Data } from '../error';
import type { Name } from '../models';
@@ -34,14 +33,14 @@ function GuestLogin() {
} catch (error) {
if (isFetchBaseQueryError(error)) {
dispatch(
- open({
+ showSnackbar({
message: (error.data as Data).message,
severity: 'error',
})
);
} else {
dispatch(
- open({
+ showSnackbar({
message: 'No response',
severity: 'error',
})
@@ -99,7 +98,6 @@ function GuestLogin() {
<Button type="submit" variant="contained" fullWidth sx={{ mt: 2 }}>
Log in
</Button>
- <Status />
</Paper>
</form>
);