diff options
author | Paul Frazee <pfrazee@gmail.com> | 2022-11-04 17:39:54 -0500 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2022-11-04 17:39:54 -0500 |
commit | f333a90fab79d582bbb7f9114f0b005fdb1cae8b (patch) | |
tree | 631755be2dd6976e9d0efd90f33751c52a09ef37 /src/view/com/util/UserInfoText.tsx | |
parent | 8ae6e67eea8890f639dbaa9423e99cad5e28502f (diff) | |
download | voidsky-f333a90fab79d582bbb7f9114f0b005fdb1cae8b.tar.zst |
Update to the latest APIs
Diffstat (limited to 'src/view/com/util/UserInfoText.tsx')
-rw-r--r-- | src/view/com/util/UserInfoText.tsx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/view/com/util/UserInfoText.tsx b/src/view/com/util/UserInfoText.tsx index 536eef9e4..411891863 100644 --- a/src/view/com/util/UserInfoText.tsx +++ b/src/view/com/util/UserInfoText.tsx @@ -1,5 +1,5 @@ import React, {useState, useEffect} from 'react' -import * as AppBskyGetProfile from '../../../third-party/api/src/types/app/bsky/getProfile' +import * as GetProfile from '../../../third-party/api/src/client/types/app/bsky/actor/getProfile' import {StyleProp, Text, TextStyle} from 'react-native' import {useStores} from '../../../state' @@ -12,26 +12,26 @@ export function UserInfoText({ style, }: { did: string - attr?: keyof AppBskyGetProfile.OutputSchema + attr?: keyof GetProfile.OutputSchema loading?: string failed?: string prefix?: string style?: StyleProp<TextStyle> }) { - attr = attr || 'name' + attr = attr || 'handle' loading = loading || '...' failed = failed || 'user' const store = useStores() - const [profile, setProfile] = useState< - undefined | AppBskyGetProfile.OutputSchema - >(undefined) + const [profile, setProfile] = useState<undefined | GetProfile.OutputSchema>( + undefined, + ) const [didFail, setFailed] = useState<boolean>(false) useEffect(() => { let aborted = false // TODO use caching to reduce loads - store.api.app.bsky.getProfile({user: did}).then( + store.api.app.bsky.actor.getProfile({user: did}).then( v => { if (aborted) return setProfile(v.data) |