Update to the latest APIs
This commit is contained in:
parent
8ae6e67eea
commit
f333a90fab
165 changed files with 2963 additions and 4747 deletions
|
@ -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>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue