fix(suite-native): text button story variant prop

This commit is contained in:
Petr Knetl
2026-02-17 09:54:26 +01:00
committed by Petr Knetl
parent e1c6d4c1a6
commit 4dcb452e91
2 changed files with 11 additions and 4 deletions

View File

@@ -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<ButtonProps, 'colorScheme'> & {
isUnderlined?: boolean;

View File

@@ -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<TextButtonProps>;
const meta: Meta<TextButtonProps> = {
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 => <TextButtonComponent {...args} key={args.variant} />, //
};
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' },