From ecf56729b0da535f1d0b794268c7856836e76bd6 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Wed, 9 Nov 2022 17:34:55 -0600 Subject: [PATCH] More informative empty state for scenes --- src/state/models/profile-ui.ts | 6 +++++- src/view/screens/Profile.tsx | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/src/state/models/profile-ui.ts b/src/state/models/profile-ui.ts index a9062bf9..0a70525f 100644 --- a/src/state/models/profile-ui.ts +++ b/src/state/models/profile-ui.ts @@ -139,7 +139,11 @@ export class ProfileUiModel { } async loadMore() { - if (!this.currentView.isLoading && !this.currentView.hasError) { + if ( + !this.currentView.isLoading && + !this.currentView.hasError && + !this.currentView.isEmpty + ) { await this.currentView.loadMore() } } diff --git a/src/view/screens/Profile.tsx b/src/view/screens/Profile.tsx index fce77aac..df14f3c5 100644 --- a/src/view/screens/Profile.tsx +++ b/src/view/screens/Profile.tsx @@ -11,6 +11,7 @@ import {ProfileCard} from '../com/profile/ProfileCard' import {ErrorScreen} from '../com/util/ErrorScreen' import {ErrorMessage} from '../com/util/ErrorMessage' import {s, colors} from '../lib/styles' +import {UserGroupIcon} from '../lib/icons' const LOADING_ITEM = {_reactKey: '__loading__'} const END_ITEM = {_reactKey: '__end__'} @@ -111,7 +112,28 @@ export const Profile = observer(({visible, params}: ScreenParams) => { } } else if (uiState.feed.isEmpty) { items.push(EMPTY_ITEM) - renderItem = () => No posts yet! + if (uiState.profile.isScene) { + renderItem = () => ( + + + + + + As members upvote posts, they will trend here. Follow the + scene to see its trending posts in your timeline. + + + ) + } else { + renderItem = () => No posts yet! + } } } else if (uiState.selectedView === Sections.Scenes) { if (uiState.memberships.hasContent) { @@ -197,4 +219,14 @@ const styles = StyleSheet.create({ color: colors.gray5, textAlign: 'center', }, + emptyContainer: { + paddingVertical: 20, + paddingHorizontal: 36, + }, + emptyText: { + textAlign: 'center', + color: colors.gray5, + paddingTop: 16, + fontSize: 16, + }, })