/
pellya
/
blogReactera
Обзор
Документация
Войти
/
pellya
/
blogReactera
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/shared/ui/Code/Code.stories.tsx
65 строк
2 KB
rpellya@gmail.com
Add prettier
02 фев 2025, 22:40
02 фев 2025, 22:40
5f9ec21
Код
Авторство
О чём код?
import { ComponentStory, ComponentMeta } from '@storybook/react'; import { ThemeDecorator } from 'shared/config/storybook/ThemeDecorator/ThemeDecorator'; import { Theme } from 'app/providers/ThemeProvider'; import { Code } from './Code'; export default { title: 'shared/Code', component: Code, argTypes: { backgroundColor: { control: 'color' } }, args: { to: '/', }, } as ComponentMeta<typeof Code>; const Template: ComponentStory<typeof Code> = (args) => <Code {...args} />; export const Primary = Template.bind({}); Primary.args = { text: 'export default {\n' + " title: 'shared/Code',\n" + ' component: Code,\n' + ' argTypes: {\n' + " backgroundColor: { control: 'color' },\n" + ' },\n' + '} as ComponentMeta<typeof Code>;\n' + '\n' + 'const Template: ComponentStory<typeof Code> = (args) => <Code {...args} />;\n' + '\n' + 'export const Normal = Template.bind({});', }; export const Dark = Template.bind({}); Dark.args = { text: 'export default {\n' + " title: 'shared/Code',\n" + ' component: Code,\n' + ' argTypes: {\n' + " backgroundColor: { control: 'color' },\n" + ' },\n' + '} as ComponentMeta<typeof Code>;\n' + '\n' + 'const Template: ComponentStory<typeof Code> = (args) => <Code {...args} />;\n' + '\n' + 'export const Normal = Template.bind({});', }; Dark.decorators = [ThemeDecorator(Theme.DARK)]; export const Blue = Template.bind({}); Blue.args = { text: 'export default {\n' + " title: 'shared/Code',\n" + ' component: Code,\n' + ' argTypes: {\n' + " backgroundColor: { control: 'color' },\n" + ' },\n' + '} as ComponentMeta<typeof Code>;\n' + '\n' + 'const Template: ComponentStory<typeof Code> = (args) => <Code {...args} />;\n' + '\n' + 'export const Normal = Template.bind({});', }; Blue.decorators = [ThemeDecorator(Theme.BLUE)];