mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-09 20:29:36 +02:00
remove right sidebar animation
This commit is contained in:
@@ -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,8 +85,9 @@ export const RightSidebar = forwardRef(
|
|||||||
ref={ref}
|
ref={ref}
|
||||||
/>
|
/>
|
||||||
<SidebarPlayQueue />
|
<SidebarPlayQueue />
|
||||||
</motion.aside>
|
</aside>
|
||||||
) : (
|
) : (
|
||||||
|
<AnimatePresence initial={false} key="queue-drawer" mode="sync">
|
||||||
<motion.div
|
<motion.div
|
||||||
animate="open"
|
animate="open"
|
||||||
className={styles.queueDrawer}
|
className={styles.queueDrawer}
|
||||||
@@ -122,10 +100,11 @@ export const RightSidebar = forwardRef(
|
|||||||
>
|
>
|
||||||
<DrawerPlayQueue />
|
<DrawerPlayQueue />
|
||||||
</motion.div>
|
</motion.div>
|
||||||
|
</AnimatePresence>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</AnimatePresence>
|
</>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user