mars-v2-frontend/components/Button.tsx
Gustavo Mauricio f709c12da2
Tooling improvements and minor refactor (#19)
* refactor: store selector callbacks less verbose

* chore: prettier tailwind plugin added and respective formatting

* disable metamask connection button
2022-09-30 13:50:16 +01:00

27 lines
588 B
TypeScript

import React from 'react'
type Props = {
children: string
className?: string
onClick: () => void
disabled?: boolean
}
const Button = React.forwardRef<any, Props>(
({ children, className = '', onClick, disabled }, ref) => (
<button
ref={ref}
onClick={onClick}
className={`overflow-hidden text-ellipsis rounded-3xl bg-green-500 py-2 px-5 text-sm font-semibold text-white ${className} ${
disabled ? 'opacity-40' : ''
}`}
disabled={disabled}
>
{children}
</button>
)
)
Button.displayName = 'Button'
export default Button