Fix styles for favorite buttons in GridRep
This commit is contained in:
parent
d8d864a5fe
commit
1b13f8d51e
6 changed files with 60 additions and 15 deletions
|
|
@ -29,11 +29,46 @@
|
||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.Contained {
|
||||||
|
background: var(--button-contained-bg);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: var(--button-contained-bg-hover);
|
||||||
|
}
|
||||||
|
|
||||||
|
&.Save:hover .Accessory svg {
|
||||||
|
fill: #ff4d4d;
|
||||||
|
stroke: #ff4d4d;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.Active.Save {
|
||||||
|
color: #ff4d4d;
|
||||||
|
|
||||||
|
.Accessory svg {
|
||||||
|
fill: #ff4d4d;
|
||||||
|
stroke: #ff4d4d;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: darken(#ff4d4d, 30);
|
||||||
|
|
||||||
|
.Accessory svg {
|
||||||
|
fill: darken(#ff4d4d, 30);
|
||||||
|
stroke: darken(#ff4d4d, 30);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&.medium {
|
&.medium {
|
||||||
height: $unit * 5.5;
|
height: $unit * 5.5;
|
||||||
padding: ($unit * 1.5) $unit-2x;
|
padding: ($unit * 1.5) $unit-2x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.small {
|
||||||
|
padding: $unit * 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
&.destructive:hover {
|
&.destructive:hover {
|
||||||
background: $error;
|
background: $error;
|
||||||
color: $grey-100;
|
color: $grey-100;
|
||||||
|
|
@ -55,11 +90,6 @@
|
||||||
&.save.Active {
|
&.save.Active {
|
||||||
color: #ff4d4d;
|
color: #ff4d4d;
|
||||||
|
|
||||||
.Accessory svg {
|
|
||||||
fill: #ff4d4d;
|
|
||||||
stroke: #ff4d4d;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: darken(#ff4d4d, 30);
|
color: darken(#ff4d4d, 30);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,23 +23,31 @@ interface Props
|
||||||
HTMLButtonElement
|
HTMLButtonElement
|
||||||
> {
|
> {
|
||||||
accessoryIcon?: React.ReactNode
|
accessoryIcon?: React.ReactNode
|
||||||
|
active?: boolean
|
||||||
blended?: boolean
|
blended?: boolean
|
||||||
|
contained?: boolean
|
||||||
size?: 'small' | 'medium' | 'large'
|
size?: 'small' | 'medium' | 'large'
|
||||||
text?: string
|
text?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
|
active: false,
|
||||||
blended: false,
|
blended: false,
|
||||||
|
contained: false,
|
||||||
size: 'medium',
|
size: 'medium',
|
||||||
}
|
}
|
||||||
|
|
||||||
const Button = React.forwardRef<HTMLButtonElement, Props>(
|
const Button = React.forwardRef<HTMLButtonElement, Props>(
|
||||||
({ accessoryIcon, blended, size, text, ...props }, forwardedRef) => {
|
(
|
||||||
|
{ accessoryIcon, active, blended, contained, size, text, ...props },
|
||||||
|
forwardedRef
|
||||||
|
) => {
|
||||||
const classes = classNames(
|
const classes = classNames(
|
||||||
{
|
{
|
||||||
Button: true,
|
Button: true,
|
||||||
|
Active: active,
|
||||||
Blended: blended,
|
Blended: blended,
|
||||||
// Active: active,
|
Contained: contained,
|
||||||
// 'btn-pressed': pressed,
|
// 'btn-pressed': pressed,
|
||||||
// 'btn-disabled': disabled,
|
// 'btn-disabled': disabled,
|
||||||
// save: props.icon === 'save',
|
// save: props.icon === 'save',
|
||||||
|
|
|
||||||
|
|
@ -94,11 +94,6 @@
|
||||||
width: 14px;
|
width: 14px;
|
||||||
height: 14px;
|
height: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
button:hover,
|
|
||||||
button.Active {
|
|
||||||
background: $grey-90;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.bottom {
|
.bottom {
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,8 @@ import { accountState } from '~utils/accountState'
|
||||||
import { formatTimeAgo } from '~utils/timeAgo'
|
import { formatTimeAgo } from '~utils/timeAgo'
|
||||||
|
|
||||||
import Button from '~components/Button'
|
import Button from '~components/Button'
|
||||||
import { ButtonType } from '~utils/enums'
|
|
||||||
|
import SaveIcon from '~public/icons/Save.svg'
|
||||||
|
|
||||||
import './index.scss'
|
import './index.scss'
|
||||||
|
|
||||||
|
|
@ -162,9 +163,11 @@ const GridRep = (props: Props) => {
|
||||||
((props.user && account.user && account.user.id !== props.user.id) ||
|
((props.user && account.user && account.user.id !== props.user.id) ||
|
||||||
!props.user) ? (
|
!props.user) ? (
|
||||||
<Button
|
<Button
|
||||||
|
className="Save"
|
||||||
|
accessoryIcon={<SaveIcon class="stroke" />}
|
||||||
active={props.favorited}
|
active={props.favorited}
|
||||||
icon="save"
|
contained={true}
|
||||||
type={ButtonType.IconOnly}
|
size="small"
|
||||||
onClick={sendSaveData}
|
onClick={sendSaveData}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@
|
||||||
--button-bg: #{$button--bg--light};
|
--button-bg: #{$button--bg--light};
|
||||||
--button-bg-hover: #{$button--bg--light--hover};
|
--button-bg-hover: #{$button--bg--light--hover};
|
||||||
--button-bg-disabled: #{$button--bg--light--disabled};
|
--button-bg-disabled: #{$button--bg--light--disabled};
|
||||||
|
--button-contained-bg: #{$button--contained--bg--light};
|
||||||
|
--button-contained-bg-hover: #{$button--contained--bg--light--hover};
|
||||||
|
|
||||||
--button-text: #{$button--text--light};
|
--button-text: #{$button--text--light};
|
||||||
--button-text-hover: #{$button--text--light--hover};
|
--button-text-hover: #{$button--text--light--hover};
|
||||||
|
|
@ -102,6 +104,8 @@
|
||||||
--button-bg: #{$button--bg--dark};
|
--button-bg: #{$button--bg--dark};
|
||||||
--button-bg-hover: #{$button--bg--dark--hover};
|
--button-bg-hover: #{$button--bg--dark--hover};
|
||||||
--button-bg-disabled: #{$button--bg--dark--disabled};
|
--button-bg-disabled: #{$button--bg--dark--disabled};
|
||||||
|
--button-contained-bg: #{$button--contained--bg--dark};
|
||||||
|
--button-contained-bg-hover: #{$button--contained--bg--dark--hover};
|
||||||
|
|
||||||
--button-text: #{$button--text--dark};
|
--button-text: #{$button--text--dark};
|
||||||
--button-text-hover: #{$button--text--dark--hover};
|
--button-text-hover: #{$button--text--dark--hover};
|
||||||
|
|
|
||||||
|
|
@ -129,9 +129,14 @@ $menu--text--dark--hover: $grey-15;
|
||||||
$button--bg--light: $grey-80;
|
$button--bg--light: $grey-80;
|
||||||
$button--bg--light--hover: $grey-100;
|
$button--bg--light--hover: $grey-100;
|
||||||
$button--bg--light--disabled: $grey-50;
|
$button--bg--light--disabled: $grey-50;
|
||||||
|
$button--contained--bg--light: $grey-90;
|
||||||
|
$button--contained--bg--light--hover: $grey-80;
|
||||||
|
|
||||||
$button--bg--dark: $grey-00;
|
$button--bg--dark: $grey-00;
|
||||||
$button--bg--dark--hover: $grey-05;
|
$button--bg--dark--hover: $grey-05;
|
||||||
$button--bg--dark--disabled: $grey-30;
|
$button--bg--dark--disabled: $grey-30;
|
||||||
|
$button--contained--bg--dark: $grey-15;
|
||||||
|
$button--contained--bg--dark--hover: $grey-05;
|
||||||
|
|
||||||
$button--text--light: $grey-55;
|
$button--text--light: $grey-55;
|
||||||
$button--text--light--hover: $grey-40;
|
$button--text--light--hover: $grey-40;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue