Decouple twenty-ui Avatar from app server-URL config (#21968)
Makes `twenty-ui`'s `Avatar` render the `avatarUrl` it receives instead of building it from `window._env_`/`window.location` at module load, so the library no longer depends on the app environment. URL resolution moves to `twenty-front` via a `getAbsoluteImageUrl` helper applied at the call sites. Part of making twenty-ui a standalone library.
This commit is contained in:
+4
-3
@@ -34,6 +34,7 @@ import {
|
||||
GetWorkspaceCreationDefaultsDocument,
|
||||
} from '~/generated-metadata/graphql';
|
||||
import { getWorkspaceUrl } from '~/utils/getWorkspaceUrl';
|
||||
import { getAbsoluteImageUrl } from '~/utils/image/getAbsoluteImageUrl';
|
||||
|
||||
const StyledWorkspaceContainer = styled.div`
|
||||
background-color: ${themeCssVariables.background.secondary};
|
||||
@@ -172,9 +173,9 @@ export const SignInUpGlobalScopeForm = () => {
|
||||
<StyledWorkspaceContent>
|
||||
<Avatar
|
||||
placeholder={availableWorkspace.displayName || ''}
|
||||
avatarUrl={
|
||||
availableWorkspace.logo ?? DEFAULT_WORKSPACE_LOGO
|
||||
}
|
||||
avatarUrl={getAbsoluteImageUrl(
|
||||
availableWorkspace.logo ?? DEFAULT_WORKSPACE_LOGO,
|
||||
)}
|
||||
size="lg"
|
||||
/>
|
||||
<StyledWorkspaceTextContainer>
|
||||
|
||||
Reference in New Issue
Block a user