diff options
author | David Yip <yipdw@member.fsf.org> | 2018-03-18 20:17:15 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-18 20:17:15 -0500 |
commit | a387f99659e9a1dde11b6a8f6f3dd5a433b55f45 (patch) | |
tree | f3050987a16c776d144a61a07299a5fb9f2c4ace /app/javascript/flavours/glitch/components/status_list.js | |
parent | 9341b982b611ed3655489a01ba32720b84dfefdc (diff) | |
parent | 6f0e50f9a0f8decc64acc92e02faace8e29153ad (diff) |
Merge pull request #388 from ThibG/glitch-soc/federated-pinned-toots
Port WebUI toots/with reply/media tabs and pinned toots to glitch
Diffstat (limited to 'app/javascript/flavours/glitch/components/status_list.js')
-rw-r--r-- | app/javascript/flavours/glitch/components/status_list.js | 19 |
1 files changed, 16 insertions, 3 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} |