remove right sidebar animation

This commit is contained in:
jeffvli
2025-11-22 21:35:26 -08:00
parent 6a003c9035
commit 0aee428aaf
@@ -11,24 +11,6 @@ import { AppRoute } from '/@/renderer/router/routes';
import { useGeneralSettings, useSidebarStore, useWindowSettings } from '/@/renderer/store'; import { useGeneralSettings, useSidebarStore, useWindowSettings } from '/@/renderer/store';
import { Platform } from '/@/shared/types/types'; import { Platform } from '/@/shared/types/types';
const queueSidebarVariants: Variants = {
closed: (rightWidth) => ({
transition: { duration: 0.5 },
width: rightWidth,
x: 1000,
zIndex: 120,
}),
open: (rightWidth) => ({
transition: {
duration: 0.5,
ease: 'anticipate',
},
width: rightWidth,
x: 0,
zIndex: 120,
}),
};
const queueDrawerVariants: Variants = { const queueDrawerVariants: Variants = {
closed: (windowBarStyle) => ({ closed: (windowBarStyle) => ({
height: height:
@@ -78,25 +60,20 @@ export const RightSidebar = forwardRef(
ref: Ref<HTMLDivElement>, ref: Ref<HTMLDivElement>,
) => { ) => {
const { windowBarStyle } = useWindowSettings(); const { windowBarStyle } = useWindowSettings();
const { rightExpanded, rightWidth } = useSidebarStore(); const { rightExpanded } = useSidebarStore();
const { sideQueueType } = useGeneralSettings(); const { sideQueueType } = useGeneralSettings();
const location = useLocation(); const location = useLocation();
const showSideQueue = rightExpanded && location.pathname !== AppRoute.NOW_PLAYING; const showSideQueue = rightExpanded && location.pathname !== AppRoute.NOW_PLAYING;
return ( return (
<AnimatePresence initial={false} key="queue-sidebar" mode="sync" presenceAffectsLayout> <>
{showSideQueue && ( {showSideQueue && (
<> <>
{sideQueueType === 'sideQueue' ? ( {sideQueueType === 'sideQueue' ? (
<motion.aside <aside
animate="open"
className={styles.rightSidebarContainer} className={styles.rightSidebarContainer}
custom={rightWidth}
exit="closed"
id="sidebar-queue" id="sidebar-queue"
initial="closed"
key="queue-sidebar" key="queue-sidebar"
variants={queueSidebarVariants}
> >
<ResizeHandle <ResizeHandle
isResizing={isResizingRight} isResizing={isResizingRight}
@@ -108,24 +85,26 @@ export const RightSidebar = forwardRef(
ref={ref} ref={ref}
/> />
<SidebarPlayQueue /> <SidebarPlayQueue />
</motion.aside> </aside>
) : ( ) : (
<motion.div <AnimatePresence initial={false} key="queue-drawer" mode="sync">
animate="open" <motion.div
className={styles.queueDrawer} animate="open"
custom={windowBarStyle} className={styles.queueDrawer}
exit="closed" custom={windowBarStyle}
id="drawer-queue" exit="closed"
initial="closed" id="drawer-queue"
key="queue-drawer" initial="closed"
variants={queueDrawerVariants} key="queue-drawer"
> variants={queueDrawerVariants}
<DrawerPlayQueue /> >
</motion.div> <DrawerPlayQueue />
</motion.div>
</AnimatePresence>
)} )}
</> </>
)} )}
</AnimatePresence> </>
); );
}, },
); );