Skip to content

Commit 1c3a145

Browse files
fix(web): corrected types
1 parent 26a9051 commit 1c3a145

File tree

3 files changed

+11
-21
lines changed

3 files changed

+11
-21
lines changed

apps/docs/app/docs/layout.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1+
import { PropsWithChildren } from "react";
12
import { Layout } from "../../components/Layout";
23

3-
export default function DocsLayout({
4-
children,
5-
}: {
6-
children: React.ReactNode;
7-
}) {
4+
export default function DocsLayout({ children }: PropsWithChildren) {
85
return <Layout>{children}</Layout>;
96
}

apps/docs/app/themes/ThemeWrapper.tsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
TooltipTrigger,
2525
} from "@rafty/ui";
2626
import { useTheme } from "next-themes";
27-
import { Dispatch, ReactNode, SetStateAction, useState } from "react";
27+
import { Dispatch, PropsWithChildren, SetStateAction, useState } from "react";
2828
import { Fence } from "../../components/Fence";
2929

3030
const COLOR_THEME = {
@@ -41,7 +41,7 @@ const COLOR_THEME = {
4141
fuchsia: "!bg-fuchsia-500",
4242
pink: "!bg-pink-500",
4343
rose: "!bg-rose-500",
44-
};
44+
} as const;
4545

4646
const defaults: (keyof typeof COLOR_THEME)[] = [
4747
"purple",
@@ -51,11 +51,7 @@ const defaults: (keyof typeof COLOR_THEME)[] = [
5151
"gray",
5252
];
5353

54-
export default function ThemeBuilderWrapper({
55-
children,
56-
}: {
57-
children: ReactNode;
58-
}) {
54+
export default function ThemeBuilderWrapper({ children }: PropsWithChildren) {
5955
const [color, changeColor] = useState<keyof typeof COLOR_THEME>("purple");
6056

6157
return (
@@ -65,9 +61,9 @@ export default function ThemeBuilderWrapper({
6561
<div className="flex flex-col justify-start lg:flex-row lg:justify-between">
6662
<div>
6763
<h1 className="text-3xl font-bold md:text-3xl">Make it yours.</h1>
68-
<h4 className="text-secondary-400 text-sm lg:text-lg">
64+
<h2 className="text-secondary-400 text-sm lg:text-lg">
6965
Hand-picked themes that you can copy and paste into your apps.
70-
</h4>
66+
</h2>
7167
</div>
7268
<div className="flex items-center gap-1.5 py-2 md:gap-3">
7369
{defaults.map((c) => (
@@ -78,6 +74,7 @@ export default function ThemeBuilderWrapper({
7874
size="fab"
7975
className={`${COLOR_THEME[c]} min-h-[26px] min-w-[26px] !p-1`}
8076
onClick={() => changeColor(c as keyof typeof COLOR_THEME)}
77+
name={`${c} button`}
8178
>
8279
{color == c && (
8380
<CheckIcon

apps/docs/app/themes/layout.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { ReactNode } from "react";
2-
import ThemeBuilderWrapper from "./ThemeWrapper";
31
import { Metadata } from "next";
2+
import { PropsWithChildren } from "react";
3+
import ThemeBuilderWrapper from "./ThemeWrapper";
44

55
export const metadata: Metadata = {
66
title: "Theme Generator",
@@ -15,10 +15,6 @@ export const metadata: Metadata = {
1515
},
1616
};
1717

18-
export default function ThemeBuilderLayout({
19-
children,
20-
}: {
21-
children: ReactNode;
22-
}) {
18+
export default function ThemeBuilderLayout({ children }: PropsWithChildren) {
2319
return <ThemeBuilderWrapper>{children}</ThemeBuilderWrapper>;
2420
}

0 commit comments

Comments
 (0)