diff options
Diffstat (limited to 'src/view')
23 files changed, 120 insertions, 120 deletions
diff --git a/src/view/com/composer/Autocomplete.tsx b/src/view/com/composer/Autocomplete.tsx index 4e4bdfc8e..7f93bede7 100644 --- a/src/view/com/composer/Autocomplete.tsx +++ b/src/view/com/composer/Autocomplete.tsx @@ -11,7 +11,7 @@ import Animated, { withTiming, interpolate, } from 'react-native-reanimated' -import {colors} from '../../../lib/styles' +import {colors} from '../../lib/styles' export function Autocomplete({ active, diff --git a/src/view/com/composer/ComposePost.tsx b/src/view/com/composer/ComposePost.tsx index 496b49a9b..9d2d6ed14 100644 --- a/src/view/com/composer/ComposePost.tsx +++ b/src/view/com/composer/ComposePost.tsx @@ -2,7 +2,7 @@ import React, {useEffect, useMemo, useState} from 'react' import {StyleSheet, Text, TextInput, TouchableOpacity, View} from 'react-native' import LinearGradient from 'react-native-linear-gradient' import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' -import * as GetUserFollows from '../../../third-party/api/src/types/app/bsky/getUserFollows' +import * as GetFollows from '../../../third-party/api/src/client/types/app/bsky/graph/getFollows' import {Autocomplete} from './Autocomplete' import Toast from '../util/Toast' import ProgressCircle from '../util/ProgressCircle' @@ -28,14 +28,14 @@ export function ComposePost({ const [error, setError] = useState('') const [text, setText] = useState('') const [followedUsers, setFollowedUsers] = useState< - undefined | GetUserFollows.OutputSchema['follows'] + undefined | GetFollows.OutputSchema['follows'] >(undefined) const [autocompleteOptions, setAutocompleteOptions] = useState<string[]>([]) useEffect(() => { let aborted = false - store.api.app.bsky - .getUserFollows({ + store.api.app.bsky.graph + .getFollows({ user: store.me.did || '', }) .then(res => { @@ -58,8 +58,8 @@ export function ComposePost({ setAutocompleteOptions( [prefix].concat( followedUsers - .filter(user => user.name.startsWith(prefix)) - .map(user => user.name), + .filter(user => user.handle.startsWith(prefix)) + .map(user => user.handle), ), ) } else if (autocompleteOptions) { diff --git a/src/view/com/modals/EditProfile.tsx b/src/view/com/modals/EditProfile.tsx index 13a8a304d..ab4d7f563 100644 --- a/src/view/com/modals/EditProfile.tsx +++ b/src/view/com/modals/EditProfile.tsx @@ -6,7 +6,7 @@ import {ErrorMessage} from '../util/ErrorMessage' import {useStores} from '../../../state' import {ProfileViewModel} from '../../../state/models/profile-view' import {s, colors, gradients} from '../../lib/styles' -import * as Profile from '../../../third-party/api/src/types/app/bsky/profile' +import * as Profile from '../../../third-party/api/src/client/types/app/bsky/actor/profile' export const snapPoints = ['80%'] diff --git a/src/view/com/notifications/FeedItem.tsx b/src/view/com/notifications/FeedItem.tsx index 8d53e921b..8ac661a25 100644 --- a/src/view/com/notifications/FeedItem.tsx +++ b/src/view/com/notifications/FeedItem.tsx @@ -23,7 +23,7 @@ export const FeedItem = observer(function FeedItem({ const urip = new AtUri(item.subjectUri) return `/profile/${urip.host}/post/${urip.rkey}` } else if (item.isFollow) { - return `/profile/${item.author.name}` + return `/profile/${item.author.handle}` } else if (item.isReply) { const urip = new AtUri(item.uri) return `/profile/${urip.host}/post/${urip.rkey}` @@ -34,7 +34,7 @@ export const FeedItem = observer(function FeedItem({ if (item.isLike || item.isRepost) { return 'Post' } else if (item.isFollow) { - return item.author.name + return item.author.handle } else if (item.isReply) { return 'Post' } @@ -76,18 +76,18 @@ export const FeedItem = observer(function FeedItem({ return <></> } - let authors: {href: string; name: string; displayName?: string}[] = [ + let authors: {href: string; handle: string; displayName?: string}[] = [ { - href: `/profile/${item.author.name}`, - name: item.author.name, + href: `/profile/${item.author.handle}`, + handle: item.author.handle, displayName: item.author.displayName, }, ] if (item.additional?.length) { authors = authors.concat( item.additional.map(item2 => ({ - href: `/profile/${item2.author.name}`, - name: item2.author.name, + href: `/profile/${item2.author.handle}`, + handle: item2.author.handle, displayName: item2.author.displayName, })), ) @@ -113,11 +113,11 @@ export const FeedItem = observer(function FeedItem({ style={s.mr2} key={author.href} href={author.href} - title={`@${author.name}`}> + title={`@${author.handle}`}> <UserAvatar size={30} displayName={author.displayName} - name={author.name} + handle={author.handle} /> </Link> ))} @@ -132,9 +132,9 @@ export const FeedItem = observer(function FeedItem({ key={authors[0].href} style={styles.metaItem} href={authors[0].href} - title={`@${authors[0].name}`}> + title={`@${authors[0].handle}`}> <Text style={[s.f14, s.bold]}> - {authors[0].displayName || authors[0].name} + {authors[0].displayName || authors[0].handle} </Text> </Link> {authors.length > 1 ? ( diff --git a/src/view/com/post-thread/PostLikedBy.tsx b/src/view/com/post-thread/PostLikedBy.tsx index 071e69fac..87829955e 100644 --- a/src/view/com/post-thread/PostLikedBy.tsx +++ b/src/view/com/post-thread/PostLikedBy.tsx @@ -67,18 +67,21 @@ export const PostLikedBy = observer(function PostLikedBy({uri}: {uri: string}) { const LikedByItem = ({item}: {item: LikedByViewItemModel}) => { return ( - <Link style={styles.outer} href={`/profile/${item.name}`} title={item.name}> + <Link + style={styles.outer} + href={`/profile/${item.handle}`} + title={item.handle}> <View style={styles.layout}> <View style={styles.layoutAvi}> <UserAvatar size={40} displayName={item.displayName} - name={item.name} + handle={item.handle} /> </View> <View style={styles.layoutContent}> <Text style={[s.f15, s.bold]}>{item.displayName}</Text> - <Text style={[s.f14, s.gray5]}>@{item.name}</Text> + <Text style={[s.f14, s.gray5]}>@{item.handle}</Text> </View> </View> </Link> diff --git a/src/view/com/post-thread/PostRepostedBy.tsx b/src/view/com/post-thread/PostRepostedBy.tsx index df462c1a1..adb20a7f7 100644 --- a/src/view/com/post-thread/PostRepostedBy.tsx +++ b/src/view/com/post-thread/PostRepostedBy.tsx @@ -80,18 +80,21 @@ export const PostRepostedBy = observer(function PostRepostedBy({ const RepostedByItem = ({item}: {item: RepostedByViewItemModel}) => { return ( - <Link style={styles.outer} href={`/profile/${item.name}`} title={item.name}> + <Link + style={styles.outer} + href={`/profile/${item.handle}`} + title={item.handle}> <View style={styles.layout}> <View style={styles.layoutAvi}> <UserAvatar size={40} displayName={item.displayName} - name={item.name} + handle={item.handle} /> </View> <View style={styles.layoutContent}> <Text style={[s.f15, s.bold]}>{item.displayName}</Text> - <Text style={[s.f14, s.gray5]}>@{item.name}</Text> + <Text style={[s.f14, s.gray5]}>@{item.handle}</Text> </View> </View> </Link> diff --git a/src/view/com/post-thread/PostThreadItem.tsx b/src/view/com/post-thread/PostThreadItem.tsx index 90cffc029..9fb145f15 100644 --- a/src/view/com/post-thread/PostThreadItem.tsx +++ b/src/view/com/post-thread/PostThreadItem.tsx @@ -3,7 +3,7 @@ import {observer} from 'mobx-react-lite' import {Image, StyleSheet, Text, TouchableOpacity, View} from 'react-native' import Svg, {Line} from 'react-native-svg' import {AtUri} from '../../../third-party/uri' -import * as PostType from '../../../third-party/api/src/types/app/bsky/post' +import * as PostType from '../../../third-party/api/src/client/types/app/bsky/feed/post' import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' import {PostThreadViewPostModel} from '../../../state/models/post-thread-view' import {Link} from '../util/Link' @@ -31,20 +31,20 @@ export const PostThreadItem = observer(function PostThreadItem({ const itemHref = useMemo(() => { const urip = new AtUri(item.uri) - return `/profile/${item.author.name}/post/${urip.rkey}` - }, [item.uri, item.author.name]) - const itemTitle = `Post by ${item.author.name}` - const authorHref = `/profile/${item.author.name}` - const authorTitle = item.author.name + return `/profile/${item.author.handle}/post/${urip.rkey}` + }, [item.uri, item.author.handle]) + const itemTitle = `Post by ${item.author.handle}` + const authorHref = `/profile/${item.author.handle}` + const authorTitle = item.author.handle const likesHref = useMemo(() => { const urip = new AtUri(item.uri) - return `/profile/${item.author.name}/post/${urip.rkey}/liked-by` - }, [item.uri, item.author.name]) + return `/profile/${item.author.handle}/post/${urip.rkey}/liked-by` + }, [item.uri, item.author.handle]) const likesTitle = 'Likes on this post' const repostsHref = useMemo(() => { const urip = new AtUri(item.uri) - return `/profile/${item.author.name}/post/${urip.rkey}/reposted-by` - }, [item.uri, item.author.name]) + return `/profile/${item.author.handle}/post/${urip.rkey}/reposted-by` + }, [item.uri, item.author.handle]) const repostsTitle = 'Reposts of this post' const onPressReply = () => { @@ -116,7 +116,7 @@ export const PostThreadItem = observer(function PostThreadItem({ <UserAvatar size={50} displayName={item.author.displayName} - name={item.author.name} + handle={item.author.handle} /> </Link> <View style={styles.layoutContent}> @@ -147,7 +147,7 @@ export const PostThreadItem = observer(function PostThreadItem({ style={styles.metaItem} href={authorHref} title={authorTitle}> - <Text style={[s.f14, s.gray5]}>@{item.author.name}</Text> + <Text style={[s.f14, s.gray5]}>@{item.author.handle}</Text> </Link> </View> </View> @@ -235,12 +235,12 @@ export const PostThreadItem = observer(function PostThreadItem({ <UserAvatar size={50} displayName={item.author.displayName} - name={item.author.name} + handle={item.author.handle} /> </Link> <View style={styles.layoutContent}> {item.replyingToAuthor && - item.replyingToAuthor !== item.author.name && ( + item.replyingToAuthor !== item.author.handle && ( <View style={[s.flexRow, {alignItems: 'center'}]}> <FontAwesomeIcon icon="reply" @@ -267,7 +267,7 @@ export const PostThreadItem = observer(function PostThreadItem({ style={styles.metaItem} href={authorHref} title={authorTitle}> - <Text style={[s.f14, s.gray5]}>@{item.author.name}</Text> + <Text style={[s.f14, s.gray5]}>@{item.author.handle}</Text> </Link> <Text style={[styles.metaItem, s.f14, s.gray5]}> · {ago(item.indexedAt)} diff --git a/src/view/com/post/Post.tsx b/src/view/com/post/Post.tsx index b98274c1c..5f19e0d67 100644 --- a/src/view/com/post/Post.tsx +++ b/src/view/com/post/Post.tsx @@ -1,7 +1,7 @@ -import React, {useState, useEffect, useMemo} from 'react' +import React, {useState, useEffect} from 'react' import {observer} from 'mobx-react-lite' import {AtUri} from '../../../third-party/uri' -import * as PostType from '../../../third-party/api/src/types/app/bsky/post' +import * as PostType from '../../../third-party/api/src/client/types/app/bsky/feed/post' import { ActivityIndicator, StyleSheet, @@ -58,10 +58,10 @@ export const Post = observer(function Post({uri}: {uri: string}) { const record = view.thread?.record as unknown as PostType.Record const itemUrip = new AtUri(item.uri) - const itemHref = `/profile/${item.author.name}/post/${itemUrip.rkey}` - const itemTitle = `Post by ${item.author.name}` - const authorHref = `/profile/${item.author.name}` - const authorTitle = item.author.name + const itemHref = `/profile/${item.author.handle}/post/${itemUrip.rkey}` + const itemTitle = `Post by ${item.author.handle}` + const authorHref = `/profile/${item.author.handle}` + const authorTitle = item.author.handle let replyAuthorDid = '' let replyHref = '' if (record.reply) { @@ -90,7 +90,7 @@ export const Post = observer(function Post({uri}: {uri: string}) { <UserAvatar size={50} displayName={item.author.displayName} - name={item.author.name} + handle={item.author.handle} /> </Link> <View style={styles.layoutContent}> @@ -99,7 +99,7 @@ export const Post = observer(function Post({uri}: {uri: string}) { <Text style={[s.f15, s.bold]}>{item.author.displayName}</Text> </Link> <Link style={styles.metaItem} href={authorHref} title={authorTitle}> - <Text style={[s.f14, s.gray5]}>@{item.author.name}</Text> + <Text style={[s.f14, s.gray5]}>@{item.author.handle}</Text> </Link> <Text style={[styles.metaItem, s.f14, s.gray5]}> · {ago(item.indexedAt)} diff --git a/src/view/com/posts/FeedItem.tsx b/src/view/com/posts/FeedItem.tsx index e591113d1..5164ad12d 100644 --- a/src/view/com/posts/FeedItem.tsx +++ b/src/view/com/posts/FeedItem.tsx @@ -2,7 +2,7 @@ import React, {useMemo} from 'react' import {observer} from 'mobx-react-lite' import {StyleSheet, Text, TouchableOpacity, View} from 'react-native' import {AtUri} from '../../../third-party/uri' -import * as PostType from '../../../third-party/api/src/types/app/bsky/post' +import * as PostType from '../../../third-party/api/src/client/types/app/bsky/feed/post' import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' import {FeedItemModel} from '../../../state/models/feed-view' import {SharePostModel} from '../../../state/models/shell' @@ -24,10 +24,10 @@ export const FeedItem = observer(function FeedItem({ const record = item.record as unknown as PostType.Record const itemHref = useMemo(() => { const urip = new AtUri(item.uri) - return `/profile/${item.author.name}/post/${urip.rkey}` - }, [item.uri, item.author.name]) - const itemTitle = `Post by ${item.author.name}` - const authorHref = `/profile/${item.author.name}` + return `/profile/${item.author.handle}/post/${urip.rkey}` + }, [item.uri, item.author.handle]) + const itemTitle = `Post by ${item.author.handle}` + const authorHref = `/profile/${item.author.handle}` const replyAuthorDid = useMemo(() => { if (!record.reply) return '' const urip = new AtUri(record.reply.parent?.uri || record.reply.root.uri) @@ -70,11 +70,11 @@ export const FeedItem = observer(function FeedItem({ <Link style={styles.layoutAvi} href={authorHref} - title={item.author.name}> + title={item.author.handle}> <UserAvatar size={50} displayName={item.author.displayName} - name={item.author.name} + handle={item.author.handle} /> </Link> <View style={styles.layoutContent}> @@ -82,14 +82,14 @@ export const FeedItem = observer(function FeedItem({ <Link style={styles.metaItem} href={authorHref} - title={item.author.name}> + title={item.author.handle}> <Text style={[s.f15, s.bold]}>{item.author.displayName}</Text> </Link> <Link style={styles.metaItem} href={authorHref} - title={item.author.name}> - <Text style={[s.f14, s.gray5]}>@{item.author.name}</Text> + title={item.author.handle}> + <Text style={[s.f14, s.gray5]}>@{item.author.handle}</Text> </Link> <Text style={[styles.metaItem, s.f14, s.gray5]}> · {ago(item.indexedAt)} diff --git a/src/view/com/profile/ProfileFollowers.tsx b/src/view/com/profile/ProfileFollowers.tsx index 30145e7b5..39affd9e0 100644 --- a/src/view/com/profile/ProfileFollowers.tsx +++ b/src/view/com/profile/ProfileFollowers.tsx @@ -1,13 +1,6 @@ import React, {useState, useEffect} from 'react' import {observer} from 'mobx-react-lite' -import { - ActivityIndicator, - FlatList, - Image, - StyleSheet, - Text, - View, -} from 'react-native' +import {ActivityIndicator, FlatList, StyleSheet, Text, View} from 'react-native' import { UserFollowersViewModel, FollowerItem, @@ -78,18 +71,21 @@ export const ProfileFollowers = observer(function ProfileFollowers({ const User = ({item}: {item: FollowerItem}) => { return ( - <Link style={styles.outer} href={`/profile/${item.name}`} title={item.name}> + <Link + style={styles.outer} + href={`/profile/${item.handle}`} + title={item.handle}> <View style={styles.layout}> <View style={styles.layoutAvi}> <UserAvatar size={40} displayName={item.displayName} - name={item.name} + handle={item.handle} /> </View> <View style={styles.layoutContent}> <Text style={[s.f15, s.bold]}>{item.displayName}</Text> - <Text style={[s.f14, s.gray5]}>@{item.name}</Text> + <Text style={[s.f14, s.gray5]}>@{item.handle}</Text> </View> </View> </Link> diff --git a/src/view/com/profile/ProfileFollows.tsx b/src/view/com/profile/ProfileFollows.tsx index 56a5371ba..d0619ba77 100644 --- a/src/view/com/profile/ProfileFollows.tsx +++ b/src/view/com/profile/ProfileFollows.tsx @@ -1,13 +1,6 @@ import React, {useState, useEffect} from 'react' import {observer} from 'mobx-react-lite' -import { - ActivityIndicator, - FlatList, - Image, - StyleSheet, - Text, - View, -} from 'react-native' +import {ActivityIndicator, FlatList, StyleSheet, Text, View} from 'react-native' import { UserFollowsViewModel, FollowItem, @@ -78,18 +71,21 @@ export const ProfileFollows = observer(function ProfileFollows({ const User = ({item}: {item: FollowItem}) => { return ( - <Link style={styles.outer} href={`/profile/${item.name}`} title={item.name}> + <Link + style={styles.outer} + href={`/profile/${item.handle}`} + title={item.handle}> <View style={styles.layout}> <View style={styles.layoutAvi}> <UserAvatar size={40} displayName={item.displayName} - name={item.name} + handle={item.handle} /> </View> <View style={styles.layoutContent}> <Text style={[s.f15, s.bold]}>{item.displayName}</Text> - <Text style={[s.f14, s.gray5]}>@{item.name}</Text> + <Text style={[s.f14, s.gray5]}>@{item.handle}</Text> </View> </View> </Link> diff --git a/src/view/com/profile/ProfileHeader.tsx b/src/view/com/profile/ProfileHeader.tsx index 6445e4a92..e1b46f4c9 100644 --- a/src/view/com/profile/ProfileHeader.tsx +++ b/src/view/com/profile/ProfileHeader.tsx @@ -35,7 +35,7 @@ export const ProfileHeader = observer(function ProfileHeader({ () => { Toast.show( `${view.myState.follow ? 'Following' : 'No longer following'} ${ - view.displayName || view.name + view.displayName || view.handle }`, { duration: Toast.durations.LONG, @@ -53,10 +53,10 @@ export const ProfileHeader = observer(function ProfileHeader({ // TODO } const onPressFollowers = () => { - store.nav.navigate(`/profile/${view.name}/followers`) + store.nav.navigate(`/profile/${view.handle}/followers`) } const onPressFollows = () => { - store.nav.navigate(`/profile/${view.name}/follows`) + store.nav.navigate(`/profile/${view.handle}/follows`) } // loading @@ -95,7 +95,11 @@ export const ProfileHeader = observer(function ProfileHeader({ </TouchableOpacity> ) : undefined} <View style={styles.avi}> - <UserAvatar size={80} displayName={view.displayName} name={view.name} /> + <UserAvatar + size={80} + displayName={view.displayName} + handle={view.handle} + /> </View> <View style={styles.content}> <View style={[styles.displayNameLine]}> diff --git a/src/view/com/util/UserAvatar.tsx b/src/view/com/util/UserAvatar.tsx index b38f1158c..9b8ceb37a 100644 --- a/src/view/com/util/UserAvatar.tsx +++ b/src/view/com/util/UserAvatar.tsx @@ -12,14 +12,14 @@ const GRADIENTS = [ export function UserAvatar({ size, displayName, - name, + handle, }: { size: number displayName: string | undefined - name: string + handle: string }) { - const initials = getInitials(displayName || name) - const gi = cyrb53(name) % GRADIENTS.length + const initials = getInitials(displayName || handle) + const gi = cyrb53(handle) % GRADIENTS.length return ( <Svg width={size} height={size} viewBox="0 0 100 100"> <Defs> 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) diff --git a/src/view/lib/strings.ts b/src/view/lib/strings.ts index b30a3c08b..7f1bc545f 100644 --- a/src/view/lib/strings.ts +++ b/src/view/lib/strings.ts @@ -1,7 +1,5 @@ import {AtUri} from '../../third-party/uri' -import {Entity as Entities} from '../../third-party/api/src/types/app/bsky/post' - -type Entity = Entities[0] +import {Entity} from '../../third-party/api/src/client/types/app/bsky/feed/post' export function pluralize(n: number, base: string, plural?: string): string { if (n === 1) { diff --git a/src/view/screens/Contacts.tsx b/src/view/screens/Contacts.tsx index 70b15a86f..65c933b38 100644 --- a/src/view/screens/Contacts.tsx +++ b/src/view/screens/Contacts.tsx @@ -47,7 +47,7 @@ export const Contacts = ({visible, params}: ScreenParams) => { selectedIndex={0} swipeGestureInterp={selectorInterp} /> - {!!store.me.name && <ProfileFollowsComponent name={store.me.name} />} + {!!store.me.handle && <ProfileFollowsComponent name={store.me.handle} />} </View> ) } diff --git a/src/view/screens/Login.tsx b/src/view/screens/Login.tsx index bc40327bd..96c010321 100644 --- a/src/view/screens/Login.tsx +++ b/src/view/screens/Login.tsx @@ -109,7 +109,7 @@ const Signin = ({onPressBack}: {onPressBack: () => void}) => { const store = useStores() const [isProcessing, setIsProcessing] = useState<boolean>(false) const [error, setError] = useState<string>('') - const [username, setUsername] = useState<string>('') + const [handle, setHandle] = useState<string>('') const [password, setPassword] = useState<string>('') const onPressNext = async () => { @@ -118,7 +118,7 @@ const Signin = ({onPressBack}: {onPressBack: () => void}) => { try { await store.session.login({ service: 'http://localhost:2583/', - username, + handle, password, }) } catch (e: any) { @@ -164,8 +164,8 @@ const Signin = ({onPressBack}: {onPressBack: () => void}) => { placeholderTextColor={colors.blue0} autoCapitalize="none" autoFocus - value={username} - onChangeText={setUsername} + value={handle} + onChangeText={setHandle} editable={!isProcessing} /> </View> @@ -211,7 +211,7 @@ const CreateAccount = ({onPressBack}: {onPressBack: () => void}) => { const [inviteCode, setInviteCode] = useState<string>('') const [email, setEmail] = useState<string>('') const [password, setPassword] = useState<string>('') - const [username, setUsername] = useState<string>('') + const [handle, setHandle] = useState<string>('') useEffect(() => { let aborted = false @@ -247,7 +247,7 @@ const CreateAccount = ({onPressBack}: {onPressBack: () => void}) => { if (!password) { return setError('Please choose your password.') } - if (!username) { + if (!handle) { return setError('Please choose your username.') } setError('') @@ -256,7 +256,7 @@ const CreateAccount = ({onPressBack}: {onPressBack: () => void}) => { await store.session.createAccount({ service: 'http://localhost:2583/', email, - username: `${username}.${userDomain}`, + handle: `${handle}.${userDomain}`, password, inviteCode, }) @@ -379,8 +379,8 @@ const CreateAccount = ({onPressBack}: {onPressBack: () => void}) => { placeholder="eg alice" placeholderTextColor={colors.blue0} autoCapitalize="none" - value={username} - onChangeText={v => setUsername(cleanUsername(v))} + value={handle} + onChangeText={v => setHandle(cleanUsername(v))} editable={!isProcessing} /> </View> @@ -405,7 +405,7 @@ const CreateAccount = ({onPressBack}: {onPressBack: () => void}) => { <Text style={[s.white, s.p10]}> Your full username will be{' '} <Text style={s.bold}> - @{username}.{userDomain} + @{handle}.{userDomain} </Text> </Text> </View> diff --git a/src/view/screens/PostLikedBy.tsx b/src/view/screens/PostLikedBy.tsx index 72c6016e4..8adc58c89 100644 --- a/src/view/screens/PostLikedBy.tsx +++ b/src/view/screens/PostLikedBy.tsx @@ -9,7 +9,7 @@ import {makeRecordUri} from '../lib/strings' export const PostLikedBy = ({visible, params}: ScreenParams) => { const store = useStores() const {name, rkey} = params - const uri = makeRecordUri(name, 'app.bsky.post', rkey) + const uri = makeRecordUri(name, 'app.bsky.feed.post', rkey) useEffect(() => { if (visible) { diff --git a/src/view/screens/PostRepostedBy.tsx b/src/view/screens/PostRepostedBy.tsx index d9a59a268..263af195d 100644 --- a/src/view/screens/PostRepostedBy.tsx +++ b/src/view/screens/PostRepostedBy.tsx @@ -9,7 +9,7 @@ import {makeRecordUri} from '../lib/strings' export const PostRepostedBy = ({visible, params}: ScreenParams) => { const store = useStores() const {name, rkey} = params - const uri = makeRecordUri(name, 'app.bsky.post', rkey) + const uri = makeRecordUri(name, 'app.bsky.feed.post', rkey) useEffect(() => { if (visible) { diff --git a/src/view/screens/PostThread.tsx b/src/view/screens/PostThread.tsx index a30b5521b..e872db2dc 100644 --- a/src/view/screens/PostThread.tsx +++ b/src/view/screens/PostThread.tsx @@ -9,7 +9,7 @@ import {useStores} from '../../state' export const PostThread = ({visible, params}: ScreenParams) => { const store = useStores() const {name, rkey} = params - const uri = makeRecordUri(name, 'app.bsky.post', rkey) + const uri = makeRecordUri(name, 'app.bsky.feed.post', rkey) useEffect(() => { if (visible) { diff --git a/src/view/screens/Settings.tsx b/src/view/screens/Settings.tsx index 6bc3d1015..0fc09e6ab 100644 --- a/src/view/screens/Settings.tsx +++ b/src/view/screens/Settings.tsx @@ -33,16 +33,16 @@ export const Settings = observer(function Settings({visible}: ScreenParams) { <Text style={[s.blue3, s.bold]}>Sign out</Text> </TouchableOpacity> </View> - <Link href={`/profile/${store.me.name}`} title="Your profile"> + <Link href={`/profile/${store.me.handle}`} title="Your profile"> <View style={styles.profile}> <UserAvatar size={40} displayName={store.me.displayName} - name={store.me.name || ''} + handle={store.me.handle || ''} /> <View style={[s.ml10]}> <Text style={[s.f18]}>{store.me.displayName}</Text> - <Text style={[s.gray5]}>@{store.me.name}</Text> + <Text style={[s.gray5]}>@{store.me.handle}</Text> </View> </View> </Link> diff --git a/src/view/shell/mobile/MainMenu.tsx b/src/view/shell/mobile/MainMenu.tsx index 1ff286efc..89c7857f9 100644 --- a/src/view/shell/mobile/MainMenu.tsx +++ b/src/view/shell/mobile/MainMenu.tsx @@ -103,7 +103,7 @@ export const MainMenu = observer( style={[styles.menuItem, styles.menuItemMargin]} onPress={() => onNavigate(url)}> <View style={s.mb5}> - <UserAvatar size={60} displayName={label} name={label} /> + <UserAvatar size={60} displayName={label} handle={label} /> </View> {count ? ( <View style={styles.menuItemCount}> @@ -130,16 +130,16 @@ export const MainMenu = observer( <View style={[styles.topSection]}> <TouchableOpacity style={styles.profile} - onPress={() => onNavigate(`/profile/${store.me.name || ''}`)}> + onPress={() => onNavigate(`/profile/${store.me.handle || ''}`)}> <View style={styles.profileImage}> <UserAvatar size={30} displayName={store.me.displayName} - name={store.me.name || ''} + handle={store.me.handle || ''} /> </View> <Text style={styles.profileText} numberOfLines={1}> - {store.me.displayName || store.me.name || 'My profile'} + {store.me.displayName || store.me.handle || 'My profile'} </Text> </TouchableOpacity> <View style={[s.flex1]} /> diff --git a/src/view/shell/mobile/index.tsx b/src/view/shell/mobile/index.tsx index 60188f89f..f30827951 100644 --- a/src/view/shell/mobile/index.tsx +++ b/src/view/shell/mobile/index.tsx @@ -359,7 +359,7 @@ const styles = StyleSheet.create({ }, ctrlCount: { position: 'absolute', - left: 52, + left: 46, top: 10, backgroundColor: colors.red3, paddingHorizontal: 4, |