[Glitch] Improve Redux Storybook

Port 8c2845906c1f8f60708dad452b056bc7696c1224 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Echo 2025-12-16 12:27:18 +01:00 committed by Claire
parent 3cd033df0c
commit 177479fe37

View File

@ -4,20 +4,22 @@ import type { Meta, StoryObj } from '@storybook/react-vite';
import { Emoji } from './index'; import { Emoji } from './index';
type EmojiProps = ComponentProps<typeof Emoji> & { state: string }; type EmojiProps = ComponentProps<typeof Emoji> & {
style: 'auto' | 'native' | 'twemoji';
};
const meta = { const meta = {
title: 'Components/Emoji', title: 'Components/Emoji',
component: Emoji, component: Emoji,
args: { args: {
code: '🖤', code: '🖤',
state: 'auto', style: 'auto',
}, },
argTypes: { argTypes: {
code: { code: {
name: 'Emoji', name: 'Emoji',
}, },
state: { style: {
control: { control: {
type: 'select', type: 'select',
labels: { labels: {
@ -28,11 +30,7 @@ const meta = {
}, },
options: ['auto', 'native', 'twemoji'], options: ['auto', 'native', 'twemoji'],
name: 'Emoji Style', name: 'Emoji Style',
mapping: { reduxPath: 'meta.emoji_style',
auto: { meta: { emoji_style: 'auto' } },
native: { meta: { emoji_style: 'native' } },
twemoji: { meta: { emoji_style: 'twemoji' } },
},
}, },
}, },
render(args) { render(args) {