-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
217 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
apps/trip-tick/web/src/components/onboarding/Explainer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { H1, P } from '@a-type/ui/components/typography'; | ||
import { Explainer as ExplainerBase } from '@biscuits/client'; | ||
|
||
import screen1 from './screen1.png'; | ||
import screen2 from './screen2.png'; | ||
import screen3 from './screen3.png'; | ||
|
||
export function Explainer() { | ||
return <ExplainerBase stages={stages} />; | ||
} | ||
|
||
const stages = [ | ||
<> | ||
<H1>How to use Trip Tick</H1> | ||
<P> | ||
Trip Tick has two parts: <b>Trips</b> and <b>Lists</b>. | ||
</P> | ||
<img src={screen1} alt="Trip Tick screenshot" className="w-full" /> | ||
<P> | ||
Here's what a trip looks like with some lists added ("Grant" and | ||
"Pashka"). | ||
</P> | ||
</>, | ||
<> | ||
<H1>Lists</H1> | ||
<P> | ||
Lists are collections of items that you can add to a trip. You make a list | ||
once, then use it each time you plan a new trip. | ||
</P> | ||
<img src={screen2} alt="Trip Tick screenshot" className="w-full" /> | ||
<P> | ||
Your lists let Trip Tick do the math for you. Configure item quantities | ||
like "1 per 3 days" and the app will tell you how many to pack based on | ||
your trip length. | ||
</P> | ||
<P> | ||
You can create a list for anything you want to keep track of while | ||
packing, like a packing list or a to-do list. | ||
</P> | ||
</>, | ||
<> | ||
<H1>Trips</H1> | ||
<P> | ||
Trips are collections of lists that you can use to keep track of your | ||
packing progress. | ||
</P> | ||
<img src={screen3} alt="Trip Tick screenshot" className="w-full" /> | ||
<P> | ||
Each time you plan a new trip, you choose a date range and select which | ||
lists you need to pack. | ||
</P> | ||
<P> | ||
When it's time to start packing, you check off items from those lists as | ||
you add them to your bag. | ||
</P> | ||
<P>That's it. Save travels!</P> | ||
</>, | ||
]; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { Button } from '@a-type/ui/components/button'; | ||
import { | ||
Dialog, | ||
DialogContent, | ||
DialogActions, | ||
DialogClose, | ||
} from '@a-type/ui/components/dialog'; | ||
import { useLocalStorage } from '../hooks/useStorage.js'; | ||
import { ReactNode, useState } from 'react'; | ||
|
||
export interface ExplainerProps { | ||
stages: ReactNode[]; | ||
} | ||
|
||
export function Explainer({ stages }: ExplainerProps) { | ||
const [explainerDismissed, setExplainerDismissed] = useLocalStorage( | ||
'explainerDismissed', | ||
false, | ||
); | ||
const [stage, setStage] = useState(0); | ||
return ( | ||
<Dialog | ||
open={!explainerDismissed} | ||
onOpenChange={(open) => { | ||
if (!open) { | ||
setExplainerDismissed(true); | ||
} | ||
}} | ||
> | ||
<DialogContent | ||
outerClassName="h-screen max-h-none sm:max-h-[80vh] overflow-y-auto" | ||
className="h-screen sm:h-auto" | ||
> | ||
<div className="col gap-4 flex-1 items-start">{stages[stage]}</div> | ||
<DialogActions> | ||
<DialogClose asChild> | ||
<Button>Skip</Button> | ||
</DialogClose> | ||
<Button | ||
className="ml-auto" | ||
color="primary" | ||
onClick={() => { | ||
if (stage === stages.length - 1) { | ||
setExplainerDismissed(true); | ||
} else { | ||
setStage(stage + 1); | ||
} | ||
}} | ||
> | ||
{stage === stages.length - 1 ? 'Got it!' : 'Next'} | ||
</Button> | ||
</DialogActions> | ||
</DialogContent> | ||
</Dialog> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters