diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 2969275..ac83e51 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -48,7 +48,7 @@ export default async function RootLayout({ -
+
{children} diff --git a/src/app/settings/page.tsx b/src/app/settings/page.tsx index d64387f..f6c4451 100644 --- a/src/app/settings/page.tsx +++ b/src/app/settings/page.tsx @@ -3,57 +3,51 @@ import { Button } from "@/components/ui/button"; import { Label } from "@/components/ui/label"; import { SidebarTrigger } from "@/components/ui/sidebar"; import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"; -import { InfoIcon } from "lucide-react"; +import { ChartPieIcon, InfoIcon } from "lucide-react"; import { ReactNode, useEffect, useState } from "react"; import { usePersistenceContext } from "../persistence-provider"; import StaticSidebarTrigger from "@/components/static-sidebar-trigger"; import ScrollFadingTitle from "@/components/scroll-fading-title"; - -function PersistentStorageControl({ - status -}: { - status: string | null -}): ReactNode { - const { persist } = usePersistenceContext(); - if (status == null) return ; - if (status == "never") return ; - if (status == "prompt") return ; - return ; -}; +import SidebarTriggerAdjustable from "@/components/sidebar-trigger-adjustable"; +import Search from "@/components/search"; +import { useIsMobile } from "@/hooks/use-mobile"; +import { cn } from "@/lib/utils"; +import AscendingCard from "@/components/ascending-card"; +import Link from "next/link"; export default function Settings(): ReactNode { - const [status, setStatus] = useState(null); + const isMobile = useIsMobile(); - useEffect(() => { - setStatus(localStorage.getItem("persistence-status")); - }, []); + const SearchContainer = isMobile ? "div" : SidebarTriggerAdjustable; + const cardWidth = isMobile ? "w-full" : "w-2xl"; return ( -
-
- - -

Settings

-
-
-
-

Storage

-
-
-
- - - - - - - Persistent storage prevents browser from deleting your local data to free up space for other websites. - - -
- -
+
+
+
+ + +

Settings

+
+
+ + + +
+
+
+ + +
+ +
+
+

Storage

+

Memory usage, media, cache etc.

+
+
+
); diff --git a/src/app/settings/storage/page.tsx b/src/app/settings/storage/page.tsx new file mode 100644 index 0000000..f2bbff0 --- /dev/null +++ b/src/app/settings/storage/page.tsx @@ -0,0 +1,67 @@ +"use client"; +import { usePersistenceContext } from "@/app/persistence-provider"; +import ScrollFadingTitle from "@/components/scroll-fading-title"; +import Search from "@/components/search"; +import SidebarTriggerAdjustable from "@/components/sidebar-trigger-adjustable"; +import StaticSidebarTrigger from "@/components/static-sidebar-trigger"; +import { Button } from "@/components/ui/button"; +import { Label } from "@/components/ui/label"; +import { useIsMobile } from "@/hooks/use-mobile"; +import { cn } from "@/lib/utils"; +import { ArrowLeftIcon } from "lucide-react"; +import { useRouter } from "next/navigation"; +import { ReactNode, useEffect, useState } from "react"; + +function PersistentStorageControl({ + status +}: { + status: string | null +}): ReactNode { + const { persist } = usePersistenceContext(); + if (status == null) return ; + if (status == "never") return ; + if (status == "prompt") return ; + return ; +}; + +export default function Storage() { + const [status, setStatus] = useState(null); + const router = useRouter(); + const isMobile = useIsMobile(); + + useEffect(() => { + setStatus(localStorage.getItem("persistence-status")); + }, []); + + const SearchContainer = isMobile ? "div" : SidebarTriggerAdjustable; + const cardWidth = isMobile ? "w-full" : "w-2xl"; + + return ( +
+
+
+ + + + +
+

Storage

+ +
+
+ + + +
+
+
+
+ +
+ +
+
+ ) +} \ No newline at end of file diff --git a/src/components/ascending-card/AscendingCard.tsx b/src/components/ascending-card/AscendingCard.tsx new file mode 100644 index 0000000..f536ead --- /dev/null +++ b/src/components/ascending-card/AscendingCard.tsx @@ -0,0 +1,7 @@ +import { ComponentProps } from "react"; +import { Card } from "../ui/card"; +import { cn } from "@/lib/utils"; + +export const AscendingCard = (props: ComponentProps) => ( + +); \ No newline at end of file diff --git a/src/components/ascending-card/index.ts b/src/components/ascending-card/index.ts new file mode 100644 index 0000000..342f272 --- /dev/null +++ b/src/components/ascending-card/index.ts @@ -0,0 +1,3 @@ +import { AscendingCard } from "./AscendingCard"; + +export default AscendingCard; \ No newline at end of file diff --git a/src/components/static-sidebar-trigger/StaticSidebarTrigger.tsx b/src/components/static-sidebar-trigger/StaticSidebarTrigger.tsx index caff4b3..6babc2a 100644 --- a/src/components/static-sidebar-trigger/StaticSidebarTrigger.tsx +++ b/src/components/static-sidebar-trigger/StaticSidebarTrigger.tsx @@ -1,12 +1,18 @@ "use client"; +import { ReactNode } from "react"; import { SidebarTrigger } from "../ui/sidebar"; -export const StaticSidebarTrigger = () => { +export const StaticSidebarTrigger = ({ + children +}: { + children?: ReactNode +}) => { return ( <>
+ {children}
);