Fix save button states
This commit is contained in:
parent
0bbd0278a1
commit
191f4447d5
3 changed files with 34 additions and 41 deletions
|
|
@ -43,7 +43,7 @@
|
||||||
stroke: #ff4d4d;
|
stroke: #ff4d4d;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.Active.Save {
|
&.Save {
|
||||||
color: #ff4d4d;
|
color: #ff4d4d;
|
||||||
|
|
||||||
.Accessory svg {
|
.Accessory svg {
|
||||||
|
|
@ -99,24 +99,27 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.save:hover {
|
&.Save {
|
||||||
color: #ff4d4d;
|
|
||||||
|
|
||||||
.Accessory svg {
|
.Accessory svg {
|
||||||
fill: #ff4d4d;
|
fill: none;
|
||||||
stroke: #ff4d4d;
|
stroke: var(--button-text);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
&.save.Active {
|
&.Saved {
|
||||||
color: #ff4d4d;
|
color: #ff4d4d;
|
||||||
|
|
||||||
|
.Accessory svg {
|
||||||
|
fill: #ff4d4d;
|
||||||
|
stroke: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: darken(#ff4d4d, 30);
|
color: #ff4d4d;
|
||||||
|
|
||||||
.icon svg {
|
.Accessory svg {
|
||||||
fill: darken(#ff4d4d, 30);
|
fill: none;
|
||||||
stroke: darken(#ff4d4d, 30);
|
stroke: #ff4d4d;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,16 +41,12 @@ const Button = React.forwardRef<HTMLButtonElement, Props>(function button(
|
||||||
},
|
},
|
||||||
forwardedRef
|
forwardedRef
|
||||||
) {
|
) {
|
||||||
const classes = classNames(
|
const classes = classNames(buttonSize, props.className, {
|
||||||
{
|
Button: true,
|
||||||
Button: true,
|
Active: active,
|
||||||
Active: active,
|
Blended: blended,
|
||||||
Blended: blended,
|
Contained: contained,
|
||||||
Contained: contained,
|
})
|
||||||
},
|
|
||||||
buttonSize,
|
|
||||||
props.className
|
|
||||||
)
|
|
||||||
|
|
||||||
const leftAccessoryClasses = classNames(leftAccessoryClassName, {
|
const leftAccessoryClasses = classNames(leftAccessoryClassName, {
|
||||||
Accessory: true,
|
Accessory: true,
|
||||||
|
|
|
||||||
|
|
@ -179,24 +179,18 @@ const Header = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const saveButton = () => {
|
const saveButton = () => {
|
||||||
if (party.favorited)
|
return (
|
||||||
return (
|
<Button
|
||||||
<Button
|
leftAccessoryIcon={<SaveIcon />}
|
||||||
leftAccessoryIcon={<SaveIcon />}
|
className={classNames({
|
||||||
blended={true}
|
Save: true,
|
||||||
text="Saved"
|
Saved: party.favorited,
|
||||||
onClick={toggleFavorite}
|
})}
|
||||||
/>
|
blended={true}
|
||||||
)
|
text={party.favorited ? 'Saved' : 'Save'}
|
||||||
else
|
onClick={toggleFavorite}
|
||||||
return (
|
/>
|
||||||
<Button
|
)
|
||||||
leftAccessoryIcon={<SaveIcon />}
|
|
||||||
blended={true}
|
|
||||||
text="Save"
|
|
||||||
onClick={toggleFavorite}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const image = () => {
|
const image = () => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue