diff --git a/src/app/settings/page.tsx b/src/app/settings/page.tsx index f6c4451..0c43dfa 100644 --- a/src/app/settings/page.tsx +++ b/src/app/settings/page.tsx @@ -18,23 +18,20 @@ import Link from "next/link"; export default function Settings(): ReactNode { const isMobile = useIsMobile(); - const SearchContainer = isMobile ? "div" : SidebarTriggerAdjustable; const cardWidth = isMobile ? "w-full" : "w-2xl"; return (
-
-
- - -

Settings

-
-
-
- - - -
+
+ + +

Settings

+
+
+
+ + +
diff --git a/src/app/settings/storage/page.tsx b/src/app/settings/storage/page.tsx index f2bbff0..f410919 100644 --- a/src/app/settings/storage/page.tsx +++ b/src/app/settings/storage/page.tsx @@ -33,28 +33,25 @@ export default function Storage() { setStatus(localStorage.getItem("persistence-status")); }, []); - const SearchContainer = isMobile ? "div" : SidebarTriggerAdjustable; const cardWidth = isMobile ? "w-full" : "w-2xl"; return ( -
-
-
- - - - -
-

Storage

- -
-
- - - -
+
+
+ + + + +
+

Storage

+ +
+
+ + +
diff --git a/src/components/sidebar-trigger-adjustable/SidebarTriggerAdjustable.tsx b/src/components/sidebar-trigger-adjustable/SidebarTriggerAdjustable.tsx index 1c53662..64d8168 100644 --- a/src/components/sidebar-trigger-adjustable/SidebarTriggerAdjustable.tsx +++ b/src/components/sidebar-trigger-adjustable/SidebarTriggerAdjustable.tsx @@ -16,7 +16,10 @@ const cssLerp = (a: string, b: string, t: string) => ( ); -export const SidebarTriggerAdjustable = (props: ComponentProps<"div">) => { +export const SidebarTriggerAdjustable = (props: ComponentProps<"div"> & { + adjustWidth?: number | `${number}`; +}) => { + const adjustWidth = props.adjustWidth ? +props.adjustWidth : 12; const isMobile = useIsMobile(); useEffect(() => { @@ -31,9 +34,9 @@ export const SidebarTriggerAdjustable = (props: ComponentProps<"div">) => { const slideAmount = easeSlide( Math.max(0, Math.min(1, window.scrollY / (window.innerHeight / 20))) ); - triggerDiv.style.transform = `translateX(calc(var(--spacing) * ${12 * slideAmount}))`; + triggerDiv.style.transform = `translateX(calc(var(--spacing) * ${adjustWidth * slideAmount}))`; triggerDiv.style.paddingTop = `calc(var(--spacing) * ${(isMobile ? 1 : 3) * slideAmount})`; - triggerDiv.style.width = `calc(100% - var(--spacing) * ${lerp(0, 12, 1 - slideAmount)})`; + triggerDiv.style.width = `calc(100% - var(--spacing) * ${lerp(0, adjustWidth, 1 - slideAmount)})`; }; handleScroll(); @@ -44,5 +47,5 @@ export const SidebarTriggerAdjustable = (props: ComponentProps<"div">) => { }; }, [isMobile]); - return
; + return
{props.children}
; } \ No newline at end of file