From 5fe0caabf8e650aa221ef0faccf4520b0e1cbee2 Mon Sep 17 00:00:00 2001 From: Dhravya Date: Sun, 2 Jun 2024 12:12:38 -0500 Subject: [PATCH] improvements in dash + chatUI --- apps/web/app/{home => (dash)/chat}/actions.ts | 0 apps/web/app/{ => (dash)}/chat/chatWindow.tsx | 0 apps/web/app/(dash)/chat/page.tsx | 14 ++++++++ apps/web/app/{home => (dash)}/header.tsx | 0 apps/web/app/(dash)/home/page.tsx | 27 +++++++++++++++ apps/web/app/{ => (dash)}/home/queryinput.tsx | 3 +- apps/web/app/(dash)/layout.tsx | 17 ++++++++++ apps/web/app/{home => (dash)}/menu.tsx | 1 - apps/web/app/(landing)/package.json | 5 +++ apps/web/app/chat/page.tsx | 24 -------------- apps/web/app/home/page.tsx | 33 ------------------- 11 files changed, 64 insertions(+), 60 deletions(-) rename apps/web/app/{home => (dash)/chat}/actions.ts (100%) rename apps/web/app/{ => (dash)}/chat/chatWindow.tsx (100%) create mode 100644 apps/web/app/(dash)/chat/page.tsx rename apps/web/app/{home => (dash)}/header.tsx (100%) create mode 100644 apps/web/app/(dash)/home/page.tsx rename apps/web/app/{ => (dash)}/home/queryinput.tsx (96%) create mode 100644 apps/web/app/(dash)/layout.tsx rename apps/web/app/{home => (dash)}/menu.tsx (97%) create mode 100644 apps/web/app/(landing)/package.json delete mode 100644 apps/web/app/chat/page.tsx delete mode 100644 apps/web/app/home/page.tsx diff --git a/apps/web/app/home/actions.ts b/apps/web/app/(dash)/chat/actions.ts similarity index 100% rename from apps/web/app/home/actions.ts rename to apps/web/app/(dash)/chat/actions.ts diff --git a/apps/web/app/chat/chatWindow.tsx b/apps/web/app/(dash)/chat/chatWindow.tsx similarity index 100% rename from apps/web/app/chat/chatWindow.tsx rename to apps/web/app/(dash)/chat/chatWindow.tsx diff --git a/apps/web/app/(dash)/chat/page.tsx b/apps/web/app/(dash)/chat/page.tsx new file mode 100644 index 00000000..4ad4d468 --- /dev/null +++ b/apps/web/app/(dash)/chat/page.tsx @@ -0,0 +1,14 @@ +import { chatSearchParamsCache } from "../../helpers/lib/searchParams"; +import ChatWindow from "./chatWindow"; + +function Page({ + searchParams, +}: { + searchParams: Record; +}) { + const { firstTime, q, spaces } = chatSearchParamsCache.parse(searchParams); + + return ; +} + +export default Page; diff --git a/apps/web/app/home/header.tsx b/apps/web/app/(dash)/header.tsx similarity index 100% rename from apps/web/app/home/header.tsx rename to apps/web/app/(dash)/header.tsx diff --git a/apps/web/app/(dash)/home/page.tsx b/apps/web/app/(dash)/home/page.tsx new file mode 100644 index 00000000..a6624c1b --- /dev/null +++ b/apps/web/app/(dash)/home/page.tsx @@ -0,0 +1,27 @@ +import React from "react"; +import Menu from "../menu"; +import Header from "../header"; +import QueryInput from "./queryinput"; +import { homeSearchParamsCache } from "@/app/helpers/lib/searchParams"; + +function Page({ + searchParams, +}: { + searchParams: Record; +}) { + // TODO: use this to show a welcome page/modal + const { firstTime } = homeSearchParamsCache.parse(searchParams); + + return ( +
+ {/* all content goes here */} + {/*
hi {firstTime ? 'first time' : ''}
*/} + +
+ +
+
+ ); +} + +export default Page; diff --git a/apps/web/app/home/queryinput.tsx b/apps/web/app/(dash)/home/queryinput.tsx similarity index 96% rename from apps/web/app/home/queryinput.tsx rename to apps/web/app/(dash)/home/queryinput.tsx index a0e25d83..904fcca6 100644 --- a/apps/web/app/home/queryinput.tsx +++ b/apps/web/app/(dash)/home/queryinput.tsx @@ -2,10 +2,9 @@ import { ArrowRightIcon } from "@repo/ui/icons"; import Image from "next/image"; -import React, { useCallback, useState } from "react"; +import React, { useState } from "react"; import Divider from "@repo/ui/shadcn/divider"; import { MultipleSelector, Option } from "@repo/ui/shadcn/combobox"; -import { AnimatePresence } from "framer-motion"; import { useRouter } from "next/navigation"; const OPTIONS: Option[] = [ diff --git a/apps/web/app/(dash)/layout.tsx b/apps/web/app/(dash)/layout.tsx new file mode 100644 index 00000000..07c16485 --- /dev/null +++ b/apps/web/app/(dash)/layout.tsx @@ -0,0 +1,17 @@ +import React from "react"; +import Header from "./header"; +import Menu from "./menu"; + +function Layout({ children }: { children: React.ReactNode }) { + return ( +
+
+ + + + {children} +
+ ); +} + +export default Layout; diff --git a/apps/web/app/home/menu.tsx b/apps/web/app/(dash)/menu.tsx similarity index 97% rename from apps/web/app/home/menu.tsx rename to apps/web/app/(dash)/menu.tsx index 35a75ef9..1177bca6 100644 --- a/apps/web/app/home/menu.tsx +++ b/apps/web/app/(dash)/menu.tsx @@ -1,6 +1,5 @@ import React from "react"; import Image from "next/image"; -import Link from "next/link"; import { MemoriesIcon, ExploreIcon, HistoryIcon } from "@repo/ui/icons"; function Menu() { diff --git a/apps/web/app/(landing)/package.json b/apps/web/app/(landing)/package.json new file mode 100644 index 00000000..a7fabf2f --- /dev/null +++ b/apps/web/app/(landing)/package.json @@ -0,0 +1,5 @@ +{ + "scripts": { + "vercel-build": "next build" + } +} diff --git a/apps/web/app/chat/page.tsx b/apps/web/app/chat/page.tsx deleted file mode 100644 index bfe0c362..00000000 --- a/apps/web/app/chat/page.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { chatSearchParamsCache } from "../helpers/lib/searchParams"; -import Menu from "../home/menu"; -import Header from "../home/header"; -import ChatWindow from "./chatWindow"; - -function Page({ - searchParams, -}: { - searchParams: Record; -}) { - const { firstTime, q, spaces } = chatSearchParamsCache.parse(searchParams); - - return ( -
- - -
- - -
- ); -} - -export default Page; diff --git a/apps/web/app/home/page.tsx b/apps/web/app/home/page.tsx deleted file mode 100644 index 9908c017..00000000 --- a/apps/web/app/home/page.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import React from "react"; -import Menu from "./menu"; -import Header from "./header"; -import QueryInput from "./queryinput"; -import { homeSearchParamsCache } from "@/app/helpers/lib/searchParams"; - -function Page({ - searchParams, -}: { - searchParams: Record; -}) { - // TODO: use this to show a welcome page/modal - const { firstTime } = homeSearchParamsCache.parse(searchParams); - - return ( -
- - -
- -
- {/* all content goes here */} - {/*
hi {firstTime ? 'first time' : ''}
*/} - -
- -
-
-
- ); -} - -export default Page;