({ children, onClick, active, className, style }: ButtonProps)
| 10 | } |
| 11 | |
| 12 | export function Button({ children, onClick, active, className, style }: ButtonProps) { |
| 13 | return ( |
| 14 | <button |
| 15 | style={style} |
| 16 | onMouseDown={evt => { |
| 17 | evt.preventDefault() |
| 18 | evt.stopPropagation() |
| 19 | }} |
| 20 | onClick={onClick} |
| 21 | css={[ |
| 22 | tw`text-base leading-tight font-bold border rounded-lg py-2 px-4 focus:ring-1 focus:ring-offset-2 focus:ring-link active:bg-link active:border-link active:text-white active:ring-0 active:ring-offset-0 outline-none inline-flex items-center my-1`, |
| 23 | active && tw`bg-link border-link text-white hover:bg-link focus:bg-link active:bg-link`, |
| 24 | !active && |
| 25 | tw`bg-transparent text-secondary dark:text-secondary-dark bg-secondary-button dark:bg-secondary-button-dark hover:text-link focus:text-link border-transparent`, |
| 26 | ]} |
| 27 | className={className} |
| 28 | > |
| 29 | {children} |
| 30 | </button> |
| 31 | ) |
| 32 | } |
| 33 | |
| 34 | Button.defaultProps = { |
| 35 | active: false, |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…