Hide search / clear actions on web

This commit is contained in:
jeffvli 2023-06-09 16:30:31 -07:00 committed by Jeff
parent 72811dbedb
commit 7f6efbe6dc

View file

@ -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,9 +30,11 @@ export const LyricsActions = ({ onRemoveLyric, onSearchOverride }: LyricsActions
}; };
const isActionsDisabled = !currentSong; const isActionsDisabled = !currentSong;
const isDesktop = isElectron();
return ( return (
<> <>
{isDesktop ? (
<Button <Button
uppercase uppercase
disabled={isActionsDisabled} disabled={isActionsDisabled}
@ -46,6 +49,7 @@ export const LyricsActions = ({ onRemoveLyric, onSearchOverride }: LyricsActions
> >
Search Search
</Button> </Button>
) : null}
<Button <Button
aria-label="Decrease lyric offset" aria-label="Decrease lyric offset"
variant="subtle" variant="subtle"
@ -67,6 +71,7 @@ export const LyricsActions = ({ onRemoveLyric, onSearchOverride }: LyricsActions
> >
<RiAddFill /> <RiAddFill />
</Button> </Button>
{isDesktop ? (
<Button <Button
uppercase uppercase
disabled={isActionsDisabled} disabled={isActionsDisabled}
@ -75,6 +80,7 @@ export const LyricsActions = ({ onRemoveLyric, onSearchOverride }: LyricsActions
> >
Clear Clear
</Button> </Button>
) : null}
</> </>
); );
}; };