diff --git a/src/state/models/profile-view.ts b/src/state/models/profile-view.ts index a2919e2e..62a17a6f 100644 --- a/src/state/models/profile-view.ts +++ b/src/state/models/profile-view.ts @@ -27,6 +27,7 @@ export class ProfileViewModel { did: string = '' handle: string = '' actorType = ACTOR_TYPE_USER + creator: string = '' displayName?: string description?: string followersCount: number = 0 @@ -145,6 +146,7 @@ export class ProfileViewModel { this.did = res.data.did this.handle = res.data.handle this.actorType = res.data.actorType + this.creator = res.data.creator this.displayName = res.data.displayName this.description = res.data.description this.followersCount = res.data.followersCount diff --git a/src/view/com/profile/ProfileHeader.tsx b/src/view/com/profile/ProfileHeader.tsx index d1dcd052..61e18c2b 100644 --- a/src/view/com/profile/ProfileHeader.tsx +++ b/src/view/com/profile/ProfileHeader.tsx @@ -18,6 +18,7 @@ import {getGradient} from '../../lib/asset-gen' import Toast from '../util/Toast' import {UserAvatar} from '../util/UserAvatar' import {UserBanner} from '../util/UserBanner' +import {UserInfoText} from '../util/UserInfoText' export const ProfileHeader = observer(function ProfileHeader({ view, @@ -194,19 +195,20 @@ export const ProfileHeader = observer(function ProfileHeader({ - {view.description && ( + {view.description ? ( {view.description} - )} - { - undefined /* - - - - Employee @blueskyweb.xyz - - - */ - } + ) : undefined} + {view.isScene && view.creator ? ( + + Created by + + + ) : undefined} ) @@ -313,7 +315,7 @@ const styles = StyleSheet.create({ fontSize: 15, }, - badgesLine: { + relationshipsLine: { flexDirection: 'row', alignItems: 'center', marginBottom: 10, diff --git a/src/view/com/util/UserInfoText.tsx b/src/view/com/util/UserInfoText.tsx index 77fb5988..755e6ef4 100644 --- a/src/view/com/util/UserInfoText.tsx +++ b/src/view/com/util/UserInfoText.tsx @@ -1,6 +1,7 @@ import React, {useState, useEffect} from 'react' import * as GetProfile from '../../../third-party/api/src/client/types/app/bsky/actor/getProfile' import {StyleProp, Text, TextStyle} from 'react-native' +import {Link} from './Link' import {useStores} from '../../../state' export function UserInfoText({ @@ -10,6 +11,7 @@ export function UserInfoText({ failed, prefix, style, + asLink, }: { did: string attr?: keyof GetProfile.OutputSchema @@ -17,6 +19,7 @@ export function UserInfoText({ failed?: string prefix?: string style?: StyleProp + asLink?: boolean }) { attr = attr || 'handle' loading = loading || '...' @@ -46,9 +49,26 @@ export function UserInfoText({ } }, [did, store.api.app.bsky]) + if (asLink) { + const title = profile?.displayName || profile?.handle || 'User' + return ( + + + {didFail + ? failed + : profile + ? `${prefix || ''}${profile[attr]}` + : loading} + + + ) + } + return ( - {didFail ? failed : profile ? `${prefix}${profile[attr]}` : loading} + {didFail ? failed : profile ? `${prefix || ''}${profile[attr]}` : loading} ) } diff --git a/todos.txt b/todos.txt index 4a7e7233..f4dade89 100644 --- a/todos.txt +++ b/todos.txt @@ -9,22 +9,16 @@ Paul's todo list - * - Avatars - SVG generate -- Main menu - - Scenes list - Create scene view - * - Discover scenes view - * - User profile - - Distinguish by declared type - User - - List scenes - Invite to scene - Remove from scene - Scene - Trending - - Members - - Profile header - Invite to scene - Remove from scene - Edit profile @@ -41,6 +35,7 @@ Paul's todo list - Reposted by - Followers list - Follows list + - Members list - Bugs - Follows are broken - Auth token refresh seems broken