This commit is contained in:
parent
5e811d4bb8
commit
29098d1f61
40 changed files with 3113 additions and 515 deletions
29
src/theme/OnboardingPage.tsx
Normal file
29
src/theme/OnboardingPage.tsx
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import { useState } from "react";
|
||||
|
||||
import { useOnboardingStep } from "../cmp/onboarding-flow";
|
||||
import { ThemeCustomizer } from "./pickers/StylePicker";
|
||||
|
||||
export function ThemeOnboardingPage({
|
||||
value,
|
||||
onValueChange,
|
||||
}: {
|
||||
value?: string | null;
|
||||
onValueChange?: (id: string) => void;
|
||||
}) {
|
||||
const [localThemeId, setLocalThemeId] = useState<string | null>(null);
|
||||
const chosenThemeId = value === undefined ? localThemeId : value;
|
||||
useOnboardingStep({ canContinue: chosenThemeId !== null });
|
||||
|
||||
const choose = (id: string) => {
|
||||
setLocalThemeId(id);
|
||||
onValueChange?.(id);
|
||||
};
|
||||
|
||||
return (
|
||||
<ThemeCustomizer
|
||||
value={chosenThemeId}
|
||||
onValueChange={choose}
|
||||
showHeader={false}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in a new issue