diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-03-21 19:18:15 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-21 19:18:15 -0500 |
commit | 4f814207bcff3eb441e8bc196d274fc6adef5405 (patch) | |
tree | 485b4093d115581a81643fee76c220993e105688 /src/view/com/discover/WhoToFollow.tsx | |
parent | f20fb92dc324d1b2b908eabd41899edbe959d5d5 (diff) | |
download | voidsky-4f814207bcff3eb441e8bc196d274fc6adef5405.tar.zst |
Merge the suggested actors model with the general suggestion system (#343)
Diffstat (limited to 'src/view/com/discover/WhoToFollow.tsx')
-rw-r--r-- | src/view/com/discover/WhoToFollow.tsx | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/src/view/com/discover/WhoToFollow.tsx b/src/view/com/discover/WhoToFollow.tsx deleted file mode 100644 index 715fadae2..000000000 --- a/src/view/com/discover/WhoToFollow.tsx +++ /dev/null @@ -1,66 +0,0 @@ -import React from 'react' -import {ActivityIndicator, StyleSheet, View} from 'react-native' -import {observer} from 'mobx-react-lite' -import {useStores} from 'state/index' -import {SuggestedActorsViewModel} from 'state/models/suggested-actors-view' -import {ProfileCardWithFollowBtn} from '../profile/ProfileCard' -import {Text} from '../util/text/Text' -import {s} from 'lib/styles' -import {usePalette} from 'lib/hooks/usePalette' - -export const WhoToFollow = observer(() => { - const pal = usePalette('default') - const store = useStores() - const suggestedActorsView = React.useMemo<SuggestedActorsViewModel>( - () => new SuggestedActorsViewModel(store, {pageSize: 15}), - [store], - ) - - React.useEffect(() => { - suggestedActorsView.loadMore(true) - }, [store, suggestedActorsView]) - - return ( - <> - {(suggestedActorsView.hasContent || suggestedActorsView.isLoading) && ( - <Text type="title" style={[styles.heading, pal.text]}> - Who to follow - </Text> - )} - {suggestedActorsView.hasContent && ( - <> - <View style={[pal.border, styles.bottomBorder]}> - {suggestedActorsView.suggestions.map(item => ( - <ProfileCardWithFollowBtn - key={item.did} - did={item.did} - declarationCid={item.declaration.cid} - handle={item.handle} - displayName={item.displayName} - avatar={item.avatar} - description={item.description} - /> - ))} - </View> - </> - )} - {suggestedActorsView.isLoading && ( - <View style={s.mt10}> - <ActivityIndicator /> - </View> - )} - </> - ) -}) - -const styles = StyleSheet.create({ - heading: { - fontWeight: 'bold', - paddingHorizontal: 12, - paddingBottom: 8, - }, - - bottomBorder: { - borderBottomWidth: 1, - }, -}) |