From 82c5244589d35bc6e8d632cfad11c47a5f4d516e Mon Sep 17 00:00:00 2001 From: Avinash Lingaloo Date: Fri, 20 Jan 2023 21:17:01 +0400 Subject: [PATCH] MM-44652 - Fix long team name (#6943) * fix long team name * minor code refactor * adds a comment to explain the 85% * update snapshots --- .../__snapshots__/index.test.tsx.snap | 112 +++++++++------- .../header/__snapshots__/header.test.tsx.snap | 112 +++++++++------- .../categories_list/header/header.tsx | 122 ++++++++++-------- 3 files changed, 200 insertions(+), 146 deletions(-) diff --git a/app/screens/home/channel_list/categories_list/__snapshots__/index.test.tsx.snap b/app/screens/home/channel_list/categories_list/__snapshots__/index.test.tsx.snap index f9a4925f82..5cbb06c9f7 100644 --- a/app/screens/home/channel_list/categories_list/__snapshots__/index.test.tsx.snap +++ b/app/screens/home/channel_list/categories_list/__snapshots__/index.test.tsx.snap @@ -39,44 +39,87 @@ exports[`components/categories_list should render channels error 1`] = ` - - Test Team! - + + + Test Team! + + + + + + - - - - - Test! - + + + Test! + + + + + + - - - `; diff --git a/app/screens/home/channel_list/categories_list/header/header.tsx b/app/screens/home/channel_list/categories_list/header/header.tsx index ea94719e49..0d66b56f48 100644 --- a/app/screens/home/channel_list/categories_list/header/header.tsx +++ b/app/screens/home/channel_list/categories_list/header/header.tsx @@ -26,6 +26,8 @@ import LoadingUnreads from './loading_unreads'; import PlusMenu from './plus_menu'; import {SEPARATOR_HEIGHT} from './plus_menu/separator'; +const PLUS_BUTTON_SIZE = 28; + type Props = { canCreateChannels: boolean; canJoinChannels: boolean; @@ -60,9 +62,10 @@ const getStyles = makeStyleSheetFromTheme((theme: Theme) => ({ }, plusButton: { backgroundColor: changeOpacity(theme.sidebarText, 0.08), - height: 28, - width: 28, - borderRadius: 14, + height: PLUS_BUTTON_SIZE, + width: PLUS_BUTTON_SIZE, + borderRadius: PLUS_BUTTON_SIZE / 2, + marginTop: PLUS_BUTTON_SIZE / 4, justifyContent: 'center', alignItems: 'center', }, @@ -88,6 +91,13 @@ const getStyles = makeStyleSheetFromTheme((theme: Theme) => ({ justifyContent: 'space-between', height: 40, }, + outsideBox: { + flexDirection: 'row', + justifyContent: 'space-between', + }, + firstBox: { + width: '85%', // ratio derived from the design + }, })); const hitSlop: Insets = {top: 10, bottom: 30, left: 20, right: 20}; @@ -171,59 +181,63 @@ const ChannelListHeader = ({ let header; if (displayName) { header = ( - <> - - - - - {displayName} - - - - - - - - - - {serverDisplayName} - - {(pushProxyStatus !== PUSH_PROXY_STATUS_VERIFIED) && ( - + + + - - - )} - + + + {displayName} + + + + + + + {serverDisplayName} + + {(pushProxyStatus !== PUSH_PROXY_STATUS_VERIFIED) && ( + + + + )} + + - + + + + ); } else { header = (