-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1051581
commit 9a16cea
Showing
41 changed files
with
544 additions
and
437 deletions.
There are no files selected for viewing
43 changes: 0 additions & 43 deletions
43
apps/storybook/src/stories/notion/settings-panel/index.stories.tsx
This file was deleted.
Oops, something went wrong.
File renamed without changes.
61 changes: 61 additions & 0 deletions
61
apps/storybook/src/stories/notion/settings-panel/settings-panel.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { useEffect } from "react"; | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
import { fn } from "@storybook/test"; | ||
|
||
import { SettingsPanel2, useSettingsStore2 } from "@swy/notion"; | ||
import { | ||
mockConnections, | ||
mockSettings, | ||
mockUploadFile, | ||
} from "@swy/notion/mock"; | ||
import { ModalProvider } from "@swy/ui/shared"; | ||
|
||
import { ModalTrigger } from "./settings"; | ||
|
||
const meta = { | ||
title: "notion/Settings Panel", | ||
component: SettingsPanel2, | ||
parameters: { layout: "centered" }, | ||
tags: ["!autodocs"], | ||
args: { | ||
updateSettings: fn(), | ||
uploadFile: mockUploadFile, | ||
people: {}, | ||
connections: { | ||
load: () => Promise.resolve(mockConnections), | ||
}, | ||
}, | ||
} satisfies Meta<typeof SettingsPanel2>; | ||
export default meta; | ||
|
||
type Story = StoryObj<typeof meta>; | ||
|
||
const RenderWithZustand: Story["render"] = (props) => { | ||
const { settings, update } = useSettingsStore2(); | ||
|
||
useEffect(() => { | ||
update(props.settings); | ||
}, [props.settings, update]); | ||
|
||
return ( | ||
<div className="flex h-[calc(100vh-100px)] max-h-[720px] w-[calc(100vw-100px)] max-w-[1150px] rounded border-solid p-0 shadow"> | ||
<SettingsPanel2 {...props} settings={settings} updateSettings={update} /> | ||
</div> | ||
); | ||
}; | ||
|
||
export const Default: Story = { | ||
args: { | ||
settings: mockSettings, | ||
}, | ||
render: RenderWithZustand, | ||
}; | ||
|
||
export const Modal: Story = { | ||
args: { settings: mockSettings }, | ||
render: ({ settings }) => ( | ||
<ModalProvider> | ||
<ModalTrigger initialData={settings} /> | ||
</ModalProvider> | ||
), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 0 additions & 87 deletions
87
apps/storybook/src/stories/notion/workspace-provider/_components/base-layout.tsx
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
apps/storybook/src/stories/notion/workspace-provider/_components/index.ts
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
apps/storybook/src/stories/notion/workspace-provider/_components/use-pages.ts
This file was deleted.
Oops, something went wrong.
48 changes: 0 additions & 48 deletions
48
apps/storybook/src/stories/notion/workspace-provider/index.stories.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.