diff --git a/src/renderer/features/now-playing/components/popover-play-queue.tsx b/src/renderer/features/now-playing/components/popover-play-queue.tsx new file mode 100644 index 000000000..65e2c9dc6 --- /dev/null +++ b/src/renderer/features/now-playing/components/popover-play-queue.tsx @@ -0,0 +1,60 @@ +import { t } from 'i18next'; +import { useRef, useState } from 'react'; + +import { ItemListHandle } from '/@/renderer/components/item-list/types'; +import { PlayQueue } from '/@/renderer/features/now-playing/components/play-queue'; +import { PlayQueueListControls } from '/@/renderer/features/now-playing/components/play-queue-list-controls'; +import { ActionIcon } from '/@/shared/components/action-icon/action-icon'; +import { Popover } from '/@/shared/components/popover/popover'; +import { Stack } from '/@/shared/components/stack/stack'; +import { useDisclosure } from '/@/shared/hooks/use-disclosure'; +import { ItemListKey } from '/@/shared/types/types'; + +export const PopoverPlayQueue = () => { + const queueRef = useRef(null); + const [search, setSearch] = useState(undefined); + + const [opened, handlers] = useDisclosure(false); + + return ( + handlers.close()} + opened={opened} + position="top" + withArrow + > + + handlers.toggle()} + size="sm" + tooltip={{ + label: t('player.viewQueue', { postProcess: 'titleCase' }), + openDelay: 0, + }} + variant="subtle" + /> + + + + + + + + + ); +}; diff --git a/src/renderer/features/player/components/right-controls.tsx b/src/renderer/features/player/components/right-controls.tsx index f2e838661..6f48aa2b0 100644 --- a/src/renderer/features/player/components/right-controls.tsx +++ b/src/renderer/features/player/components/right-controls.tsx @@ -2,6 +2,7 @@ import { t } from 'i18next'; import { useCallback, WheelEvent } from 'react'; import { useTranslation } from 'react-i18next'; +import { PopoverPlayQueue } from '/@/renderer/features/now-playing/components/popover-play-queue'; import { PlayerConfig } from '/@/renderer/features/player/components/player-config'; import { CustomPlayerbarSlider } from '/@/renderer/features/player/components/playerbar-slider'; import { usePlayer } from '/@/renderer/features/player/context/player-context'; @@ -73,6 +74,7 @@ const QueueButton = () => { const { t } = useTranslation(); const isSidebarRightExpanded = useSidebarRightExpanded(); const { setSideBar } = useAppStoreActions(); + const { sideQueueType } = useGeneralSettings(); const { bindings } = useHotkeySettings(); @@ -84,24 +86,33 @@ const QueueButton = () => { [bindings.toggleQueue.isGlobal ? '' : bindings.toggleQueue.hotkey, handleToggleQueue], ]); - return ( - { - e.stopPropagation(); - handleToggleQueue(); - }} - size="sm" - tooltip={{ - label: t('player.viewQueue', { postProcess: 'titleCase' }), - openDelay: 0, - }} - variant="subtle" - /> - ); + const handleClick = (e: React.MouseEvent) => { + e.stopPropagation(); + + if (sideQueueType === 'sideQueue') { + return handleToggleQueue(); + } + }; + + if (sideQueueType === 'sideQueue') { + return ( + + ); + } + + return ; }; const FavoriteButton = () => {