diff --git a/apps/web/src/components/Main.tsx b/apps/web/src/components/Main.tsx index 79225eb5..bdd1394e 100644 --- a/apps/web/src/components/Main.tsx +++ b/apps/web/src/components/Main.tsx @@ -14,6 +14,7 @@ import { useMemory } from "@/contexts/MemoryContext"; import Image from "next/image"; import { getMemoriesFromUrl } from "@/actions/db"; +import { ProfileDrawer } from "./ProfileDrawer"; function supportsDVH() { try { @@ -25,7 +26,6 @@ function supportsDVH() { export default function Main({ sidebarOpen }: { sidebarOpen: boolean }) { const searchParams = useSearchParams(); - const router = useRouter(); const [hide, setHide] = useState(false); const [layout, setLayout] = useState<"chat" | "initial">("initial"); @@ -307,12 +307,17 @@ export default function Main({ sidebarOpen }: { sidebarOpen: boolean }) { )} > Smort logo +
+ {width <= 768 && } +

Ask your second brain

@@ -446,6 +451,8 @@ export function Chat({ const lines = countLines(e.target); e.target.rows = Math.min(5, lines); } + + const { width } = useViewport(); return (
+ +
+ {width <= 768 && } +
{chatHistory.map((msg, i) => ( diff --git a/apps/web/src/components/ProfileDrawer.tsx b/apps/web/src/components/ProfileDrawer.tsx new file mode 100644 index 00000000..6a617d2a --- /dev/null +++ b/apps/web/src/components/ProfileDrawer.tsx @@ -0,0 +1,37 @@ + +import { useRef, useState } from "react"; +import { Drawer, DrawerContent, DrawerOverlay, DrawerTrigger } from "./ui/drawer"; +import { cn } from "@/lib/utils"; +import { ProfileTab } from "./Sidebar"; +import { useSession } from "next-auth/react"; + +export interface Props extends React.ButtonHTMLAttributes { + hide?: boolean; +} + +export function ProfileDrawer({ className, hide = false, ...props }: Props) { + + const { data: session } = useSession(); + + return ( + + + + + +
+ +
+
+
+ ); +} diff --git a/apps/web/src/components/Sidebar/index.tsx b/apps/web/src/components/Sidebar/index.tsx index f1a25a85..481c0792 100644 --- a/apps/web/src/components/Sidebar/index.tsx +++ b/apps/web/src/components/Sidebar/index.tsx @@ -208,10 +208,10 @@ export function ProfileTab({ open }: { open: boolean }) { }, [open]) return ( -
-
+
+

Profile

-
+
{handle && ( -
+
)} {children}