From c9485124fc1c476b18a35e1d7ea3c2f961daf991 Mon Sep 17 00:00:00 2001 From: Pragyanand Sahoo Date: Thu, 10 Oct 2024 15:49:30 +0530 Subject: [PATCH] feat: Add profile on mobile top nav (#2236) * Feature/Add profile on mobile top nav * Update mobile-sidebar.tsx * Update user-button.tsx * [autofix.ci] apply automated fixes * Update user-button.tsx * Update user-button.tsx * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- apps/dashboard/app/(app)/mobile-sidebar.tsx | 15 ++++++---- apps/dashboard/app/(app)/user-button.tsx | 33 ++++++++++++++++----- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/apps/dashboard/app/(app)/mobile-sidebar.tsx b/apps/dashboard/app/(app)/mobile-sidebar.tsx index fe5445fcd3..56cfc43a4a 100644 --- a/apps/dashboard/app/(app)/mobile-sidebar.tsx +++ b/apps/dashboard/app/(app)/mobile-sidebar.tsx @@ -10,6 +10,7 @@ import { Menu } from "lucide-react"; import Link from "next/link"; import { useSelectedLayoutSegments } from "next/navigation"; import { WorkspaceSwitcher } from "./team-switcher"; +import { UserButton } from "./user-button"; type Props = { className?: string; @@ -23,17 +24,19 @@ type Props = { export const MobileSideBar = ({ className, workspace }: Props) => { const segments = useSelectedLayoutSegments() ?? []; - const workspaceNavigation = createWorkspaceNavigation(workspace, segments); return ( -
+
- - - - +
+ + + + +
+
diff --git a/apps/dashboard/app/(app)/user-button.tsx b/apps/dashboard/app/(app)/user-button.tsx index 1f4f12b8c9..24e452ed38 100644 --- a/apps/dashboard/app/(app)/user-button.tsx +++ b/apps/dashboard/app/(app)/user-button.tsx @@ -15,6 +15,7 @@ import { Book, ChevronRight, LogOut, Rocket, Settings } from "lucide-react"; import Link from "next/link"; import { useRouter } from "next/navigation"; import type React from "react"; + export const UserButton: React.FC = () => { const { user } = useUser(); const router = useRouter(); @@ -25,17 +26,35 @@ export const UserButton: React.FC = () => { return ( - -
- + +
+ + + + {user.username ?? user.fullName ?? user.primaryEmailAddress?.emailAddress} + + + + + {user.username ?? user.fullName ?? user.primaryEmailAddress?.emailAddress} + + + + {user.imageUrl ? : null} - + {(user?.fullName ?? "U").slice(0, 2).toUpperCase()} - + {user.username ?? user.fullName ?? user.primaryEmailAddress?.emailAddress} @@ -47,9 +66,9 @@ export const UserButton: React.FC = () => {
- +
- +