diff --git a/suite-native/atoms/src/Button/TextButton.tsx b/suite-native/atoms/src/Button/TextButton.tsx index b5c51136ae..cc3c350e6b 100644 --- a/suite-native/atoms/src/Button/TextButton.tsx +++ b/suite-native/atoms/src/Button/TextButton.tsx @@ -13,7 +13,8 @@ import { HStack } from '../Stack'; import { pressTimingConfig } from '../constants'; import { ButtonAccessoryView, ButtonProps, ButtonSize, buttonToTextSizeMap } from './Button'; -export type TextButtonVariant = 'primary' | 'tertiary' | 'blue'; +export const TEXT_BUTTON_VARIANTS = ['primary', 'tertiary', 'blue'] as const; +export type TextButtonVariant = (typeof TEXT_BUTTON_VARIANTS)[number]; export type TextButtonProps = Omit & { isUnderlined?: boolean; diff --git a/suite-native/atoms/src/stories/Buttons/TextButton.stories.tsx b/suite-native/atoms/src/stories/Buttons/TextButton.stories.tsx index 44b7247d54..e0590d66c6 100644 --- a/suite-native/atoms/src/stories/Buttons/TextButton.stories.tsx +++ b/suite-native/atoms/src/stories/Buttons/TextButton.stories.tsx @@ -2,14 +2,20 @@ import type { Meta, StoryObj } from '@storybook/react-native'; import { ICON_NAMES } from '@suite-native/icons'; -import { BUTTON_COLOR_SCHEMES, BUTTON_SIZES } from '../../Button/Button'; -import { TextButton as TextButtonComponent, TextButtonProps } from '../../Button/TextButton'; +import { BUTTON_SIZES } from '../../Button/Button'; +import { + TEXT_BUTTON_VARIANTS, + TextButton as TextButtonComponent, + TextButtonProps, +} from '../../Button/TextButton'; type TextButtonStory = StoryObj; const meta: Meta = { title: 'Atoms/Buttons', component: TextButtonComponent, + // Reanimated useSharedValue is used under the hood, so we need to mount the component again when `variant` is changed. + render: args => , // }; export default meta; @@ -22,7 +28,7 @@ export const TextButton: TextButtonStory = { }, variant: { control: { type: 'select' }, - options: BUTTON_COLOR_SCHEMES, + options: TEXT_BUTTON_VARIANTS, }, size: { control: { type: 'select' },