diff --git a/src/renderer/layouts/default-layout.tsx b/src/renderer/layouts/default-layout.tsx index ab4cc11fd..0f6f4701d 100644 --- a/src/renderer/layouts/default-layout.tsx +++ b/src/renderer/layouts/default-layout.tsx @@ -1,8 +1,9 @@ import { useCallback, useEffect, useRef, useState } from 'react'; import styled from '@emotion/styled'; import { Menu, Button } from '@mantine/core'; +import { motion } from 'framer-motion'; import { Outlet } from 'react-router'; -import { SideQueue } from '@/renderer/features/side-queue/components/SideQueue'; +import { SideQueue } from '@/renderer/features/side-queue/components/side-queue'; import { Titlebar } from '@/renderer/features/titlebar/components/titlebar'; import { useAppStore } from '@/renderer/store'; import { @@ -51,7 +52,7 @@ const SidebarContainer = styled.div` background: var(--sidebar-bg); `; -const RightSidebarContainer = styled.div` +const RightSidebarContainer = styled(motion.div)` position: relative; grid-area: right-sidebar; background: var(--sidebar-bg); @@ -162,18 +163,25 @@ export const DefaultLayout = () => { /> - - { - e.preventDefault(); - startResizing('right'); - }} - /> - {sidebar.rightExpanded && } - + {sidebar.rightExpanded && ( + + { + e.preventDefault(); + startResizing('right'); + }} + /> + + + )} diff --git a/src/renderer/utils/constrain-sidebar-width.ts b/src/renderer/utils/constrain-sidebar-width.ts index c64282510..4d8cea340 100644 --- a/src/renderer/utils/constrain-sidebar-width.ts +++ b/src/renderer/utils/constrain-sidebar-width.ts @@ -9,3 +9,15 @@ export const constrainSidebarWidth = (num: number) => { return num; }; + +export const constrainRightSidebarWidth = (num: number) => { + if (num < 250) { + return 250; + } + + if (num > 960) { + return 960; + } + + return num; +};