From c8ff9db879ca4c39afd60f139422bd13ff1450a2 Mon Sep 17 00:00:00 2001 From: Chewbacca Date: Tue, 23 May 2023 12:32:55 -0400 Subject: [PATCH] Truncate group name in panels --- .../groups/components/discover/group-list-item.tsx | 5 +++-- .../placeholder/components/placeholder-group-search.tsx | 8 +++++--- .../features/ui/components/panels/my-groups-panel.tsx | 2 +- .../ui/components/panels/suggested-groups-panel.tsx | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/app/soapbox/features/groups/components/discover/group-list-item.tsx b/app/soapbox/features/groups/components/discover/group-list-item.tsx index fc2aedcf5..6331d9d05 100644 --- a/app/soapbox/features/groups/components/discover/group-list-item.tsx +++ b/app/soapbox/features/groups/components/discover/group-list-item.tsx @@ -22,17 +22,18 @@ const GroupListItem = (props: IGroup) => { justifyContent='between' data-testid='group-list-item' > - + - + diff --git a/app/soapbox/features/placeholder/components/placeholder-group-search.tsx b/app/soapbox/features/placeholder/components/placeholder-group-search.tsx index b2e2dc6f8..3b3bd3870 100644 --- a/app/soapbox/features/placeholder/components/placeholder-group-search.tsx +++ b/app/soapbox/features/placeholder/components/placeholder-group-search.tsx @@ -4,7 +4,7 @@ import { HStack, Stack, Text } from 'soapbox/components/ui'; import { generateText, randomIntFromInterval } from '../utils'; -export default () => { +export default ({ withJoinAction = true }: { withJoinAction?: boolean }) => { const groupNameLength = randomIntFromInterval(12, 20); return ( @@ -13,7 +13,7 @@ export default () => { justifyContent='between' className='animate-pulse' > - + {/* Group Avatar */}
@@ -37,7 +37,9 @@ export default () => { {/* Join Group Button */} -
+ {withJoinAction && ( +
+ )} ); }; diff --git a/app/soapbox/features/ui/components/panels/my-groups-panel.tsx b/app/soapbox/features/ui/components/panels/my-groups-panel.tsx index c732f5ae7..d9a95a314 100644 --- a/app/soapbox/features/ui/components/panels/my-groups-panel.tsx +++ b/app/soapbox/features/ui/components/panels/my-groups-panel.tsx @@ -19,7 +19,7 @@ const MyGroupsPanel = () => { > {isFetching ? ( new Array(3).fill(0).map((_, idx) => ( - + )) ) : ( groups.slice(0, 3).map((group) => ( diff --git a/app/soapbox/features/ui/components/panels/suggested-groups-panel.tsx b/app/soapbox/features/ui/components/panels/suggested-groups-panel.tsx index 5ef131047..d2671bc14 100644 --- a/app/soapbox/features/ui/components/panels/suggested-groups-panel.tsx +++ b/app/soapbox/features/ui/components/panels/suggested-groups-panel.tsx @@ -19,7 +19,7 @@ const SuggestedGroupsPanel = () => { > {isFetching ? ( new Array(3).fill(0).map((_, idx) => ( - + )) ) : ( groups.slice(0, 3).map((group) => (