Add 'posts & replies' view to profiles
parent
d608d67bfe
commit
eaa2105570
|
@ -196,6 +196,10 @@ export class FeedModel {
|
|||
return this.hasLoaded && !this.hasContent
|
||||
}
|
||||
|
||||
get nonReplyFeed() {
|
||||
return this.feed.filter(post => !post.record.reply)
|
||||
}
|
||||
|
||||
setHasNewLatest(v: boolean) {
|
||||
this.hasNewLatest = v
|
||||
}
|
||||
|
|
|
@ -7,12 +7,17 @@ import {FeedModel} from './feed-view'
|
|||
|
||||
export enum Sections {
|
||||
Posts = 'Posts',
|
||||
PostsWithReplies = 'Posts & replies',
|
||||
Scenes = 'Scenes',
|
||||
Trending = 'Trending',
|
||||
Members = 'Members',
|
||||
}
|
||||
|
||||
const USER_SELECTOR_ITEMS = [Sections.Posts, Sections.Scenes]
|
||||
const USER_SELECTOR_ITEMS = [
|
||||
Sections.Posts,
|
||||
Sections.PostsWithReplies,
|
||||
Sections.Scenes,
|
||||
]
|
||||
const SCENE_SELECTOR_ITEMS = [Sections.Trending, Sections.Members]
|
||||
|
||||
export interface ProfileUiParams {
|
||||
|
@ -53,6 +58,7 @@ export class ProfileUiModel {
|
|||
get currentView(): FeedModel | MembershipsViewModel | MembersViewModel {
|
||||
if (
|
||||
this.selectedView === Sections.Posts ||
|
||||
this.selectedView === Sections.PostsWithReplies ||
|
||||
this.selectedView === Sections.Trending
|
||||
) {
|
||||
return this.feed
|
||||
|
|
|
@ -121,10 +121,15 @@ export const Profile = observer(({navIdx, visible, params}: ScreenParams) => {
|
|||
} else {
|
||||
if (
|
||||
uiState.selectedView === Sections.Posts ||
|
||||
uiState.selectedView === Sections.PostsWithReplies ||
|
||||
uiState.selectedView === Sections.Trending
|
||||
) {
|
||||
if (uiState.feed.hasContent) {
|
||||
items = uiState.feed.feed.slice()
|
||||
if (uiState.selectedView === Sections.Posts) {
|
||||
items = uiState.feed.nonReplyFeed
|
||||
} else {
|
||||
items = uiState.feed.feed.slice()
|
||||
}
|
||||
if (!uiState.feed.hasMore) {
|
||||
items.push(END_ITEM)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue