mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-10 04:30:25 +02:00
Add Lyrics button to right-controls. (#1363)
* Add Microphone icon to right-controls to show/hide lyrics.
This commit is contained in:
@@ -562,6 +562,7 @@
|
|||||||
"addNextShuffled": "add next (shuffled)",
|
"addNextShuffled": "add next (shuffled)",
|
||||||
"holdToShuffle": "hold to shuffle",
|
"holdToShuffle": "hold to shuffle",
|
||||||
"favorite": "favorite",
|
"favorite": "favorite",
|
||||||
|
"lyrics": "lyrics",
|
||||||
"mute": "mute",
|
"mute": "mute",
|
||||||
"muted": "muted",
|
"muted": "muted",
|
||||||
"next": "next",
|
"next": "next",
|
||||||
|
|||||||
@@ -13,16 +13,19 @@ import {
|
|||||||
useAppStoreActions,
|
useAppStoreActions,
|
||||||
useAutoDJSettings,
|
useAutoDJSettings,
|
||||||
useCurrentServer,
|
useCurrentServer,
|
||||||
|
useFullScreenPlayerStore,
|
||||||
useGeneralSettings,
|
useGeneralSettings,
|
||||||
useHotkeySettings,
|
useHotkeySettings,
|
||||||
usePlayerData,
|
usePlayerData,
|
||||||
usePlayerMuted,
|
usePlayerMuted,
|
||||||
usePlayerSong,
|
usePlayerSong,
|
||||||
usePlayerVolume,
|
usePlayerVolume,
|
||||||
|
useSetFullScreenPlayerStore,
|
||||||
useSettingsStore,
|
useSettingsStore,
|
||||||
useSettingsStoreActions,
|
useSettingsStoreActions,
|
||||||
useSidebarRightExpanded,
|
useSidebarRightExpanded,
|
||||||
} from '/@/renderer/store';
|
} from '/@/renderer/store';
|
||||||
|
import { useFullScreenPlayerStoreActions } from '/@/renderer/store/full-screen-player.store';
|
||||||
import { ActionIcon } from '/@/shared/components/action-icon/action-icon';
|
import { ActionIcon } from '/@/shared/components/action-icon/action-icon';
|
||||||
import { Button } from '/@/shared/components/button/button';
|
import { Button } from '/@/shared/components/button/button';
|
||||||
import { Flex } from '/@/shared/components/flex/flex';
|
import { Flex } from '/@/shared/components/flex/flex';
|
||||||
@@ -66,6 +69,7 @@ export const RightControls = () => {
|
|||||||
</Group>
|
</Group>
|
||||||
<Group align="center" gap="xs" wrap="nowrap">
|
<Group align="center" gap="xs" wrap="nowrap">
|
||||||
<PlayerConfig />
|
<PlayerConfig />
|
||||||
|
<LyricsButton />
|
||||||
<FavoriteButton />
|
<FavoriteButton />
|
||||||
<QueueButton />
|
<QueueButton />
|
||||||
<VolumeButton />
|
<VolumeButton />
|
||||||
@@ -147,6 +151,40 @@ const QueueButton = () => {
|
|||||||
return <PopoverPlayQueue />;
|
return <PopoverPlayQueue />;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const LyricsButton = () => {
|
||||||
|
const setFullScreenPlayerStore = useSetFullScreenPlayerStore();
|
||||||
|
const activeTab = useFullScreenPlayerStore((state) => state.activeTab);
|
||||||
|
|
||||||
|
const { setStore } = useFullScreenPlayerStoreActions();
|
||||||
|
const { expanded: isFullScreenPlayerExpanded } = useFullScreenPlayerStore();
|
||||||
|
|
||||||
|
const expandFullScreenPlayer = () => {
|
||||||
|
setFullScreenPlayerStore({ expanded: !isFullScreenPlayerExpanded });
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ActionIcon
|
||||||
|
icon="microphone"
|
||||||
|
iconProps={{
|
||||||
|
color: activeTab === 'lyrics' && isFullScreenPlayerExpanded ? 'primary' : undefined,
|
||||||
|
size: 'lg',
|
||||||
|
}}
|
||||||
|
onClick={(e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
if (!isFullScreenPlayerExpanded) setStore({ activeTab: 'lyrics' });
|
||||||
|
expandFullScreenPlayer();
|
||||||
|
}}
|
||||||
|
role="button"
|
||||||
|
size="sm"
|
||||||
|
tooltip={{
|
||||||
|
label: t('player.lyrics', { postProcess: 'titleCase' }),
|
||||||
|
openDelay: 0,
|
||||||
|
}}
|
||||||
|
variant="subtle"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const FavoriteButton = () => {
|
const FavoriteButton = () => {
|
||||||
const currentSong = usePlayerSong();
|
const currentSong = usePlayerSong();
|
||||||
const { bindings } = useHotkeySettings();
|
const { bindings } = useHotkeySettings();
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ import {
|
|||||||
LuLogIn,
|
LuLogIn,
|
||||||
LuLogOut,
|
LuLogOut,
|
||||||
LuMenu,
|
LuMenu,
|
||||||
|
LuMicVocal,
|
||||||
LuMinus,
|
LuMinus,
|
||||||
LuMoon,
|
LuMoon,
|
||||||
LuMusic,
|
LuMusic,
|
||||||
@@ -194,6 +195,7 @@ export const AppIcon = {
|
|||||||
mediaStop: LuSquare,
|
mediaStop: LuSquare,
|
||||||
menu: LuMenu,
|
menu: LuMenu,
|
||||||
metadata: LuBookOpen,
|
metadata: LuBookOpen,
|
||||||
|
microphone: LuMicVocal,
|
||||||
minus: LuMinus,
|
minus: LuMinus,
|
||||||
panelRightClose: LuPanelRightClose,
|
panelRightClose: LuPanelRightClose,
|
||||||
panelRightOpen: LuPanelRightOpen,
|
panelRightOpen: LuPanelRightOpen,
|
||||||
|
|||||||
Reference in New Issue
Block a user