RemoteTimeline: only display filter message if the host isn't pinned
This commit is contained in:
parent
4e2f12eb18
commit
d2a4f433e2
1 changed files with 5 additions and 3 deletions
|
@ -27,6 +27,7 @@ const mapStateToProps = (state, props) => {
|
||||||
onlyMedia,
|
onlyMedia,
|
||||||
hasUnread: state.getIn(['timelines', `${timelineId}${onlyMedia ? ':media' : ''}:${instance}`, 'unread']) > 0,
|
hasUnread: state.getIn(['timelines', `${timelineId}${onlyMedia ? ':media' : ''}:${instance}`, 'unread']) > 0,
|
||||||
instance,
|
instance,
|
||||||
|
pinned: settings.getIn(['remote_timeline', 'pinnedHosts']).includes(instance),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -45,6 +46,7 @@ class RemoteTimeline extends React.PureComponent {
|
||||||
onlyMedia: PropTypes.bool,
|
onlyMedia: PropTypes.bool,
|
||||||
timelineId: PropTypes.string,
|
timelineId: PropTypes.string,
|
||||||
instance: PropTypes.string.isRequired,
|
instance: PropTypes.string.isRequired,
|
||||||
|
pinned: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
@ -80,20 +82,20 @@ class RemoteTimeline extends React.PureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { intl, hasUnread, onlyMedia, timelineId, instance } = this.props;
|
const { intl, hasUnread, onlyMedia, timelineId, instance, pinned } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Column label={intl.formatMessage(messages.title)}>
|
<Column label={intl.formatMessage(messages.title)}>
|
||||||
<HomeColumnHeader activeItem='fediverse' active={hasUnread} />
|
<HomeColumnHeader activeItem='fediverse' active={hasUnread} />
|
||||||
<PinnedHostsPicker host={instance} />
|
<PinnedHostsPicker host={instance} />
|
||||||
<div className='timeline-filter-message'>
|
{!pinned && <div className='timeline-filter-message'>
|
||||||
<IconButton icon='close' onClick={this.handleCloseClick} />
|
<IconButton icon='close' onClick={this.handleCloseClick} />
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='remote_timeline.filter_message'
|
id='remote_timeline.filter_message'
|
||||||
defaultMessage='You are viewing the timeline of {instance}.'
|
defaultMessage='You are viewing the timeline of {instance}.'
|
||||||
values={{ instance }}
|
values={{ instance }}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>}
|
||||||
<StatusListContainer
|
<StatusListContainer
|
||||||
scrollKey={`${timelineId}_${instance}_timeline`}
|
scrollKey={`${timelineId}_${instance}_timeline`}
|
||||||
timelineId={`${timelineId}${onlyMedia ? ':media' : ''}:${instance}`}
|
timelineId={`${timelineId}${onlyMedia ? ':media' : ''}:${instance}`}
|
||||||
|
|
Loading…
Reference in a new issue