Skip to content

Commit

Permalink
added a couple of updates and enhancements on waitlist flow (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
arkhurst authored Mar 12, 2024
1 parent 484f212 commit 1f0c6d6
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 25 deletions.
34 changes: 27 additions & 7 deletions apps/wait-list/app/components/layout/header.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import {Link} from '@remix-run/react'
import {APP_NAME} from '@/constants/index.ts'
import {Button} from '@/components/button/index.tsx'
import {useWaitListModal} from '@/providers/walt-list-popup/index.tsx'

type Props = {
showWaitlist?: boolean
}

export const Header = ({showWaitlist = false}: Props) => {
const {handleShowWaitListForm} = useWaitListModal()

export const Header = () => {
return (
<header className="absolute top-0 z-50 bg-white/10 w-full">
<nav
Expand All @@ -19,12 +26,25 @@ export const Header = () => {
</Link>

<div className="flex justify-center items-center gap-x-12">
<Button href="/learn-more" variant="outline" isLink>
Learn more{' '}
<span className="pl-1" aria-hidden="true">
&rarr;
</span>
</Button>
{showWaitlist ? (
<Button
onClick={handleShowWaitListForm}
type="button"
variant="outline"
>
Join waitlist{' '}
<span className="pl-1" aria-hidden="true">
&rarr;
</span>
</Button>
) : (
<Button href="/learn-more" variant="outline" isLink>
Learn more{' '}
<span className="pl-1" aria-hidden="true">
&rarr;
</span>
</Button>
)}
</div>
</nav>
</header>
Expand Down
Binary file added apps/wait-list/app/images/Edward.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 3 additions & 9 deletions apps/wait-list/app/modules/landing-page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ import {PhotoGrid} from '@/components/image-slider/index.jsx'
import {BackgroundContainer} from '@/components/layout/container.tsx'
import {Header} from '@/components/layout/header.tsx'
import {MovingBorderButton} from '@/components/moving-border/index.tsx'
import {useBoolean} from '@/hooks/use-boolean.ts'
import WaitListForm from './modals/wait-list-form/index.tsx'
import {useWaitListModal} from '@/providers/walt-list-popup/index.tsx'

export const LandingPageModule = () => {
const {value: showWaitListForm, setValue, setFalse, setTrue} = useBoolean()
const {handleShowWaitListForm} = useWaitListModal()

return (
<BackgroundContainer>
Expand All @@ -23,7 +22,7 @@ export const LandingPageModule = () => {
</p>
<MovingBorderButton
borderRadius="1.25rem"
onClick={setTrue}
onClick={handleShowWaitListForm}
className="bg-white text-base font-medium text-black border-gray-200 border "
>
Join waitlist{' '}
Expand All @@ -34,11 +33,6 @@ export const LandingPageModule = () => {
</div>
</div>
<PhotoGrid />
<WaitListForm
show={showWaitListForm}
setShow={setValue}
handleClose={setFalse}
/>
</BackgroundContainer>
)
}
16 changes: 8 additions & 8 deletions apps/wait-list/app/modules/learn-more/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Fiifi from '@/images/fiifi.jpeg'
import Ronnie from '@/images/ronnie.jpeg'
import Audrey from '@/images/audrey.jpeg'
import Nkay from '@/images/nkay.jpg'
import Edward from '@/images/Edward.png'

const faqs = [
{
Expand Down Expand Up @@ -48,13 +49,12 @@ const people = [
designation: 'Software Engineer',
image: Fiifi,
},
// {
// id: 3,
// name: 'Edward',
// designation: 'Software Engineer',
// image:
// 'https://images.unsplash.com/photo-1580489944761-15a19d654956?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8NXx8YXZhdGFyfGVufDB8fDB8fHww&auto=format&fit=crop&w=800&q=60',
// },
{
id: 3,
name: 'Edward',
designation: 'Software Engineer',
image: Edward,
},
{
id: 4,
name: 'Ronnie',
Expand Down Expand Up @@ -87,7 +87,7 @@ export const LearnMoreModule = () => {
<BackgroundContainer>
<div className="flex flex-col justify-between items-center h-full">
<div className="flex flex-col justify-center items-center ">
<Header />
<Header showWaitlist />
<div className="mx-auto max-w-6xl px-6 py-20 sm:py-24 lg:px-8">
<div className="mx-auto max-w-2xl text-center">
<h2 className="text-2xl font-bold leading-10 tracking-tight text-black">
Expand Down
7 changes: 6 additions & 1 deletion apps/wait-list/app/providers/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import {type PropsWithChildren} from 'react'
import {ReactQueryProvider} from './react-query/index.tsx'
import {WaitListModalProvider} from './walt-list-popup/index.tsx'

export const Providers = ({children}: PropsWithChildren) => {
return <ReactQueryProvider>{children}</ReactQueryProvider>
return (
<ReactQueryProvider>
<WaitListModalProvider>{children}</WaitListModalProvider>
</ReactQueryProvider>
)
}
38 changes: 38 additions & 0 deletions apps/wait-list/app/providers/walt-list-popup/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import {useBoolean} from '@/hooks/use-boolean.ts'
import WaitListForm from '@/modules/landing-page/modals/wait-list-form/index.tsx'
import React, {useContext, type PropsWithChildren} from 'react'

interface ModalContextType {
showWaitListForm: boolean
setShowWaitListForm: React.Dispatch<React.SetStateAction<boolean>>
handleShowWaitListForm: () => void
handleCloseWaitListForm: () => void
}

const WaitListModalContext = React.createContext<ModalContextType>(
{} as ModalContextType,
)

export const WaitListModalProvider = ({children}: PropsWithChildren) => {
const {value: showWaitListForm, setValue, setFalse, setTrue} = useBoolean()

return (
<WaitListModalContext.Provider
value={{
showWaitListForm,
setShowWaitListForm: setValue,
handleCloseWaitListForm: setFalse,
handleShowWaitListForm: setTrue,
}}
>
{children}
<WaitListForm
show={showWaitListForm}
setShow={setValue}
handleClose={setFalse}
/>
</WaitListModalContext.Provider>
)
}

export const useWaitListModal = () => useContext(WaitListModalContext)

0 comments on commit 1f0c6d6

Please sign in to comment.