From 098551b7b882c158bd71e4d65cc4f6375085294e Mon Sep 17 00:00:00 2001 From: Harshit Singh <73997189+harshit078@users.noreply.github.com> Date: Tue, 8 Oct 2024 20:18:15 +0530 Subject: [PATCH] fix: Invite by email table overflows in mobile viewport (#7273) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ##Description - This PR solves the issue #7253 - Made the invite table mobile friendly for all media width ## Before https://github.com/user-attachments/assets/458bd47d-38fb-4ddc-a996-c1bb3908d014 Screenshot 2024-09-27 at 1 30 52 AM ## After Screenshot 2024-09-27 at 1 34 11 AM https://github.com/user-attachments/assets/7a4f6f9a-7fef-42f1-a226-59a1d73767f4 > [!Note] > I've added 2 implementations and if either doesn't follow design rules then it can be changed- > - Made the trash icon `accent danger` > - When emails are long, given scroll for ease of convience. --------- Co-authored-by: Nitin Koche --- .../settings/SettingsWorkspaceMembers.tsx | 114 ++++++++++++------ 1 file changed, 77 insertions(+), 37 deletions(-) diff --git a/packages/twenty-front/src/pages/settings/SettingsWorkspaceMembers.tsx b/packages/twenty-front/src/pages/settings/SettingsWorkspaceMembers.tsx index 0079fb888..63bbd6717 100644 --- a/packages/twenty-front/src/pages/settings/SettingsWorkspaceMembers.tsx +++ b/packages/twenty-front/src/pages/settings/SettingsWorkspaceMembers.tsx @@ -7,8 +7,8 @@ import { IconUsers, IconReload, IconMail, - StyledText, Avatar, + MOBILE_VIEWPORT, } from 'twenty-ui'; import { isNonEmptyArray } from '@sniptt/guards'; import { useTheme } from '@emotion/react'; @@ -53,6 +53,47 @@ const StyledTable = styled(Table)` margin-top: ${({ theme }) => theme.spacing(0.5)}; `; +const StyledTableRow = styled(TableRow)` + @media (max-width: ${MOBILE_VIEWPORT}px) { + display: grid; + grid-template-columns: 3fr; + } +`; +const StyledTableCell = styled(TableCell)` + padding: ${({ theme }) => theme.spacing(1)}; + @media (max-width: ${MOBILE_VIEWPORT}px) { + &:first-child { + max-width: 100%; + padding-top: 2px; + white-space: nowrap; + overflow: scroll; + scroll-behavior: smooth; + } + } +`; +const StyledIconWrapper = styled.div` + left: 2px; + margin-right: ${({ theme }) => theme.spacing(2)}; + position: relative; + top: 1px; +`; + +const StyledScrollableTextContainer = styled.div` + max-width: 100%; + overflow-x: auto; + white-space: pre-line; +`; + +const StyledTextContainer = styled.div` + color: ${({ theme }) => theme.font.color.secondary}; + max-width: max-content; + overflow-x: auto; + position: absolute; + @media (min-width: 360px) and (max-width: 420px) { + max-width: 150px; + margin-top: ${({ theme }) => theme.spacing(1)}; + } +`; const StyledTableHeaderRow = styled(Table)` margin-bottom: ${({ theme }) => theme.spacing(1.5)}; `; @@ -165,28 +206,25 @@ export const SettingsWorkspaceMembers = () => { - - } - text={ - workspaceMember.name.firstName + + + + + + {workspaceMember.name.firstName + ' ' + - workspaceMember.name.lastName - } - /> + workspaceMember.name.lastName} + - + + {workspaceMember.userEmail} + {currentWorkspaceMember?.id !== workspaceMember.id && ( @@ -225,25 +263,27 @@ export const SettingsWorkspaceMembers = () => { {workspaceInvitations?.map((workspaceInvitation) => ( - - - - } - text={workspaceInvitation.email} - /> - - + + + + + + + {workspaceInvitation.email} + + + - - + + { @@ -266,8 +306,8 @@ export const SettingsWorkspaceMembers = () => { Icon={IconTrash} /> - - + + ))}