From fc4dfe4fffce05c91f6766024891bdb39b2a3299 Mon Sep 17 00:00:00 2001
From: Ellie Huxtable <ellie@elliehuxtable.com>
Date: Tue, 28 May 2024 14:54:05 +0100
Subject: feat(ui): use correct username on welcome screen (#2050)

* wip

* fetch and use username
---
 ui/src/pages/Home.tsx | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

(limited to 'ui/src/pages/Home.tsx')

diff --git a/ui/src/pages/Home.tsx b/ui/src/pages/Home.tsx
index c0f8fbc5..ce42e0b1 100644
--- a/ui/src/pages/Home.tsx
+++ b/ui/src/pages/Home.tsx
@@ -15,7 +15,7 @@ function Stats({ stats }: any) {
             <dt className="truncate text-sm font-medium text-gray-500">
               {item.name}
             </dt>
-            <dd className="mt-1 text-3xl font-semibold tracking-tight text-gray-900">
+            <dd className="mt-1 text-xl font-semibold tracking-tight text-gray-900">
               {item.stat}
             </dd>
           </div>
@@ -44,10 +44,13 @@ function Header({ name }: any) {
 
 export default function Home() {
   const homeInfo = useStore((state) => state.homeInfo);
+  const user = useStore((state) => state.user);
   const refreshHomeInfo = useStore((state) => state.refreshHomeInfo);
+  const refreshUser = useStore((state) => state.refreshUser);
 
   useEffect(() => {
     refreshHomeInfo();
+    refreshUser();
   }, []);
 
   if (!homeInfo) {
@@ -57,7 +60,7 @@ export default function Home() {
   return (
     <div className="pl-60">
       <div className="p-10">
-        <Header name={"Ellie"} />
+        <Header name={user.username} />
 
         <div className="pt-10">
           <h2 className="text-xl font-bold">Sync</h2>
-- 
cgit v1.3.1

