From 76a8a644a20340a1cda4a05a58a43d4dee8894d3 Mon Sep 17 00:00:00 2001 From: Etienne <45695613+etiennejouan@users.noreply.github.com> Date: Wed, 21 May 2025 12:07:17 +0200 Subject: [PATCH] fix mail thread design (#12167) ## Before METADATA Screenshot 2025-05-21 at 11 34 51 SUBJECT Screenshot 2025-05-21 at 11 34 38 SHARE_EVERYTHING Screenshot 2025-05-21 at 11 34 04 ## After SHARE_EVERYTHING Screenshot 2025-05-21 at 11 29 18 METADAT Screenshot 2025-05-21 at 11 28 49 SUBJECT Screenshot 2025-05-21 at 11 28 35 Design : https://www.figma.com/design/xt8O9mFeLl46C5InWwoMrN/Twenty?node-id=23338-52430&t=9NbeB5idQaaOWPAq-0 --- .../components/EmailThreadNotShared.tsx | 9 +++--- .../emails/components/EmailThreadPreview.tsx | 30 +++++++++---------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/packages/twenty-front/src/modules/activities/emails/components/EmailThreadNotShared.tsx b/packages/twenty-front/src/modules/activities/emails/components/EmailThreadNotShared.tsx index 60d5cb1d0..07dc6a775 100644 --- a/packages/twenty-front/src/modules/activities/emails/components/EmailThreadNotShared.tsx +++ b/packages/twenty-front/src/modules/activities/emails/components/EmailThreadNotShared.tsx @@ -11,8 +11,7 @@ const StyledContainer = styled.div<{ isCompact?: boolean }>` height: 20px; margin-left: auto; width: ${({ isCompact }) => (isCompact ? 'auto' : '100%')}; - min-width: ${({ theme }) => - `calc(${theme.icon.size.md} + ${theme.spacing(2)})`}; + min-width: ${({ theme }) => `${theme.spacing(21)}`}; padding: ${({ theme }) => theme.spacing(0, 1)}; border-radius: 4px; @@ -21,6 +20,8 @@ const StyledContainer = styled.div<{ isCompact?: boolean }>` color: ${({ theme }) => theme.font.color.tertiary}; font-weight: ${({ theme }) => theme.font.weight.regular}; + font-size: ${({ theme }) => theme.font.size.sm}; + flex: 1; `; type EmailThreadNotSharedProps = { @@ -37,8 +38,8 @@ export const EmailThreadNotShared = ({ return ( <> - - {visibility === MessageChannelVisibility.METADATA && 'Not shared'} + + {'Not shared'} {visibility === MessageChannelVisibility.SUBJECT && ( ` +const StyledSubject = styled.span` color: ${({ theme }) => theme.font.color.primary}; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; - flex-shrink: 0; - flex: ${({ flex }) => flex}; - max-width: max-content; `; const StyledBody = styled.span` @@ -59,6 +56,7 @@ const StyledBody = styled.span` overflow: hidden; text-overflow: ellipsis; white-space: nowrap; + flex: 1; `; const StyledReceivedAt = styled.div` @@ -145,20 +143,20 @@ export const EmailThreadPreview = ({ thread }: EmailThreadPreviewProps) => { - {visibility !== MessageChannelVisibility.METADATA && ( - - {thread.subject} - + {visibility === MessageChannelVisibility.METADATA && ( + + )} + {visibility === MessageChannelVisibility.SUBJECT && ( + <> + {thread.subject} + + )} {visibility === MessageChannelVisibility.SHARE_EVERYTHING && ( - {thread.lastMessageBody} - )} - {visibility !== MessageChannelVisibility.SHARE_EVERYTHING && ( - + <> + {thread.subject} + {thread.lastMessageBody} + )}