mirror of
https://github.com/trezor/trezor-suite.git
synced 2026-02-20 00:33:07 +01:00
fix(suite-native): text button story variant prop
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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' },
|
||||
|
||||
Reference in New Issue
Block a user