This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react' | |
| import classNames from 'classnames' | |
| // We have extracted each variation into a sepreate lazy loaded component | |
| const Primary = React.lazy(() => import('./PrimaryButton')) | |
| const Error = React.lazy(() => import('./ErrorButton')) | |
| const Success = React.lazy(() => import('./SuccessButton')) | |
| const Info = React.lazy(() => import('./InfoButton')) | |
| export default function Button({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react' | |
| import classNames from 'classnames' | |
| // We keep a map of all variations of each customizable attribute of our button | |
| const backgroundColors = { | |
| default: 'gray-200', | |
| primary: 'blue-500', | |
| error: 'red-500', | |
| success: 'green-500', | |
| info: 'teal-500' |