From f16435101111c5dbd8f820c9d2e0d2ebc893ccb1 Mon Sep 17 00:00:00 2001 From: grngxd <36968271+grngxd@users.noreply.github.com> Date: Sat, 21 Jun 2025 17:44:55 +0100 Subject: [PATCH] top bar --- src/components/dashboard/TitleBar.tsx | 36 +++++++++++++++++++++++++-- src/lib/stores.ts | 8 +++++- src/routes/dashboard/index.tsx | 4 +-- src/routes/layout.tsx | 1 - 4 files changed, 43 insertions(+), 6 deletions(-) diff --git a/src/components/dashboard/TitleBar.tsx b/src/components/dashboard/TitleBar.tsx index 8ae4d02..ba9caa5 100644 --- a/src/components/dashboard/TitleBar.tsx +++ b/src/components/dashboard/TitleBar.tsx @@ -1,9 +1,41 @@ import { component$ } from "@builder.io/qwik"; +import { useNanostore$ } from "~/hooks/nanostores"; +import { userInfo } from "~/lib/stores"; +import { StereoUser } from "~/lib/types"; export default component$(() => { + const greetings = [ + "what's on the agenda today, |?", + "what's on your mind, |?", + "what's the plan, |?", + "ready to rock, |?", + "what's brewing, |?", + "what's the latest, |?", + "how's your day going, |?", + "need some inspiration, |?", + "let's make some noise, |!", + "welcome back, |!", + "good to see you, |!", + "what are we making today, |?", + "time to make some magic, |!", + "let's get creative, |?", + "what's the vibe today, |?", + ] + + const greeting = greetings[Math.floor(Math.random() * greetings.length)]; + const user = useNanostore$(userInfo); + + const splits = greeting.split("|"); + return ( -
-

whats on the agenda today, @hexlocation?

+
+

+ {splits[0]} + + @{user.value?.username || "..."} + + {splits[1]} +

) }) \ No newline at end of file diff --git a/src/lib/stores.ts b/src/lib/stores.ts index 8fa59e2..ab97728 100644 --- a/src/lib/stores.ts +++ b/src/lib/stores.ts @@ -3,4 +3,10 @@ import { StereoFile, StereoUser } from "./types"; export const areFilesLoaded = atom(false); export const dashboardFiles = atom([]); -export const userInfo = atom({} as StereoUser); \ No newline at end of file +export const userInfo = atom({ + id: "1", + username: "user", + blacklisted: false, + email: "user@example.com", + created_at: Date.now().toString(), +}); \ No newline at end of file diff --git a/src/routes/dashboard/index.tsx b/src/routes/dashboard/index.tsx index c2db24e..10aa70b 100644 --- a/src/routes/dashboard/index.tsx +++ b/src/routes/dashboard/index.tsx @@ -26,11 +26,11 @@ export default component$(() => { }); return ( - <> +
- +
); }); diff --git a/src/routes/layout.tsx b/src/routes/layout.tsx index c7a9b0f..9ed7b73 100644 --- a/src/routes/layout.tsx +++ b/src/routes/layout.tsx @@ -11,7 +11,6 @@ export default component$(() => { useOnDocument("DOMContentLoaded", $(async () => { info.value = await api.me() - console.log(info.value); AOS.init({ once: true,