Skip to content
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.

Commit

Permalink
docs: SB改善 season 2
Browse files Browse the repository at this point in the history
  • Loading branch information
sor4chi committed Nov 16, 2023
1 parent e224f87 commit d6cabba
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 23 deletions.
1 change: 1 addition & 0 deletions client/.storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const preview: Preview = {
date: /Date$/i,
},
},
layout: "fullscreen",
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,22 @@ const meta = {

export default meta;

export const Overview = () => (
const Common = () => (
<LoadingOverlayContext.Provider
value={{ isLoading: true, setIsLoading: () => {} }}
>
<LoadingOverlay />
</LoadingOverlayContext.Provider>
);

export const Light = () => (
<Theme.Light>
<LoadingOverlayContext.Provider
value={{ isLoading: true, setIsLoading: () => {} }}
>
<LoadingOverlay />
</LoadingOverlayContext.Provider>
<Common />
</Theme.Light>
);

export const Dark = () => (
<Theme.Dark>
<Common />
</Theme.Dark>
);
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@ import { Theme } from "@/styles/__stories__/Theme";

const meta = {
title: "Pages/Onboarding",
parameters: {
layout: "fullscreen",
},
} satisfies Meta;

export default meta;

export const Overview = () => (
<Theme.Light>
export const Light = () => (
<Theme.Light full>
<OnboardingPage />
</Theme.Light>
);

export const Dark = () => (
<Theme.Dark full>
<OnboardingPage />
</Theme.Dark>
);
30 changes: 21 additions & 9 deletions client/src/styles/__stories__/Theme.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,31 @@
import "../global.css";
import { vars } from "../theme.css";
import { vars } from "..";

const styles = {
background: vars.color.gray[1],
const styles = (full: boolean) => ({
background: vars.color.gray[2],
color: vars.color.gray[12],
};
padding: full ? "0" : "16px",
});

const LightWrapper = ({ children }: { children: React.ReactNode }) => (
<div className="light" style={styles}>
const LightWrapper = ({
children,
full = false,
}: {
children: React.ReactNode;
full?: boolean;
}) => (
<div className="light" style={styles(full)}>
{children}
</div>
);

const DarkWrapper = ({ children }: { children: React.ReactNode }) => (
<div className="dark" style={styles}>
const DarkWrapper = ({
children,
full = false,
}: {
children: React.ReactNode;
full?: boolean;
}) => (
<div className="dark" style={styles(full)}>
{children}
</div>
);
Expand Down
3 changes: 0 additions & 3 deletions client/src/styles/__stories__/color-tokens.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import { Theme } from "./Theme";

const meta = {
title: "Styles/Color Tokens",
parameters: {
layout: "fullscreen",
},
} satisfies Meta;

export default meta;
Expand Down

0 comments on commit d6cabba

Please sign in to comment.