Skip to content

Commit

Permalink
fix: get rid of enums and use normal strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Federico Zivolo committed Dec 6, 2018
1 parent 2350a80 commit cb6e7b3
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions packages/react-forms/src/Button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,24 @@ import { Link } from 'react-router-dom';
import Color from 'color';
import { withFallback as wf, textStyles } from '@quid/theme';

const IMPORTANCE_SECONDARY: 'secondary' = 'secondary';
const IMPORTANCE_PRIMARY: 'primary' = 'primary';
const IMPORTANCE_OKAY: 'okay' = 'okay';
const IMPORTANCE_WARNING: 'warning' = 'warning';
const IMPORTANCE_HAZARD: 'hazard' = 'hazard';
const SIZE_REGULAR: 'regular' = 'regular';
const SIZE_SMALL: 'small' = 'small';

const OKAY = '#039849';
const WARNING = '#FFCE03';
const HAZARD = '#E61E27';

type Props = {
importance?:
| typeof IMPORTANCE_PRIMARY
| typeof IMPORTANCE_SECONDARY
| typeof IMPORTANCE_OKAY
| typeof IMPORTANCE_WARNING
| typeof IMPORTANCE_HAZARD,
/** The "color" of the button */
importance?: 'primary' | 'secondary' | 'okay' | 'warning' | 'hazard',
/** Make the button background transparent */
transparent?: boolean,
size?: typeof SIZE_REGULAR | typeof SIZE_SMALL,
/** Button height */
size?: 'regular' | 'small',
/** What to render inside the button */
children?: Node,
/** Normal `href` URL, if present, the button will render as anchor (`<a />`) */
href?: string,
/** react-router URL, if present, the button will render as `Link` */
to?: string | Object,
/** when `true`, the button can't be clicked */
disabled?: boolean,
};

Expand Down

0 comments on commit cb6e7b3

Please sign in to comment.