Adding Modal Component and Login View

This commit is contained in:
Belen Curcio
2020-10-19 15:22:48 -03:00
parent a3e021ec79
commit 26535b7c7f
11 changed files with 122 additions and 12 deletions

View File

@@ -13,7 +13,7 @@ import { LoadingDots } from '@components/ui'
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
href?: string
className?: string
variant?: 'filled' | 'outlined' | 'flat' | 'none'
variant?: 'flat' | 'slim'
active?: boolean
type?: 'submit' | 'reset' | 'button'
Component?: string | JSXElementConstructor<any>
@@ -24,7 +24,7 @@ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
const Button: React.FC<ButtonProps> = forwardRef((props, buttonRef) => {
const {
className,
variant = 'filled',
variant = 'flat',
children,
active,
onClick,
@@ -50,6 +50,7 @@ const Button: React.FC<ButtonProps> = forwardRef((props, buttonRef) => {
const rootClassName = cn(
s.root,
{
[s.slim]: variant === 'slim',
[s.loading]: loading,
},
className
@@ -57,16 +58,16 @@ const Button: React.FC<ButtonProps> = forwardRef((props, buttonRef) => {
return (
<Component
className={rootClassName}
aria-pressed={active}
data-variant={variant}
ref={mergeRefs([ref, buttonRef])}
{...buttonProps}
data-active={isPressed ? '' : undefined}
className={rootClassName}
style={{
width,
...style,
}}
data-active={isPressed ? '' : undefined}
>
{children}
{loading && (