From 681a8d2dca321b6b4d993cce23398f6afbf0bcdf Mon Sep 17 00:00:00 2001 From: Getabalew Date: Tue, 23 Apr 2024 22:36:59 +0300 Subject: [PATCH] fix workspace name truncation issue --- src/pages/workspace/WorkspacesListRow.tsx | 124 ++++++++++++---------- 1 file changed, 65 insertions(+), 59 deletions(-) diff --git a/src/pages/workspace/WorkspacesListRow.tsx b/src/pages/workspace/WorkspacesListRow.tsx index 6accf9e0202d..eecd63adf181 100644 --- a/src/pages/workspace/WorkspacesListRow.tsx +++ b/src/pages/workspace/WorkspacesListRow.tsx @@ -137,24 +137,72 @@ function WorkspacesListRow({ const isDeleted = style && Array.isArray(style) ? style.includes(styles.offlineFeedback.deleted) : false; + const ThreeDotMenuOrPendingIcon = ( + + {isJoinRequestPending && ( + + + + )} + {!isJoinRequestPending && ( + <> + + + + + { + if (isSmallScreenWidth) { + return; + } + threeDotsMenuContainerRef.current?.measureInWindow((x, y, width, height) => { + setThreeDotsMenuPosition({ + horizontal: x + width, + vertical: y + height, + }); + }); + }} + menuItems={menuItems} + anchorPosition={threeDotsMenuPosition} + anchorAlignment={{horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.RIGHT, vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.TOP}} + shouldOverlay + disabled={shouldDisableThreeDotsMenu} + /> + + + )} + + ); + return ( - - - - {title} - + + + + + {title} + + + {isSmallScreenWidth && ThreeDotMenuOrPendingIcon} {!!ownerDetails && ( @@ -204,50 +252,8 @@ function WorkspacesListRow({ - - {isJoinRequestPending && ( - - - - )} - {!isJoinRequestPending && ( - <> - - - - - { - if (isSmallScreenWidth) { - return; - } - threeDotsMenuContainerRef.current?.measureInWindow((x, y, width, height) => { - setThreeDotsMenuPosition({ - horizontal: x + width, - vertical: y + height, - }); - }); - }} - menuItems={menuItems} - anchorPosition={threeDotsMenuPosition} - anchorAlignment={{horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.RIGHT, vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.TOP}} - shouldOverlay - disabled={shouldDisableThreeDotsMenu} - /> - - - )} - + + {!isSmallScreenWidth && ThreeDotMenuOrPendingIcon} ); }