Skip to content

Commit bd9df94

Browse files
committed
fix build errors, reduce diff
1 parent a75b3a8 commit bd9df94

File tree

4 files changed

+75
-109
lines changed

4 files changed

+75
-109
lines changed

apps/dashboard/.storybook/main.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,13 @@ function getAbsolutePath(value: string): string {
99
return dirname(require.resolve(join(value, "package.json")));
1010
}
1111
const config: StorybookConfig = {
12+
stories: ["../src/**/*.stories.tsx"],
1213
addons: [
1314
getAbsolutePath("@storybook/addon-onboarding"),
1415
getAbsolutePath("@storybook/addon-links"),
1516
getAbsolutePath("@chromatic-com/storybook"),
1617
getAbsolutePath("@storybook/addon-docs"),
1718
],
18-
features: {
19-
experimentalRSC: true,
20-
},
2119
framework: {
2220
name: getAbsolutePath("@storybook/nextjs"),
2321
options: {},
@@ -28,6 +26,8 @@ const config: StorybookConfig = {
2826
},
2927
},
3028
staticDirs: ["../public"],
31-
stories: ["../src/**/*.stories.tsx"],
29+
features: {
30+
experimentalRSC: true,
31+
},
3232
};
33-
export default config;
33+
export default config;

apps/dashboard/.storybook/preview.tsx

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ import type { Preview } from "@storybook/nextjs";
22
import "../src/global.css";
33
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
44
import { MoonIcon, SunIcon } from "lucide-react";
5-
import { Inter as interFont } from "next/font/google";
65
import { ThemeProvider, useTheme } from "next-themes";
6+
import { Inter as interFont } from "next/font/google";
77
// biome-ignore lint/style/useImportType: <explanation>
8-
import React, { useEffect } from "react";
8+
import React from "react";
9+
import { useEffect } from "react";
910
import { Toaster } from "sonner";
1011
import { Button } from "../src/@/components/ui/button";
1112

@@ -17,33 +18,45 @@ const fontSans = interFont({
1718
});
1819

1920
const customViewports = {
20-
sm: {
21-
// Larger phones (iphone 15 plus / 15 pro max)
22-
name: "iPhone Plus",
23-
styles: {
24-
height: "932px",
25-
width: "430px",
26-
},
27-
},
2821
xs: {
2922
// Regular sized phones (iphone 15 / 15 pro)
3023
name: "iPhone",
3124
styles: {
32-
height: "844px",
3325
width: "390px",
26+
height: "844px",
27+
},
28+
},
29+
sm: {
30+
// Larger phones (iphone 15 plus / 15 pro max)
31+
name: "iPhone Plus",
32+
styles: {
33+
width: "430px",
34+
height: "932px",
3435
},
3536
},
3637
};
3738

3839
const preview: Preview = {
40+
parameters: {
41+
viewport: {
42+
viewports: customViewports,
43+
},
44+
controls: {
45+
matchers: {
46+
color: /(background|color)$/i,
47+
date: /Date$/i,
48+
},
49+
},
50+
},
51+
3952
decorators: [
4053
(Story) => {
4154
return (
4255
<ThemeProvider
4356
attribute="class"
44-
defaultTheme="dark"
4557
disableTransitionOnChange
4658
enableSystem={false}
59+
defaultTheme="dark"
4760
>
4861
<StoryLayout>
4962
<Story />
@@ -52,22 +65,13 @@ const preview: Preview = {
5265
);
5366
},
5467
],
55-
parameters: {
56-
controls: {
57-
matchers: {
58-
color: /(background|color)$/i,
59-
date: /Date$/i,
60-
},
61-
},
62-
viewport: {
63-
viewports: customViewports,
64-
},
65-
},
6668
};
6769

6870
export default preview;
6971

70-
function StoryLayout(props: { children: React.ReactNode }) {
72+
function StoryLayout(props: {
73+
children: React.ReactNode;
74+
}) {
7175
const { setTheme, theme } = useTheme();
7276

7377
useEffect(() => {
@@ -79,10 +83,10 @@ function StoryLayout(props: { children: React.ReactNode }) {
7983
<div className="flex min-h-dvh min-w-0 flex-col bg-background text-foreground">
8084
<div className="fixed right-0 bottom-0 z-50 flex justify-end gap-2 p-4">
8185
<Button
82-
className="h-auto w-auto shrink-0 rounded-full p-2"
8386
onClick={() => setTheme(theme === "dark" ? "light" : "dark")}
8487
size="sm"
8588
variant="outline"
89+
className="h-auto w-auto shrink-0 rounded-full p-2"
8690
>
8791
{theme === "dark" ? (
8892
<MoonIcon className="size-4" />
@@ -102,4 +106,4 @@ function StoryLayout(props: { children: React.ReactNode }) {
102106
function ToasterSetup() {
103107
const { theme } = useTheme();
104108
return <Toaster richColors theme={theme === "light" ? "light" : "dark"} />;
105-
}
109+
}

apps/dashboard/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"papaparse": "^5.5.3",
5656
"pluralize": "^8.0.0",
5757
"posthog-js": "1.256.1",
58+
"posthog-node": "^5.4.0",
5859
"prettier": "3.6.2",
5960
"qrcode": "^1.5.3",
6061
"react": "19.1.0",

0 commit comments

Comments
 (0)