summaryrefslogtreecommitdiff
path: root/src/components/Rsvp.tsx
diff options
context:
space:
mode:
authorMichael Hunteman <michael@huntm.net>2024-03-01 07:44:28 -0800
committerMichael Hunteman <michael@huntm.net>2024-03-01 07:44:28 -0800
commit2b3d32a641da19c9d807f1877efcbe1a130c5e23 (patch)
tree040b0bdced188912e3fbbeafdb3d2cbbc784676f /src/components/Rsvp.tsx
parentfa1409d205479e9943f7b7db96a4b56ff1d29d7d (diff)
Use guest for login and RSVP update
Diffstat (limited to 'src/components/Rsvp.tsx')
-rw-r--r--src/components/Rsvp.tsx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/components/Rsvp.tsx b/src/components/Rsvp.tsx
index 1b26e2d..104196f 100644
--- a/src/components/Rsvp.tsx
+++ b/src/components/Rsvp.tsx
@@ -3,22 +3,22 @@ import { useLocation, Navigate, Outlet } from 'react-router-dom';
import { useSelector } from 'react-redux';
import CssBaseline from '@mui/material/CssBaseline';
import NavBar from './NavBar';
-import { selectCurrentUser } from '../features/auth/authSlice';
+import { selectCurrentGuest } from '../features/auth/authSlice';
const authenticate = () => {
- const user = useSelector(selectCurrentUser);
- return useMemo(() => ({ user }), [user]);
+ const guest = useSelector(selectCurrentGuest);
+ return useMemo(() => ({ guest }), [guest]);
};
function Rsvp() {
const auth = authenticate();
const location = useLocation();
- return auth.user ? (
+ return auth?.guest ? (
<>
<CssBaseline />
<NavBar />
- <Outlet context={auth} />
+ <Outlet context={auth?.guest} />
</>
) : (
<Navigate to="/guest-login" state={{ from: location }} replace />