UNPKG

@hc.ds/mobile

Version:
31 lines (28 loc) 752 B
/** * Button utils * * These utils are used to determine the text style and button type based on the theme prop that matches with AntDesign Button component. */ import { Colors } from '../Colors'; import type { ButtonProps } from './type'; export function getTextStyle(theme: ButtonProps['theme']) { switch (theme) { case 'ghost': return { color: Colors.primary[100] }; case 'light': return { color: Colors.text }; default: return { color: Colors.white }; } } export function getButtonType(theme: ButtonProps['theme']) { switch (theme) { case 'success': case 'danger': return 'primary'; case 'light': return 'ghost'; default: return theme; } }