Fix: Replace styled logo with Avatar component for workspace logo in NavigationDrawerHeader (#9093)

This PR addresses issue #9042

- Replaced the styled logo with the `Avatar` component.
- `Avatar` now handles the case when no `logo` is uploaded by using the
workspace name's first character as the `placeholder`.
- This ensures a consistent fallback when the `logo` is undefined.

---------

Co-authored-by: guillim <guigloo@msn.com>
Co-authored-by: Félix Malfait <felix@twenty.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Murali Singh
2024-12-18 01:12:06 +05:30
committed by GitHub
parent 07bde4883e
commit fb8d193238
4 changed files with 15 additions and 44 deletions

View File

@ -1,4 +1,5 @@
import { workspacePublicDataState } from '@/auth/states/workspacePublicDataState';
import { DEFAULT_WORKSPACE_LOGO } from '@/ui/navigation/navigation-drawer/constants/DefaultWorkspaceLogo';
import { Helmet } from 'react-helmet-async';
import { useRecoilValue } from 'recoil';
import { getImageAbsoluteURI } from 'twenty-shared';
@ -16,7 +17,7 @@ export const PageFavicon = () => {
getImageAbsoluteURI({
imageUrl: workspacePublicData.logo,
baseUrl: REACT_APP_SERVER_BASE_URL,
}) ?? ''
}) ?? DEFAULT_WORKSPACE_LOGO
}
/>
)}