diff --git a/apps/nextjs-app/src/app/app/_components/dashboard-info.tsx b/apps/nextjs-app/src/app/app/_components/dashboard-info.tsx index 92b6be5c..ac960641 100644 --- a/apps/nextjs-app/src/app/app/_components/dashboard-info.tsx +++ b/apps/nextjs-app/src/app/app/_components/dashboard-info.tsx @@ -5,30 +5,178 @@ import { useUser } from '@/lib/auth'; export const DashboardInfo = () => { const user = useUser(); + if (!user.data) return null; + + const isAdmin = user.data?.role === 'ADMIN'; + const isUser = user.data?.role === 'USER'; + return ( - <> -

- Welcome {`${user.data?.firstName} ${user.data?.lastName}`} -

-

- Your role is : {user.data?.role} -

-

In this application you can:

- {user.data?.role === 'USER' && ( - - )} - {user.data?.role === 'ADMIN' && ( - - )} - +
+
+

+ Welcome back, {`${user.data?.firstName} ${user.data?.lastName}`}! 👋 +

+
+ + + + Role: {user.data?.role} +
+
+ +
+
+ + + +

+ Available Features +

+
+

+ In this application you can: +

+ {isUser && ( + + )} + {isAdmin && ( + + )} +
+
); }; diff --git a/apps/nextjs-app/src/app/page.tsx b/apps/nextjs-app/src/app/page.tsx index 2d7d0051..29e2b7d6 100644 --- a/apps/nextjs-app/src/app/page.tsx +++ b/apps/nextjs-app/src/app/page.tsx @@ -7,15 +7,28 @@ const HomePage = () => { const isLoggedIn = checkLoggedIn(); return ( -
+
-

- Bulletproof React +
+ react +
+

+ + Bulletproof React +

- react -

Showcasing Best Practices For Building React Applications

-
-
+

+ Showcasing Best Practices For Building React Applications +

+

+ Production-ready patterns and architectural decisions +

+