Fix broken image urls in Settings > Profile and Invite To Workspace Email (#8942)
Fixes #8601 We had 3 implementations of getImageAbsoluteURI: in twenty-front, in twenty-ui and in twenty-emails. I was able to remove the one in twenty-front but I could not remove it from twenty-emails as this is a standalone for now. The vision is to introduce shared utils in a twenty-shared package
This commit is contained in:
@ -9,7 +9,12 @@ import { AvatarSize } from '@ui/display/avatar/types/AvatarSize';
|
||||
import { AvatarType } from '@ui/display/avatar/types/AvatarType';
|
||||
import { IconComponent } from '@ui/display/icon/types/IconComponent';
|
||||
import { ThemeContext } from '@ui/theme';
|
||||
import { Nullable, getImageAbsoluteURI, stringToHslColor } from '@ui/utilities';
|
||||
import {
|
||||
Nullable,
|
||||
getImageAbsoluteURI,
|
||||
isDefined,
|
||||
stringToHslColor,
|
||||
} from '@ui/utilities';
|
||||
|
||||
const StyledAvatar = styled.div<{
|
||||
size: AvatarSize;
|
||||
@ -82,7 +87,7 @@ export const Avatar = ({
|
||||
);
|
||||
|
||||
const avatarImageURI = useMemo(
|
||||
() => getImageAbsoluteURI(avatarUrl),
|
||||
() => (isDefined(avatarUrl) ? getImageAbsoluteURI(avatarUrl) : null),
|
||||
[avatarUrl],
|
||||
);
|
||||
|
||||
|
||||
@ -254,7 +254,7 @@ export {
|
||||
IconVideo,
|
||||
IconWand,
|
||||
IconWorld,
|
||||
IconX
|
||||
IconX,
|
||||
} from '@tabler/icons-react';
|
||||
|
||||
export type { TablerIconsProps } from '@tabler/icons-react';
|
||||
|
||||
Reference in New Issue
Block a user