From dc95bd7455adc85a3ef9fe7ee986c18b9486150f Mon Sep 17 00:00:00 2001 From: mrjvs Date: Thu, 18 Jan 2024 19:22:55 +0100 Subject: [PATCH] Add full layout and styling for the first step in onboarding Co-authored-by: Jip Frijlink --- src/components/layout/Stepper.tsx | 4 +- src/components/layout/ThinContainer.tsx | 2 +- src/pages/onboarding/Onboarding.tsx | 67 ++++++++++++++++++++++--- src/pages/onboarding/utils.tsx | 59 ++++++++++++++++++++++ themes/default.ts | 14 ++++++ 5 files changed, 137 insertions(+), 9 deletions(-) create mode 100644 src/pages/onboarding/utils.tsx diff --git a/src/components/layout/Stepper.tsx b/src/components/layout/Stepper.tsx index d0c9c499..867a438c 100644 --- a/src/components/layout/Stepper.tsx +++ b/src/components/layout/Stepper.tsx @@ -12,9 +12,9 @@ export function Stepper(props: StepperProps) {

{props.current}/{props.steps}

-
+
-
{props.children}
+
{props.children}
); } diff --git a/src/pages/onboarding/Onboarding.tsx b/src/pages/onboarding/Onboarding.tsx index 3247a7ee..05879507 100644 --- a/src/pages/onboarding/Onboarding.tsx +++ b/src/pages/onboarding/Onboarding.tsx @@ -1,14 +1,24 @@ +import classNames from "classnames"; import { useNavigate } from "react-router-dom"; import { Button } from "@/components/buttons/Button"; import { Stepper } from "@/components/layout/Stepper"; import { CenterContainer } from "@/components/layout/ThinContainer"; import { Modal, ModalCard, useModal } from "@/components/overlays/Modal"; -import { Heading2, Paragraph } from "@/components/utils/Text"; +import { Heading1, Heading2, Paragraph } from "@/components/utils/Text"; import { MinimalPageLayout } from "@/pages/layouts/MinimalPageLayout"; import { useRedirectBack } from "@/pages/onboarding/onboardingHooks"; +import { Card, CardContent, Link } from "@/pages/onboarding/utils"; import { PageTitle } from "@/pages/parts/util/PageTitle"; +function VerticalLine(props: { className?: string }) { + return ( +
+
+
+ ); +} + export function OnboardingPage() { const navigate = useNavigate(); const skipModal = useModal("skip"); @@ -20,7 +30,7 @@ export function OnboardingPage() { - Lorem ipsum + Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum - + */} ); diff --git a/src/pages/onboarding/utils.tsx b/src/pages/onboarding/utils.tsx new file mode 100644 index 00000000..eaf722b2 --- /dev/null +++ b/src/pages/onboarding/utils.tsx @@ -0,0 +1,59 @@ +import classNames from "classnames"; + +import { Icon, Icons } from "@/components/Icon"; +import { Heading2, Heading3, Paragraph } from "@/components/utils/Text"; + +export function Card(props: { + children: React.ReactNode; + onClick: () => void; +}) { + return ( +
+ {props.children} +
+ ); +} + +export function CardContent(props: { + title: string; + description: string; + subtitle: string; + colorClass: string; + children?: React.ReactNode; +}) { + return ( +
+
+ + + {props.subtitle} + + {props.title} + + {props.description} + +
+
{props.children}
+
+ ); +} + +export function Link(props: { children: React.ReactNode }) { + return ( + + {props.children} + + + ); +} diff --git a/themes/default.ts b/themes/default.ts index 7a010338..bf2510ff 100644 --- a/themes/default.ts +++ b/themes/default.ts @@ -228,10 +228,24 @@ export const defaultTheme = { } }, + // Utilities utils: { divider: tokens.ash.c300, }, + // Onboarding + onboarding: { + bar: tokens.shade.c400, + barFilled: tokens.purple.c300, + divider: tokens.shade.c200, + card: tokens.shade.c800, + cardHover: tokens.shade.c700, + border: tokens.shade.c600, + good: tokens.purple.c100, + best: tokens.semantic.yellow.c100, + link: tokens.purple.c100, + }, + // Error page errors: { card: tokens.shade.c800,