From c4ca0b9d4d90b49234e0a4951759fc1f08b53527 Mon Sep 17 00:00:00 2001 From: 2458773093 <2458773093@protonmail.com> Date: Fri, 26 Jul 2019 21:28:26 +0300 Subject: [PATCH] pass group down from group timeline and hide group section of status component --- app/javascript/gabsocial/components/status.js | 5 +++-- app/javascript/gabsocial/components/status_list.js | 4 +++- app/javascript/gabsocial/features/groups/timeline/index.js | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/javascript/gabsocial/components/status.js b/app/javascript/gabsocial/components/status.js index 1f44751d..61a5a06c 100644 --- a/app/javascript/gabsocial/components/status.js +++ b/app/javascript/gabsocial/components/status.js @@ -88,6 +88,7 @@ class Status extends ImmutablePureComponent { updateScrollBottom: PropTypes.func, cacheMediaWidth: PropTypes.func, cachedMediaWidth: PropTypes.number, + group: ImmutablePropTypes.map, }; // Avoid checking props that are functions (and whose equality will always @@ -257,7 +258,7 @@ class Status extends ImmutablePureComponent { let media = null; let statusAvatar, prepend, rebloggedByText, reblogContent; - const { intl, hidden, featured, otherAccounts, unread, showThread } = this.props; + const { intl, hidden, featured, otherAccounts, unread, showThread, group } = this.props; let { status, account, ...other } = this.props; @@ -426,7 +427,7 @@ class Status extends ImmutablePureComponent { - {status.get('group') && ( + {!group && status.get('group') && (
Posted in {status.getIn(['group', 'title'])}
diff --git a/app/javascript/gabsocial/components/status_list.js b/app/javascript/gabsocial/components/status_list.js index dad1889b..b1ed75d6 100644 --- a/app/javascript/gabsocial/components/status_list.js +++ b/app/javascript/gabsocial/components/status_list.js @@ -25,6 +25,7 @@ export default class StatusList extends ImmutablePureComponent { timelineId: PropTypes.string, queuedItemSize: PropTypes.number, onDequeueTimeline: PropTypes.func, + group: ImmutablePropTypes.map, withGroupAdmin: PropTypes.bool, onScrollToTop: PropTypes.func, onScroll: PropTypes.func, @@ -85,7 +86,7 @@ export default class StatusList extends ImmutablePureComponent { } render () { - const { statusIds, featuredStatusIds, onLoadMore, timelineId, totalQueuedItemsCount, isLoading, isPartial, withGroupAdmin, ...other } = this.props; + const { statusIds, featuredStatusIds, onLoadMore, timelineId, totalQueuedItemsCount, isLoading, isPartial, withGroupAdmin, group, ...other } = this.props; if (isPartial) { return ( @@ -115,6 +116,7 @@ export default class StatusList extends ImmutablePureComponent { onMoveUp={this.handleMoveUp} onMoveDown={this.handleMoveDown} contextType={timelineId} + group={group} withGroupAdmin={withGroupAdmin} showThread /> diff --git a/app/javascript/gabsocial/features/groups/timeline/index.js b/app/javascript/gabsocial/features/groups/timeline/index.js index adfbdac7..0dc648fe 100644 --- a/app/javascript/gabsocial/features/groups/timeline/index.js +++ b/app/javascript/gabsocial/features/groups/timeline/index.js @@ -94,6 +94,7 @@ class GroupTimeline extends React.PureComponent { scrollKey={`group_timeline-${columnId}`} timelineId={`group:${id}`} onLoadMore={this.handleLoadMore} + group={group} withGroupAdmin={relationships && relationships.get('admin')} emptyMessage={} />