From a0811ed6c4d1ed4b76531b8f13429c2024ae17b7 Mon Sep 17 00:00:00 2001 From: thislight Date: Mon, 4 Nov 2024 15:57:53 +0800 Subject: [PATCH] Profile: add current default account into menu --- src/profiles/Profile.tsx | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/src/profiles/Profile.tsx b/src/profiles/Profile.tsx index f3a5823..6976565 100644 --- a/src/profiles/Profile.tsx +++ b/src/profiles/Profile.tsx @@ -10,6 +10,7 @@ import { onCleanup, Show, type Component, + createMemo, } from "solid-js"; import Scaffold from "../material/Scaffold"; import { @@ -137,6 +138,17 @@ const Profile: Component = () => { recentTootChunk.loading || (recentTootFilter().pinned && pinnedTootChunk.loading); + const sessionDisplayName = createMemo(() => + resolveCustomEmoji( + session().account?.inf?.displayName || "", + session().account?.inf?.emojis ?? [], + ), + ); + + const useSessionDisplayName = (e: HTMLElement) => { + createRenderEffect(() => (e.innerHTML = sessionDisplayName())); + }; + return ( { document.getElementById(menuButId)!.getBoundingClientRect() } > + + + + + + + + + {/* // for future */} + + { height: "100%", }} crossOrigin="anonymous" - onLoad={async (event) => { + onLoad={(event) => { const ins = new FastAverageColor(); const colors = ins.getColor(event.currentTarget); setBannerSampledColors({ @@ -301,16 +324,7 @@ const Profile: Component = () => { - - createRenderEffect(() => { - e.innerHTML = resolveCustomEmoji( - session().account?.inf?.displayName || "", - session().account?.inf?.emojis ?? [], - ); - }) - } - > + 's Home