From 2657469964e24ffbeb905024532120395f6e797c Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Sun, 30 Jun 2024 18:55:39 -0400 Subject: move to Donetick Org, First commit frontend --- src/views/Circles/JoinCircle.jsx | 154 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 src/views/Circles/JoinCircle.jsx (limited to 'src/views/Circles') diff --git a/src/views/Circles/JoinCircle.jsx b/src/views/Circles/JoinCircle.jsx new file mode 100644 index 0000000..fd6d542 --- /dev/null +++ b/src/views/Circles/JoinCircle.jsx @@ -0,0 +1,154 @@ +import { Box, Container, Input, Sheet, Typography } from '@mui/joy' +import Logo from '../../Logo' + +import { Button } from '@mui/joy' +import { useContext } from 'react' +import { useNavigate, useSearchParams } from 'react-router-dom' +import { UserContext } from '../../contexts/UserContext' +import { JoinCircle } from '../../utils/Fetcher' +const JoinCircleView = () => { + const { userProfile, setUserProfile } = useContext(UserContext) + let [searchParams, setSearchParams] = useSearchParams() + const navigate = useNavigate() + const code = searchParams.get('code') + + return ( + + + + {/* logo */} + + + + Done + + tick + + + {code && userProfile && ( + <> + + Hi {userProfile?.displayName}, you have been invited to join the + circle{' '} + + + + Joining will give you access to the circle's chores and members. + + + You can leave the circle later from you Settings page. + + + + + )} + {!code || + (!userProfile && ( + <> + + You need to be logged in to join a circle + + + Login or sign up to continue + + + + ))} + + + + ) +} + +export default JoinCircleView -- cgit