From 393f08129bfc7851df643a25debed86aed50cb01 Mon Sep 17 00:00:00 2001 From: grngxd <36968271+grngxd@users.noreply.github.com> Date: Fri, 8 Aug 2025 22:32:02 +0100 Subject: [PATCH] embeds --- src/components/dashboard/Settings.tsx | 52 +++++++++++++++++++++++++-- src/lib/stores.ts | 2 ++ src/lib/types.ts | 2 ++ 3 files changed, 53 insertions(+), 3 deletions(-) diff --git a/src/components/dashboard/Settings.tsx b/src/components/dashboard/Settings.tsx index 818322a..f470185 100644 --- a/src/components/dashboard/Settings.tsx +++ b/src/components/dashboard/Settings.tsx @@ -3,17 +3,62 @@ // import { isSettingsOpen, userInfo } from "~/lib/stores"; // import { StereoUser } from "~/lib/types"; -import { $, component$, useComputed$, useSignal, useTask$ } from "@builder.io/qwik"; +import { $, component$, useComputed$, useSignal, useTask$, useVisibleTask$ } from "@builder.io/qwik"; import ky from "ky"; import { useNanostore$ } from "~/hooks/nanostores"; -import { isSettingsOpen } from "~/lib/stores"; +import { isSettingsOpen, userInfo } from "~/lib/stores"; const StorageAndPlan = component$(() => { + const user = useNanostore$(userInfo); + + useVisibleTask$(({track}) => { + if (user.value) { + console.log(user.value.global_name); + } + }); + return ( -
+

current plan: stereo pro+

storage used: 3.8 / 15 GB

upgrade your plan for more features

+ +

embed editor

+ {user.value && ( +
+
+ + +
+
+

{user.value.global_name}

+

{new Date().toLocaleTimeString().split(":").slice(0, 2).join(":")}

+
+
+
+
+

This is a test

+ +
+
+
+
+ +
+ {/* form for embed */} +
+
+ )}
); }); @@ -142,6 +187,7 @@ export default component$(() => { ))}
+

{categories.value[selectedCategory.value].name}

diff --git a/src/lib/stores.ts b/src/lib/stores.ts index ed2bd87..051a309 100644 --- a/src/lib/stores.ts +++ b/src/lib/stores.ts @@ -8,6 +8,8 @@ export const userInfo = atom({ username: "user", blacklisted: false, email: "user@example.com", + avatar: "", + global_name: "User", created_at: Date.now().toString(), }); export const isSettingsOpen = atom(false); diff --git a/src/lib/types.ts b/src/lib/types.ts index a321fe1..da141eb 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -13,7 +13,9 @@ export type StereoFile = { export type StereoUser = { id: string; username: string; + global_name: string; blacklisted: boolean; email: string; + avatar: string; created_at: string; } \ No newline at end of file