mirror of
https://github.com/twentyhq/twenty.git
synced 2024-11-28 09:12:37 +03:00
fix: 802 if no text dont show avatar (#831)
* fix: 802 if no text dont show avatar * fix: 802 use guard for empty check and allow whitespace only case
This commit is contained in:
parent
7f6b39339b
commit
c4468d60f6
@ -4,6 +4,7 @@ import { Theme } from '@emotion/react';
|
||||
import styled from '@emotion/styled';
|
||||
|
||||
import { Avatar, AvatarType } from '@/users/components/Avatar';
|
||||
import { isNonEmptyString } from '~/utils/isNonEmptyString';
|
||||
|
||||
import { OverflowingTextWithTooltip } from '../../tooltip/OverflowingTextWithTooltip';
|
||||
|
||||
@ -89,26 +90,30 @@ export function EntityChip({
|
||||
onClick={handleLinkClick}
|
||||
variant={variant}
|
||||
>
|
||||
<Avatar
|
||||
avatarUrl={picture}
|
||||
colorId={entityId}
|
||||
placeholder={name}
|
||||
size={14}
|
||||
type={avatarType}
|
||||
/>
|
||||
{isNonEmptyString(name) && (
|
||||
<Avatar
|
||||
avatarUrl={picture}
|
||||
colorId={entityId}
|
||||
placeholder={name}
|
||||
size={14}
|
||||
type={avatarType}
|
||||
/>
|
||||
)}
|
||||
<StyledName>
|
||||
<OverflowingTextWithTooltip text={name} />
|
||||
</StyledName>
|
||||
</StyledContainerLink>
|
||||
) : (
|
||||
<StyledContainerReadOnly data-testid="entity-chip">
|
||||
<Avatar
|
||||
avatarUrl={picture}
|
||||
colorId={entityId}
|
||||
placeholder={name}
|
||||
size={14}
|
||||
type={avatarType}
|
||||
/>
|
||||
{isNonEmptyString(name) && (
|
||||
<Avatar
|
||||
avatarUrl={picture}
|
||||
colorId={entityId}
|
||||
placeholder={name}
|
||||
size={14}
|
||||
type={avatarType}
|
||||
/>
|
||||
)}
|
||||
<StyledName>
|
||||
<OverflowingTextWithTooltip text={name} />
|
||||
</StyledName>
|
||||
|
Loading…
Reference in New Issue
Block a user