From 3c9894731d0d8f7885113ee212e07ad6ce691f79 Mon Sep 17 00:00:00 2001 From: Antonio Marcelo Date: Wed, 3 Apr 2024 16:41:31 -0300 Subject: [PATCH 1/2] Fix conditional name in avatar --- src/components/UserPopup/index.tsx | 2 +- src/lib-components/Navbar/index.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/UserPopup/index.tsx b/src/components/UserPopup/index.tsx index 00dc71f..8ab4c91 100644 --- a/src/components/UserPopup/index.tsx +++ b/src/components/UserPopup/index.tsx @@ -47,7 +47,7 @@ export const UserPopup = (props: UserPopupProps) => { - + {(user.name[0] ?? user.username?.charAt(0)) ?? ''} {user.name ?? user.username ?? 'User Display Name'} diff --git a/src/lib-components/Navbar/index.tsx b/src/lib-components/Navbar/index.tsx index 8e30c2f..8933aa6 100644 --- a/src/lib-components/Navbar/index.tsx +++ b/src/lib-components/Navbar/index.tsx @@ -190,7 +190,7 @@ export const Navbar = ({ onClick={handleUserMenu} color='inherit' > - + {profile.name[0]?.charAt(0) ?? profile.username?.charAt(0) ?? ''} @@ -307,7 +307,7 @@ export const Navbar = ({ onClick={handleUserMenu} color='inherit' > - + {profile.name[0].charAt(0)} From 18875163f23c34437887678dba4a442a0f81aed1 Mon Sep 17 00:00:00 2001 From: Antonio Marcelo Date: Mon, 15 Apr 2024 10:20:59 -0300 Subject: [PATCH 2/2] fix: conditional name in avatar and remove outline from navbar hamburger button --- src/components/HamburgerButton/styles.ts | 2 +- src/components/UserPopup/index.tsx | 6 +++--- src/lib-components/Navbar/index.tsx | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/HamburgerButton/styles.ts b/src/components/HamburgerButton/styles.ts index 152d405..b974083 100644 --- a/src/components/HamburgerButton/styles.ts +++ b/src/components/HamburgerButton/styles.ts @@ -32,7 +32,7 @@ export const Hamburger = styled.button<{ isOpen: boolean }>` border: none; width: 30px; height: 16px; - + outline: none; display: flex; flex-direction: column; justify-content: space-between; diff --git a/src/components/UserPopup/index.tsx b/src/components/UserPopup/index.tsx index 8ab4c91..0716fa9 100644 --- a/src/components/UserPopup/index.tsx +++ b/src/components/UserPopup/index.tsx @@ -47,10 +47,10 @@ export const UserPopup = (props: UserPopupProps) => { - - {(user.name[0] ?? user.username?.charAt(0)) ?? ''} + + {user.name ? user.name[0] : '-'} - {user.name ?? user.username ?? 'User Display Name'} + {user.name ? user.name : '-'}

{user.email}

diff --git a/src/lib-components/Navbar/index.tsx b/src/lib-components/Navbar/index.tsx index 8933aa6..842c87d 100644 --- a/src/lib-components/Navbar/index.tsx +++ b/src/lib-components/Navbar/index.tsx @@ -190,9 +190,9 @@ export const Navbar = ({ onClick={handleUserMenu} color='inherit' > - - {profile.name[0]?.charAt(0) ?? profile.username?.charAt(0) ?? ''} - + + {profile.name ? profile.name?.charAt(0) : '-'} + )} @@ -307,8 +307,8 @@ export const Navbar = ({ onClick={handleUserMenu} color='inherit' > - - {profile.name[0].charAt(0)} + + {profile.name ? profile.name[0].charAt(0) : '-'} )}