UI Changes

This commit is contained in:
Belen Curcio
2020-10-20 10:31:40 -03:00
parent e2dd854f10
commit 8de36f7301
5 changed files with 11902 additions and 47 deletions

View File

@@ -15,7 +15,7 @@ interface Props {
const Swatch: FC<Props & ButtonProps> = ({
className,
color,
color = '',
label,
variant = 'size',
active,
@@ -23,13 +23,14 @@ const Swatch: FC<Props & ButtonProps> = ({
}) => {
variant = variant?.toLowerCase()
label = label?.toLowerCase()
const isDarkBg = isDark(color)
const rootClassName = cn(
s.root,
{
[s.active]: active,
[s.size]: variant === 'size',
[s.color]: color,
[s.dark]: color ? isDark(color) : false,
},
className
)
@@ -41,11 +42,7 @@ const Swatch: FC<Props & ButtonProps> = ({
{...props}
>
{variant === 'color' && active && (
<span
className={cn('absolute', {
'text-white': isDarkBg,
})}
>
<span>
<Check />
</span>
)}