-
Notifications
You must be signed in to change notification settings - Fork 21
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
Showing
19 changed files
with
3,070 additions
and
7,359 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,20 @@ | ||
import type { StorybookConfig } from "@storybook/react-webpack5"; | ||
|
||
const config: StorybookConfig = { | ||
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(ts|tsx)"], | ||
|
||
addons: [ | ||
"@storybook/addon-links", | ||
"@storybook/addon-essentials", | ||
"@storybook/addon-interactions", | ||
"@storybook/addon-a11y", | ||
"@storybook/addon-webpack5-compiler-swc" | ||
], | ||
|
||
framework: { | ||
name: "@storybook/react-webpack5", | ||
options: {} | ||
} | ||
}; | ||
|
||
export default config; |
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 |
---|---|---|
@@ -1,12 +1,3 @@ | ||
import { addDecorator } from "@storybook/react" | ||
import { themeDecorator } from "../src/theme" | ||
import { themeDecorator } from "../src/theme"; | ||
|
||
export const parameters = { | ||
options: { | ||
storySort: { | ||
order: ['Welcome'], | ||
}, | ||
}, | ||
} | ||
|
||
addDecorator(themeDecorator); | ||
export const decorators = [themeDecorator]; |
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
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
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
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
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import { ComponentStory, ComponentMeta } from "@storybook/react"; | ||
import { Meta } from "@storybook/react"; | ||
import React from "react"; | ||
import { ChannelsEdit } from "../components"; | ||
|
||
const channelsList = ["conda-store", "default", "conda forge"]; | ||
|
||
export default { | ||
component: ChannelsEdit | ||
} as ComponentMeta<typeof ChannelsEdit>; | ||
} as Meta<typeof ChannelsEdit>; | ||
|
||
export const Primary: ComponentStory<typeof ChannelsEdit> = () => ( | ||
export const Primary = () => ( | ||
<ChannelsEdit channelsList={channelsList} updateChannels={() => ({})} /> | ||
); |
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 |
---|---|---|
@@ -1,13 +1,11 @@ | ||
import { ComponentStory, ComponentMeta } from "@storybook/react"; | ||
import { Meta } from "@storybook/react"; | ||
import React from "react"; | ||
import { ChannelsList } from "../components"; | ||
|
||
const channelsList = ["conda-store", "default", "conda forge"]; | ||
|
||
export default { | ||
component: ChannelsList | ||
} as ComponentMeta<typeof ChannelsList>; | ||
} as Meta<typeof ChannelsList>; | ||
|
||
export const Primary: ComponentStory<typeof ChannelsList> = () => ( | ||
<ChannelsList channelList={channelsList} /> | ||
); | ||
export const Primary = () => <ChannelsList channelList={channelsList} />; |
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
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
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
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 |
---|---|---|
@@ -1,27 +1,44 @@ | ||
import type { Story, ComponentMeta } from "@storybook/react"; | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
import { useArgs } from "@storybook/preview-api"; | ||
|
||
import { Provider } from "react-redux"; | ||
import React from "react"; | ||
|
||
import { store } from "../../../store"; | ||
import { EnvBuilds } from "../components"; | ||
import { mockBuilds } from "../mocks"; | ||
import { EnvBuilds, IEnvBuildsProps } from "../components/EnvBuilds"; | ||
import { mockBuilds } from "../mocks/mockBuilds"; | ||
|
||
export default { | ||
component: EnvBuilds | ||
} as ComponentMeta<typeof EnvBuilds>; | ||
component: EnvBuilds, | ||
decorators: [ | ||
Story => ( | ||
<Provider store={store}> | ||
<Story /> | ||
</Provider> | ||
) | ||
] | ||
} as Meta<typeof EnvBuilds>; | ||
|
||
export const Primary = { | ||
type Story = StoryObj<typeof EnvBuilds>; | ||
|
||
export const Primary: Story = { | ||
args: { | ||
currentBuildId: 1, | ||
selectedBuildId: 1, | ||
mode: "read-only", | ||
builds: mockBuilds | ||
}, | ||
decorators: [ | ||
(Story: Story) => ( | ||
<Provider store={store}> | ||
<Story /> | ||
</Provider> | ||
) | ||
] | ||
render: function Render(args: IEnvBuildsProps) { | ||
const [{ selectedBuildId = args.selectedBuildId }, updateArgs] = useArgs(); | ||
|
||
const handleChangeToSelectedBuildId = () => { | ||
const { id: nextSelectedBuildId = args.selectedBuildId } = | ||
store.getState().enviroments.currentBuild; | ||
updateArgs({ selectedBuildId: nextSelectedBuildId }); | ||
}; | ||
|
||
store.subscribe(handleChangeToSelectedBuildId); | ||
|
||
return <EnvBuilds {...args} selectedBuildId={selectedBuildId} />; | ||
} | ||
}; |
Oops, something went wrong.