Add Twenty Shared & Fix profile image rendering (#8841)
PR Summary: 1. Added `Twenty Shared` Package to centralize utilitiies as mentioned in #8942 2. Optimization of `getImageAbsoluteURI.ts` to handle edge cases  --------- Co-authored-by: Antoine Moreaux <moreaux.antoine@gmail.com> Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
committed by
GitHub
parent
4e329d08b0
commit
08a9db2df6
@ -8,11 +8,14 @@ import {
|
||||
NavigationDrawerProps,
|
||||
} from '@/ui/navigation/navigation-drawer/components/NavigationDrawer';
|
||||
import { isAdvancedModeEnabledState } from '@/ui/navigation/navigation-drawer/states/isAdvancedModeEnabledState';
|
||||
import { getImageAbsoluteURI } from 'twenty-shared';
|
||||
import { REACT_APP_SERVER_BASE_URL } from '~/config';
|
||||
|
||||
import { useIsSettingsDrawer } from '@/navigation/hooks/useIsSettingsDrawer';
|
||||
|
||||
import { AdvancedSettingsToggle, getImageAbsoluteURI } from 'twenty-ui';
|
||||
import { MainNavigationDrawerItems } from './MainNavigationDrawerItems';
|
||||
import { MainNavigationDrawerItems } from '@/navigation/components/MainNavigationDrawerItems';
|
||||
import { isNonEmptyString } from '@sniptt/guards';
|
||||
import { AdvancedSettingsToggle } from 'twenty-ui';
|
||||
|
||||
export type AppNavigationDrawerProps = {
|
||||
className?: string;
|
||||
@ -40,10 +43,12 @@ export const AppNavigationDrawer = ({
|
||||
),
|
||||
}
|
||||
: {
|
||||
logo:
|
||||
(currentWorkspace?.logo &&
|
||||
getImageAbsoluteURI(currentWorkspace.logo)) ??
|
||||
undefined,
|
||||
logo: isNonEmptyString(currentWorkspace?.logo)
|
||||
? getImageAbsoluteURI({
|
||||
imageUrl: currentWorkspace.logo,
|
||||
baseUrl: REACT_APP_SERVER_BASE_URL,
|
||||
})
|
||||
: undefined,
|
||||
title: currentWorkspace?.displayName ?? undefined,
|
||||
children: <MainNavigationDrawerItems />,
|
||||
footer: <SupportDropdown />,
|
||||
|
||||
Reference in New Issue
Block a user