Skip to content

Commit 1864711

Browse files
Fixed system theme for hero demo (#621)
1 parent fb071c6 commit 1864711

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

docs/components/pages/landing/hero/Demo.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ const DemoEditor = dynamic(
2929
},
3030
);
3131

32-
export function Demo(props: { theme: "light" | "dark" }) {
32+
export function Demo(props: { theme?: "light" | "dark" }) {
3333
return (
3434
<div className="hero relative h-[36rem] w-full shrink-0 grow-0 rounded-lg xl:w-[584px]">
3535
<div className="editor-glow absolute z-10 h-full w-full" />
3636
<div className="relative z-20 h-full w-full rounded-lg bg-white dark:bg-[#202020]">
37-
<DemoEditor theme={props.theme === "dark" ? "dark" : "light"} />
37+
<DemoEditor theme={props.theme} />
3838
</div>
3939
<TryHereImage />
4040
</div>

docs/components/pages/landing/hero/DemoEditor.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,8 @@ function getUTCDateYYYYMMDD() {
5454
return `${year}${formattedMonth}${formattedDay}`;
5555
}
5656

57-
export default function DemoEditor(props: { theme: "light" | "dark" }) {
57+
export default function DemoEditor(props: { theme?: "light" | "dark" }) {
5858
const [doc, provider] = useMemo(() => {
59-
console.log("create");
6059
const doc = new Y.Doc();
6160
const provider = new YPartyKitProvider(
6261
"blocknote.yousefed.partykit.dev",

docs/components/pages/landing/hero/Hero.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ export function Hero() {
1515
"z-20 flex w-full flex-col items-center justify-between gap-6 px-6 md:max-w-screen-md xl:max-w-[1440px] xl:flex-row"
1616
}>
1717
<Text />
18-
<Demo theme={theme === "dark" ? "dark" : "light"} />
18+
<Demo
19+
theme={
20+
theme === undefined || theme === "system"
21+
? undefined
22+
: (theme as "light" | "dark" | undefined)
23+
}
24+
/>
1925
</FadeIn>
2026
</Section>
2127
);

0 commit comments

Comments
 (0)