3681 avatars are not appearing in the messages and people name should be bold (#3692)

* update font weight

* fix picture not appearing
This commit is contained in:
bosiraphael 2024-01-30 17:46:25 +01:00 committed by GitHub
parent 1838d8e6fb
commit 8b9d62e425
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 2 deletions

View File

@ -24,6 +24,7 @@ const StyledAvatar = styled(Avatar)`
const StyledSenderName = styled.span`
font-size: ${({ theme }) => theme.font.size.sm};
font-weight: ${({ theme }) => theme.font.weight.medium};
overflow: hidden;
text-overflow: ellipsis;
`;
@ -35,6 +36,10 @@ const StyledThreadMessageSentAt = styled.div`
font-size: ${({ theme }) => theme.font.size.sm};
`;
const StyledRecordChip = styled(RecordChip)`
font-weight: ${({ theme }) => theme.font.weight.medium};
`;
type EmailThreadMessageSenderProps = {
sender: EmailThreadMessageParticipant;
sentAt: string;
@ -57,7 +62,7 @@ export const EmailThreadMessageSender = ({
<StyledEmailThreadMessageSender>
<StyledEmailThreadMessageSenderUser>
{person ? (
<RecordChip
<StyledRecordChip
objectNameSingular={CoreObjectNameSingular.Person}
record={person}
/>

View File

@ -52,10 +52,13 @@ export const getObjectRecordIdentifier = ({
? 'squared'
: 'rounded';
// TODO: This is a temporary solution before we seed imageIdentifierFieldMetadataId in the database
const avatarUrl =
(objectMetadataItem.nameSingular === CoreObjectNameSingular.Company
? getLogoUrlFromDomainName(record['domainName'] ?? '')
: imageIdentifierFieldValue) ?? '';
: objectMetadataItem.nameSingular === CoreObjectNameSingular.Person
? record['avatarUrl'] ?? ''
: imageIdentifierFieldValue) ?? '';
const basePathToShowPage = getBasePathToShowPage({
objectMetadataItem,

View File

@ -9,12 +9,14 @@ export type RecordChipProps = {
objectNameSingular: string;
record: ObjectRecord;
maxWidth?: number;
className?: string;
};
export const RecordChip = ({
objectNameSingular,
record,
maxWidth,
className,
}: RecordChipProps) => {
const { objectMetadataItem } = useObjectMetadataItemOnly({
objectNameSingular,
@ -34,6 +36,7 @@ export const RecordChip = ({
avatarUrl={objectRecordIdentifier.avatarUrl}
linkToEntity={objectRecordIdentifier.linkToShowPage}
maxWidth={maxWidth}
className={className}
/>
);
};