Dont suggest followed users and add empty state to suggestions
parent
e5cb141954
commit
75f801ed71
|
@ -91,6 +91,9 @@ export class SuggestedActorsViewModel {
|
||||||
if (item.did === this.rootStore.me.did) {
|
if (item.did === this.rootStore.me.did) {
|
||||||
continue // skip self
|
continue // skip self
|
||||||
}
|
}
|
||||||
|
if (item.myState?.follow) {
|
||||||
|
continue // skip already-followed users
|
||||||
|
}
|
||||||
this._append({
|
this._append({
|
||||||
_reactKey: `item-${counter++}`,
|
_reactKey: `item-${counter++}`,
|
||||||
...item,
|
...item,
|
||||||
|
|
|
@ -96,6 +96,13 @@ export const SuggestedFollows = observer(
|
||||||
details={view.error}
|
details={view.error}
|
||||||
onPressTryAgain={onPressTryAgain}
|
onPressTryAgain={onPressTryAgain}
|
||||||
/>
|
/>
|
||||||
|
) : view.isEmpty ? (
|
||||||
|
<View style={styles.emptyContainer}>
|
||||||
|
<Text style={[s.gray5, s.textCenter]}>
|
||||||
|
You already follow everybody we were going to suggest. Check back
|
||||||
|
in the future!
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
) : (
|
) : (
|
||||||
<View style={styles.suggestionsContainer}>
|
<View style={styles.suggestionsContainer}>
|
||||||
<FlatList
|
<FlatList
|
||||||
|
@ -186,6 +193,14 @@ const styles = StyleSheet.create({
|
||||||
backgroundColor: colors.gray1,
|
backgroundColor: colors.gray1,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
emptyContainer: {
|
||||||
|
backgroundColor: colors.gray1,
|
||||||
|
marginHorizontal: 14,
|
||||||
|
paddingHorizontal: 8,
|
||||||
|
paddingVertical: 14,
|
||||||
|
borderRadius: 6,
|
||||||
|
},
|
||||||
|
|
||||||
actor: {
|
actor: {
|
||||||
backgroundColor: colors.white,
|
backgroundColor: colors.white,
|
||||||
borderRadius: 6,
|
borderRadius: 6,
|
||||||
|
|
Loading…
Reference in New Issue