From 526268f99740edebe1227a70e6eafd99a072ea49 Mon Sep 17 00:00:00 2001 From: Dhravya Date: Sat, 29 Jun 2024 03:02:22 -0500 Subject: [PATCH] more tweaks --- apps/web/app/(dash)/home/homeVariants.ts | 50 ++++++++++++++++++++++++ apps/web/app/(dash)/home/page.tsx | 32 +++++++++------ apps/web/app/(dash)/layout.tsx | 9 +++++ apps/web/app/(dash)/menu.tsx | 10 +++-- packages/ui/shadcn/combobox.tsx | 6 +-- packages/ui/shadcn/command.tsx | 2 +- packages/ui/shadcn/dialog.tsx | 2 +- 7 files changed, 88 insertions(+), 23 deletions(-) create mode 100644 apps/web/app/(dash)/home/homeVariants.ts diff --git a/apps/web/app/(dash)/home/homeVariants.ts b/apps/web/app/(dash)/home/homeVariants.ts new file mode 100644 index 00000000..ec24e22b --- /dev/null +++ b/apps/web/app/(dash)/home/homeVariants.ts @@ -0,0 +1,50 @@ +export const variants = [ + [ + { + type: "text", + content: "Unlock your", + }, + { + type: "highlighted", + content: " digital brain", + }, + ], + [ + { + type: "text", + content: "Save", + }, + { + type: "highlighted", + content: " everything.", + }, + { + type: "text", + content: " Connect", + }, + { + type: "highlighted", + content: " anything.", + }, + ], + [ + { + type: "text", + content: "Turn your bookmarks into", + }, + { + type: "highlighted", + content: " insights.", + }, + ], + [ + { + type: "text", + content: "The smart way to use your", + }, + { + type: "highlighted", + content: " digital treasures.", + }, + ], +]; diff --git a/apps/web/app/(dash)/home/page.tsx b/apps/web/app/(dash)/home/page.tsx index 12e3bad8..4f7e4af6 100644 --- a/apps/web/app/(dash)/home/page.tsx +++ b/apps/web/app/(dash)/home/page.tsx @@ -10,6 +10,7 @@ import { toast } from "sonner"; import { useSession } from "next-auth/react"; import { motion } from "framer-motion"; import BackgroundPlus from "@/app/(landing)/GridPatterns/PlusGrid"; +import { variants } from "./homeVariants"; const slap = { initial: { @@ -40,6 +41,8 @@ function Page({ const [spaces, setSpaces] = useState<{ id: number; name: string }[]>([]); + const [showVariant, setShowVariant] = useState(0); + useEffect(() => { if (telegramUser) { const linkTelegram = async () => { @@ -62,6 +65,8 @@ function Page({ } // TODO: HANDLE ERROR }); + + setShowVariant(Math.floor(Math.random() * variants.length)); }, []); return ( @@ -69,15 +74,6 @@ function Page({ {/* all content goes here */} {/*
hi {firstTime ? 'first time' : ''}
*/} -
-
-
- - - - Unlock your{" "} - - digital brain - + {variants[showVariant]!.map((v, i) => { + return ( + + {v.content} + + ); + })}
diff --git a/apps/web/app/(dash)/layout.tsx b/apps/web/app/(dash)/layout.tsx index edac6048..385e46e0 100644 --- a/apps/web/app/(dash)/layout.tsx +++ b/apps/web/app/(dash)/layout.tsx @@ -3,6 +3,7 @@ import Menu from "./menu"; import { redirect } from "next/navigation"; import { auth } from "../../server/auth"; import { Toaster } from "@repo/ui/shadcn/sonner"; +import BackgroundPlus from "../(landing)/GridPatterns/PlusGrid"; async function Layout({ children }: { children: React.ReactNode }) { const info = await auth(); @@ -17,6 +18,14 @@ async function Layout({ children }: { children: React.ReactNode }) {
+
+
+
+ +
{children}
diff --git a/apps/web/app/(dash)/menu.tsx b/apps/web/app/(dash)/menu.tsx index 4b03604f..0622ddc0 100644 --- a/apps/web/app/(dash)/menu.tsx +++ b/apps/web/app/(dash)/menu.tsx @@ -179,7 +179,7 @@ function Menu() {
- +
{ const content = e.get("content")?.toString(); @@ -201,7 +201,7 @@ function Menu() { Resource (URL or content)