URL filter functionality.

This commit is contained in:
Mike Cao 2020-09-25 22:31:18 -07:00
parent 6bc371352c
commit 4fded49b03
27 changed files with 251 additions and 117 deletions

View file

@ -13,7 +13,8 @@ export default function Button({
className,
tooltip,
tooltipId,
disabled = false,
disabled,
iconRight,
onClick = () => {},
...props
}) {
@ -30,14 +31,14 @@ export default function Button({
[styles.action]: variant === 'action',
[styles.danger]: variant === 'danger',
[styles.light]: variant === 'light',
[styles.disabled]: disabled,
[styles.iconRight]: iconRight,
})}
disabled={disabled}
onClick={!disabled ? onClick : null}
{...props}
>
{icon && <Icon icon={icon} size={size} />}
{children}
{icon && <Icon className={styles.icon} icon={icon} size={size} />}
{children && <div>{children}</div>}
{tooltip && <ReactTooltip id={tooltipId}>{tooltip}</ReactTooltip>}
</button>
);

View file

@ -38,7 +38,8 @@
font-size: var(--font-size-xsmall);
}
.action {
.action,
.action:active {
color: var(--gray50);
background: var(--gray900);
}
@ -64,6 +65,19 @@
background: inherit;
}
.button .icon + div {
margin-left: 10px;
}
.button.iconRight .icon {
order: 1;
margin-left: 10px;
}
.button.iconRight .icon + div {
margin: 0;
}
.button:disabled {
cursor: default;
color: var(--gray500);

View file

@ -5,10 +5,6 @@
vertical-align: middle;
}
.icon + * {
margin-left: 10px;
}
.icon svg {
fill: currentColor;
}