diff --git a/src/components/common/LinkButton/index.tsx b/src/components/common/LinkButton/index.tsx index 03aa72e1..4f08e5dd 100644 --- a/src/components/common/LinkButton/index.tsx +++ b/src/components/common/LinkButton/index.tsx @@ -9,10 +9,18 @@ interface IProps { destructive?: boolean; href: URL; size?: 'default' | 'small'; + onClick?: () => void; } const LinkButton = (props: PropsWithChildren) => { - const { variant = 'primary', destructive = false, href, size = 'default', children } = props; + const { + variant = 'primary', + destructive = false, + href, + size = 'default', + onClick, + children, + } = props; return ( ) => { data-destructive={destructive} data-size={size} href={href} + onClick={onClick} > {children} diff --git a/src/components/layout/Navbar/index.tsx b/src/components/layout/Navbar/index.tsx index 0077e596..ede1f418 100644 --- a/src/components/layout/Navbar/index.tsx +++ b/src/components/layout/Navbar/index.tsx @@ -49,7 +49,7 @@ const Navbar = ({ accessType, quiet }: NavbarProps) => { if (!isMobile) setMenuOpen(false); }, [isMobile]); - if (!accessType) { + if (!accessType || quiet) { return (
diff --git a/src/components/onboarding/OnboardingScreen/index.tsx b/src/components/onboarding/OnboardingScreen/index.tsx index 0187c905..974cded8 100644 --- a/src/components/onboarding/OnboardingScreen/index.tsx +++ b/src/components/onboarding/OnboardingScreen/index.tsx @@ -110,12 +110,12 @@ const OnboardingScreen = ({ user, onDismiss, onFinish }: OnboardingScreenProps) > {step > 0 ? 'Back' : 'Maybe later'} - {!onFinish && step === steps.length - 1 ? ( - Finish + {step === steps.length - 1 ? ( + + Set up + ) : ( - + )}
diff --git a/src/lib/config.ts b/src/lib/config.ts index f2ffa891..3ebecd6e 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -131,6 +131,7 @@ const config = { MAX_COLLECTION_PHOTO_SIZE_KB: 1024, MAX_RESUME_SIZE_KB: isDevelopment ? 256 : 2048, }, + tempLocalOnboardingKey: 'onboarding', }; export default config; diff --git a/src/pages/index.tsx b/src/pages/index.tsx index e8a1d884..9bddf62c 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -13,6 +13,7 @@ import WavesGraphic from '@/public/assets/graphics/portal/waves.svg'; import CheckMark from '@/public/assets/icons/check-mark.svg'; import styles from '@/styles/pages/Home.module.scss'; import Link from 'next/link'; +import { useRouter } from 'next/router'; import { useEffect, useState } from 'react'; interface HomePageProps { @@ -41,6 +42,7 @@ const PortalHomePage = ({ attendances, checkInResponse, }: HomePageProps) => { + const router = useRouter(); const [points, setPoints] = useState(user.points); const [checkinEvent, setCheckinEvent] = useState(undefined); const [checkinModalVisible, setCheckinModalVisible] = useState(false); @@ -91,7 +93,19 @@ const PortalHomePage = ({ setCheckinModalVisible(false)} + onClose={() => { + setCheckinModalVisible(false); + + // Start onboarding after checking in + // TEMP: This should be saved server-side in the future + const onboardingState = localStorage.getItem(config.tempLocalOnboardingKey); + if (onboardingState === 'onboarded') { + return; + } + router.push( + `${config.onboardRoute}?${new URLSearchParams({ destination: config.homeRoute })}` + ); + }} />
diff --git a/src/pages/onboard.tsx b/src/pages/onboard.tsx index 34f63577..807074b4 100644 --- a/src/pages/onboard.tsx +++ b/src/pages/onboard.tsx @@ -21,7 +21,13 @@ const OnboardPage: NextPage = ({ user, destination }) => { return (
- + { + localStorage.setItem(config.tempLocalOnboardingKey, 'onboarded'); + }} + />
); };