diff --git a/app/soapbox/components/scrollable-list.tsx b/app/soapbox/components/scrollable-list.tsx index a56c294b3..78fb7f036 100644 --- a/app/soapbox/components/scrollable-list.tsx +++ b/app/soapbox/components/scrollable-list.tsx @@ -52,6 +52,8 @@ interface IScrollableList extends VirtuosoProps { alwaysPrepend?: boolean /** Message to display when the list is loaded but empty. */ emptyMessage?: React.ReactNode + /** Should the empty message be displayed in a Card */ + emptyMessageCard?: boolean /** Scrollable content. */ children: Iterable /** Callback when the list is scrolled to the top. */ @@ -87,6 +89,7 @@ const ScrollableList = React.forwardRef(({ children, isLoading, emptyMessage, + emptyMessageCard = true, showLoading, onRefresh, onScroll, @@ -158,13 +161,17 @@ const ScrollableList = React.forwardRef(({
{alwaysPrepend && prepend} - - {isLoading ? ( - - ) : ( - emptyMessage - )} - + {isLoading ? ( + + ) : ( + <> + {emptyMessageCard ? ( + + {emptyMessage} + + ) : emptyMessage} + + )}
); }; diff --git a/app/soapbox/features/groups/index.tsx b/app/soapbox/features/groups/index.tsx index cdebabf6c..77b72552a 100644 --- a/app/soapbox/features/groups/index.tsx +++ b/app/soapbox/features/groups/index.tsx @@ -15,26 +15,6 @@ import TabBar, { TabItems } from './components/tab-bar'; import type { Group as GroupEntity } from 'soapbox/types/entities'; -const EmptyMessage = () => ( - - - - - - - - - - - -); - const Groups: React.FC = () => { const dispatch = useAppDispatch(); const features = useFeatures(); @@ -47,6 +27,37 @@ const Groups: React.FC = () => { dispatch(openModal('MANAGE_GROUP')); }; + const renderBlankslate = () => ( + + + + + + + + + + + + {canCreateGroup && ( + + )} + + ); + + return ( {canCreateGroup && ( @@ -67,7 +78,8 @@ const Groups: React.FC = () => { } + emptyMessage={renderBlankslate()} + emptyMessageCard={false} itemClassName='py-3 first:pt-0 last:pb-0' isLoading={isLoading} showLoading={isLoading && groups.length === 0}