Profile redesign: Pinned posts (#37761)
Co-authored-by: diondiondion <mail@diondiondion.com>
This commit is contained in:
1 parent
1310628a60
commit
2e30044a37
13 files changed
+340
-40
No files matched your search
@@ -5,9 +5,10 @@ import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||
|
||||
import { debounce } from 'lodash';
|
||||
|
||||
import { TIMELINE_GAP, TIMELINE_SUGGESTIONS } from 'mastodon/actions/timelines';
|
||||
import { TIMELINE_GAP, TIMELINE_PINNED_VIEW_ALL, TIMELINE_SUGGESTIONS } from 'mastodon/actions/timelines';
|
||||
import { RegenerationIndicator } from 'mastodon/components/regeneration_indicator';
|
||||
import { InlineFollowSuggestions } from 'mastodon/features/home_timeline/components/inline_follow_suggestions';
|
||||
import { PinnedShowAllButton } from '@/mastodon/features/account_timeline/v2/pinned_statuses';
|
||||
|
||||
import { StatusQuoteManager } from '../components/status_quoted';
|
||||
|
||||
@@ -35,6 +36,7 @@ export default class StatusList extends ImmutablePureComponent {
|
||||
timelineId: PropTypes.string,
|
||||
lastId: PropTypes.string,
|
||||
bindToDocument: PropTypes.bool,
|
||||
statusProps: PropTypes.object,
|
||||
};
|
||||
|
||||
static defaultProps = {
|
||||
@@ -51,7 +53,7 @@ export default class StatusList extends ImmutablePureComponent {
|
||||
};
|
||||
|
||||
render () {
|
||||
const { statusIds, featuredStatusIds, onLoadMore, timelineId, ...other } = this.props;
|
||||
const { statusIds, featuredStatusIds, onLoadMore, timelineId, statusProps, ...other } = this.props;
|
||||
const { isLoading, isPartial } = other;
|
||||
|
||||
if (isPartial) {
|
||||
@@ -83,6 +85,7 @@ export default class StatusList extends ImmutablePureComponent {
|
||||
scrollKey={this.props.scrollKey}
|
||||
showThread
|
||||
withCounters={this.props.withCounters}
|
||||
{...statusProps}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -90,16 +93,21 @@ export default class StatusList extends ImmutablePureComponent {
|
||||
) : null;
|
||||
|
||||
if (scrollableContent && featuredStatusIds) {
|
||||
scrollableContent = featuredStatusIds.map(statusId => (
|
||||
<StatusQuoteManager
|
||||
key={`f-${statusId}`}
|
||||
id={statusId}
|
||||
featured
|
||||
contextType={timelineId}
|
||||
showThread
|
||||
withCounters={this.props.withCounters}
|
||||
/>
|
||||
)).concat(scrollableContent);
|
||||
scrollableContent = featuredStatusIds.map(statusId => {
|
||||
if (statusId === TIMELINE_PINNED_VIEW_ALL) {
|
||||
return <PinnedShowAllButton key={TIMELINE_PINNED_VIEW_ALL} />
|
||||
}
|
||||
return (
|
||||
<StatusQuoteManager
|
||||
key={`f-${statusId}`}
|
||||
id={statusId}
|
||||
featured
|
||||
contextType={timelineId}
|
||||
showThread
|
||||
withCounters={this.props.withCounters}
|
||||
{...statusProps} />
|
||||
);
|
||||
}).concat(scrollableContent);
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
Reference in new issue
Block a user