diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-10-05 16:44:05 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-05 16:44:05 -0700 |
commit | bd7db8af26bfbf94a80972671ca714a143bee28e (patch) | |
tree | cf022bddc4f6b164bea51aeb3c57479d72b73355 /src/view/com/profile/FollowButton.tsx | |
parent | 19f8389fc777c7ff41466748f1238f4e0a4b0619 (diff) | |
download | voidsky-bd7db8af26bfbf94a80972671ca714a143bee28e.tar.zst |
Improve typeahead search with inclusion of followed users (temporary solution) (#1612)
* Update follows cache to maintain some user info * Prioritize follows in composer autocomplete * Clean up logic and add new autocomplete to search * Update follow hook
Diffstat (limited to 'src/view/com/profile/FollowButton.tsx')
-rw-r--r-- | src/view/com/profile/FollowButton.tsx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/view/com/profile/FollowButton.tsx b/src/view/com/profile/FollowButton.tsx index 217d326e8..adb496f6d 100644 --- a/src/view/com/profile/FollowButton.tsx +++ b/src/view/com/profile/FollowButton.tsx @@ -1,25 +1,26 @@ import React from 'react' import {StyleProp, TextStyle, View} from 'react-native' import {observer} from 'mobx-react-lite' +import {AppBskyActorDefs} from '@atproto/api' import {Button, ButtonType} from '../util/forms/Button' import * as Toast from '../util/Toast' import {FollowState} from 'state/models/cache/my-follows' -import {useFollowDid} from 'lib/hooks/useFollowDid' +import {useFollowProfile} from 'lib/hooks/useFollowProfile' export const FollowButton = observer(function FollowButtonImpl({ unfollowedType = 'inverted', followedType = 'default', - did, + profile, onToggleFollow, labelStyle, }: { unfollowedType?: ButtonType followedType?: ButtonType - did: string + profile: AppBskyActorDefs.ProfileViewBasic onToggleFollow?: (v: boolean) => void labelStyle?: StyleProp<TextStyle> }) { - const {state, following, toggle} = useFollowDid({did}) + const {state, following, toggle} = useFollowProfile(profile) const onPress = React.useCallback(async () => { try { |