mirror of
https://github.com/remvze/moodist.git
synced 2025-12-17 08:54:13 +00:00
fix: remove history on select
This commit is contained in:
parent
8966d59d75
commit
5bd1dd3016
3 changed files with 9 additions and 3 deletions
|
|
@ -25,8 +25,10 @@
|
||||||
line-height: 0;
|
line-height: 0;
|
||||||
outline: none;
|
outline: none;
|
||||||
|
|
||||||
&:disabled {
|
&:disabled,
|
||||||
|
&.disabled {
|
||||||
cursor: default;
|
cursor: default;
|
||||||
|
opacity: 0.8;
|
||||||
}
|
}
|
||||||
|
|
||||||
& span {
|
& span {
|
||||||
|
|
@ -53,8 +55,10 @@
|
||||||
outline: none;
|
outline: none;
|
||||||
transition: 0.2s;
|
transition: 0.2s;
|
||||||
|
|
||||||
&:disabled {
|
&:disabled,
|
||||||
|
&.disabled {
|
||||||
cursor: default;
|
cursor: default;
|
||||||
|
opacity: 0.8;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.restore {
|
&.restore {
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ export function Buttons() {
|
||||||
return (
|
return (
|
||||||
<div className={styles.buttons}>
|
<div className={styles.buttons}>
|
||||||
<button
|
<button
|
||||||
className={styles.playButton}
|
className={cn(styles.playButton, noSelected && styles.disabled)}
|
||||||
disabled={noSelected}
|
disabled={noSelected}
|
||||||
onClick={handleClick}
|
onClick={handleClick}
|
||||||
>
|
>
|
||||||
|
|
@ -56,6 +56,7 @@ export function Buttons() {
|
||||||
className={cn(
|
className={cn(
|
||||||
styles.smallButton,
|
styles.smallButton,
|
||||||
hasHistory ? styles.restore : styles.delete,
|
hasHistory ? styles.restore : styles.delete,
|
||||||
|
noSelected && !hasHistory && styles.disabled,
|
||||||
)}
|
)}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (hasHistory) restoreHistory();
|
if (hasHistory) restoreHistory();
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ export const createActions: StateCreator<
|
||||||
|
|
||||||
select(id) {
|
select(id) {
|
||||||
set({
|
set({
|
||||||
|
history: null,
|
||||||
sounds: {
|
sounds: {
|
||||||
...get().sounds,
|
...get().sounds,
|
||||||
[id]: { ...get().sounds[id], isSelected: true },
|
[id]: { ...get().sounds[id], isSelected: true },
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue