mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-06 20:10:12 +02:00
Hide search / clear actions on web
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import isElectron from 'is-electron';
|
||||||
import { RiAddFill, RiSubtractFill } from 'react-icons/ri';
|
import { RiAddFill, RiSubtractFill } from 'react-icons/ri';
|
||||||
import { LyricsOverride } from '/@/renderer/api/types';
|
import { LyricsOverride } from '/@/renderer/api/types';
|
||||||
import { Button, NumberInput } from '/@/renderer/components';
|
import { Button, NumberInput } from '/@/renderer/components';
|
||||||
@@ -29,23 +30,26 @@ export const LyricsActions = ({ onRemoveLyric, onSearchOverride }: LyricsActions
|
|||||||
};
|
};
|
||||||
|
|
||||||
const isActionsDisabled = !currentSong;
|
const isActionsDisabled = !currentSong;
|
||||||
|
const isDesktop = isElectron();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Button
|
{isDesktop ? (
|
||||||
uppercase
|
<Button
|
||||||
disabled={isActionsDisabled}
|
uppercase
|
||||||
variant="subtle"
|
disabled={isActionsDisabled}
|
||||||
onClick={() =>
|
variant="subtle"
|
||||||
openLyricSearchModal({
|
onClick={() =>
|
||||||
artist: currentSong?.artistName,
|
openLyricSearchModal({
|
||||||
name: currentSong?.name,
|
artist: currentSong?.artistName,
|
||||||
onSearchOverride,
|
name: currentSong?.name,
|
||||||
})
|
onSearchOverride,
|
||||||
}
|
})
|
||||||
>
|
}
|
||||||
Search
|
>
|
||||||
</Button>
|
Search
|
||||||
|
</Button>
|
||||||
|
) : null}
|
||||||
<Button
|
<Button
|
||||||
aria-label="Decrease lyric offset"
|
aria-label="Decrease lyric offset"
|
||||||
variant="subtle"
|
variant="subtle"
|
||||||
@@ -67,14 +71,16 @@ export const LyricsActions = ({ onRemoveLyric, onSearchOverride }: LyricsActions
|
|||||||
>
|
>
|
||||||
<RiAddFill />
|
<RiAddFill />
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
{isDesktop ? (
|
||||||
uppercase
|
<Button
|
||||||
disabled={isActionsDisabled}
|
uppercase
|
||||||
variant="subtle"
|
disabled={isActionsDisabled}
|
||||||
onClick={onRemoveLyric}
|
variant="subtle"
|
||||||
>
|
onClick={onRemoveLyric}
|
||||||
Clear
|
>
|
||||||
</Button>
|
Clear
|
||||||
|
</Button>
|
||||||
|
) : null}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user