From 08f97a133eb26c38ccbb200ed4b979246a940818 Mon Sep 17 00:00:00 2001 From: Chewbacca Date: Mon, 13 Mar 2023 13:23:40 -0400 Subject: [PATCH] Update blankslate for Group Timeline --- app/soapbox/features/group/group-timeline.tsx | 31 ++++++++++++++++--- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/app/soapbox/features/group/group-timeline.tsx b/app/soapbox/features/group/group-timeline.tsx index f80343c1e..f549d5605 100644 --- a/app/soapbox/features/group/group-timeline.tsx +++ b/app/soapbox/features/group/group-timeline.tsx @@ -5,9 +5,9 @@ import { Link } from 'react-router-dom'; import { groupCompose } from 'soapbox/actions/compose'; import { connectGroupStream } from 'soapbox/actions/streaming'; import { expandGroupTimeline } from 'soapbox/actions/timelines'; -import { Avatar, HStack, Stack } from 'soapbox/components/ui'; +import { Avatar, HStack, Icon, Stack, Text } from 'soapbox/components/ui'; import ComposeForm from 'soapbox/features/compose/components/compose-form'; -import { useAppDispatch, useAppSelector, useOwnAccount } from 'soapbox/hooks'; +import { useAppDispatch, useGroup, useOwnAccount } from 'soapbox/hooks'; import Timeline from '../ui/components/timeline'; @@ -23,7 +23,9 @@ const GroupTimeline: React.FC = (props) => { const groupId = props.params.id; - const relationship = useAppSelector((state) => state.group_relationships.get(groupId)); + const { group } = useGroup(groupId); + + const canComposeGroupStatus = !!account && group?.relationship?.member; const handleLoadMore = (maxId: string) => { dispatch(expandGroupTimeline(groupId, { maxId })); @@ -41,9 +43,13 @@ const GroupTimeline: React.FC = (props) => { }; }, [groupId]); + if (!group) { + return null; + } + return ( - {!!account && relationship?.member && ( + {canComposeGroupStatus && (
@@ -59,11 +65,26 @@ const GroupTimeline: React.FC = (props) => {
)} + } + emptyMessage={ + +
+ +
+ + + + +
+ } + emptyMessageCard={false} divideType='border' showGroup={false} />