diff options
author | Thibaut Girka <thib@sitedethib.com> | 2018-03-16 20:29:42 +0100 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2018-03-16 23:16:20 +0100 |
commit | 6f0e50f9a0f8decc64acc92e02faace8e29153ad (patch) | |
tree | a46c387a411e588e55f5ed0ac6d6d57c6b582cd9 /app/javascript/flavours/glitch/components | |
parent | cd73af3bd08f070ebb88e9e1afe39bf414683496 (diff) |
[Glitch] Federate pinned statuses over ActivityPub
Port 9110db41c53a2f3f22affc23b364362133997d3e to glitch
Diffstat (limited to 'app/javascript/flavours/glitch/components')
-rw-r--r-- | app/javascript/flavours/glitch/components/status_list.js | 19 | ||||
-rw-r--r-- | app/javascript/flavours/glitch/components/status_prepend.js | 10 |
2 files changed, 23 insertions, 6 deletions
diff --git a/app/javascript/flavours/glitch/components/status_list.js b/app/javascript/flavours/glitch/components/status_list.js index f253f0fdc..ea40463da 100644 --- a/app/javascript/flavours/glitch/components/status_list.js +++ b/app/javascript/flavours/glitch/components/status_list.js @@ -11,6 +11,7 @@ export default class StatusList extends ImmutablePureComponent { static propTypes = { scrollKey: PropTypes.string.isRequired, statusIds: ImmutablePropTypes.list.isRequired, + featuredStatusIds: ImmutablePropTypes.list, onScrollToBottom: PropTypes.func, onScrollToTop: PropTypes.func, onScroll: PropTypes.func, @@ -50,7 +51,7 @@ export default class StatusList extends ImmutablePureComponent { } render () { - const { statusIds, ...other } = this.props; + const { statusIds, featuredStatusIds, ...other } = this.props; const { isLoading, isPartial } = other; if (isPartial) { @@ -68,8 +69,8 @@ export default class StatusList extends ImmutablePureComponent { ); } - const scrollableContent = (isLoading || statusIds.size > 0) ? ( - statusIds.map((statusId) => ( + let scrollableContent = (isLoading || statusIds.size > 0) ? ( + statusIds.map(statusId => ( <StatusContainer key={statusId} id={statusId} @@ -79,6 +80,18 @@ export default class StatusList extends ImmutablePureComponent { )) ) : null; + if (scrollableContent && featuredStatusIds) { + scrollableContent = featuredStatusIds.map(statusId => ( + <StatusContainer + key={`f-${statusId}`} + id={statusId} + featured + onMoveUp={this.handleMoveUp} + onMoveDown={this.handleMoveDown} + /> + )).concat(scrollableContent); + } + return ( <ScrollableList {...other} ref={this.setRef}> {scrollableContent} diff --git a/app/javascript/flavours/glitch/components/status_prepend.js b/app/javascript/flavours/glitch/components/status_prepend.js index bd2559e46..f4ef83135 100644 --- a/app/javascript/flavours/glitch/components/status_prepend.js +++ b/app/javascript/flavours/glitch/components/status_prepend.js @@ -34,6 +34,10 @@ export default class StatusPrepend extends React.PureComponent { </a> ); switch (type) { + case 'featured': + return ( + <FormattedMessage id='status.pinned' defaultMessage='Pinned toot' /> + ); case 'reblogged_by': return ( <FormattedMessage @@ -67,11 +71,11 @@ export default class StatusPrepend extends React.PureComponent { const { type } = this.props; return !type ? null : ( - <aside className={type === 'reblogged_by' ? 'status__prepend' : 'notification__message'}> - <div className={type === 'reblogged_by' ? 'status__prepend-icon-wrapper' : 'notification__favourite-icon-wrapper'}> + <aside className={type === 'reblogged_by' || type === 'featured' ? 'status__prepend' : 'notification__message'}> + <div className={type === 'reblogged_by' || type === 'featured' ? 'status__prepend-icon-wrapper' : 'notification__favourite-icon-wrapper'}> <i className={`fa fa-fw fa-${ - type === 'favourite' ? 'star star-icon' : 'retweet' + type === 'favourite' ? 'star star-icon' : (type === 'featured' ? 'thumb-tack' : 'retweet') } status__prepend-icon`} /> </div> |