Update api nsids
This commit is contained in:
parent
c9388a3cc5
commit
0c0c9eb05c
72 changed files with 1758 additions and 579 deletions
|
@ -3,7 +3,7 @@ import {StyleSheet, Text, TouchableOpacity, View} from 'react-native'
|
|||
import {BottomSheetTextInput} from '@gorhom/bottom-sheet'
|
||||
import LinearGradient from 'react-native-linear-gradient'
|
||||
import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
|
||||
import * as GetUserFollows from '../../../third-party/api/src/types/todo/social/getUserFollows'
|
||||
import * as GetUserFollows from '../../../third-party/api/src/types/app/bsky/getUserFollows'
|
||||
import {Autocomplete} from './composer/Autocomplete'
|
||||
import Toast from '../util/Toast'
|
||||
import ProgressCircle from '../util/ProgressCircle'
|
||||
|
@ -32,7 +32,7 @@ export function Component({
|
|||
const [autocompleteOptions, setAutocompleteOptions] = useState<string[]>([])
|
||||
|
||||
useEffect(() => {
|
||||
store.api.todo.social
|
||||
store.api.app.bsky
|
||||
.getUserFollows({
|
||||
user: store.me.did || '',
|
||||
})
|
||||
|
|
|
@ -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/todo/social/profile'
|
||||
import * as Profile from '../../../third-party/api/src/types/app/bsky/profile'
|
||||
|
||||
export const snapPoints = ['80%']
|
||||
|
||||
|
|
|
@ -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 {AdxUri} from '../../../third-party/uri'
|
||||
import * as PostType from '../../../third-party/api/src/types/todo/social/post'
|
||||
import * as PostType from '../../../third-party/api/src/types/app/bsky/post'
|
||||
import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
|
||||
import {PostThreadViewPostModel} from '../../../state/models/post-thread-view'
|
||||
import {ComposePostModel} from '../../../state/models/shell'
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React, {useState, useEffect, useMemo} from 'react'
|
||||
import {observer} from 'mobx-react-lite'
|
||||
import {AdxUri} from '../../../third-party/uri'
|
||||
import * as PostType from '../../../third-party/api/src/types/todo/social/post'
|
||||
import * as PostType from '../../../third-party/api/src/types/app/bsky/post'
|
||||
import {
|
||||
ActivityIndicator,
|
||||
Image,
|
||||
|
|
|
@ -2,7 +2,7 @@ import React, {useMemo} from 'react'
|
|||
import {observer} from 'mobx-react-lite'
|
||||
import {Image, StyleSheet, Text, TouchableOpacity, View} from 'react-native'
|
||||
import {AdxUri} from '../../../third-party/uri'
|
||||
import * as PostType from '../../../third-party/api/src/types/todo/social/post'
|
||||
import * as PostType from '../../../third-party/api/src/types/app/bsky/post'
|
||||
import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
|
||||
import {FeedViewItemModel} from '../../../state/models/feed-view'
|
||||
import {ComposePostModel, SharePostModel} from '../../../state/models/shell'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React, {useState, useEffect} from 'react'
|
||||
import * as TodoSocialGetProfile from '../../../third-party/api/src/types/todo/social/getProfile'
|
||||
import * as AppBskyGetProfile from '../../../third-party/api/src/types/app/bsky/getProfile'
|
||||
import {StyleProp, Text, TextStyle} from 'react-native'
|
||||
import {useStores} from '../../../state'
|
||||
|
||||
|
@ -12,7 +12,7 @@ export function UserInfoText({
|
|||
style,
|
||||
}: {
|
||||
did: string
|
||||
attr?: keyof TodoSocialGetProfile.OutputSchema
|
||||
attr?: keyof AppBskyGetProfile.OutputSchema
|
||||
loading?: string
|
||||
failed?: string
|
||||
prefix?: string
|
||||
|
@ -24,13 +24,13 @@ export function UserInfoText({
|
|||
|
||||
const store = useStores()
|
||||
const [profile, setProfile] = useState<
|
||||
undefined | TodoSocialGetProfile.OutputSchema
|
||||
undefined | AppBskyGetProfile.OutputSchema
|
||||
>(undefined)
|
||||
const [didFail, setFailed] = useState<boolean>(false)
|
||||
|
||||
useEffect(() => {
|
||||
// TODO use caching to reduce loads
|
||||
store.api.todo.social.getProfile({user: did}).then(
|
||||
store.api.app.bsky.getProfile({user: did}).then(
|
||||
v => {
|
||||
setProfile(v.data)
|
||||
},
|
||||
|
@ -38,7 +38,7 @@ export function UserInfoText({
|
|||
setFailed(true)
|
||||
},
|
||||
)
|
||||
}, [did, store.api.todo.social])
|
||||
}, [did, store.api.app.bsky])
|
||||
|
||||
return (
|
||||
<Text style={style}>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {AdxUri} from '../../third-party/uri'
|
||||
import {Entity as Entities} from '../../third-party/api/src/types/todo/social/post'
|
||||
import {Entity as Entities} from '../../third-party/api/src/types/app/bsky/post'
|
||||
|
||||
type Entity = Entities[0]
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ import {Settings} from './screens/Settings'
|
|||
export type ScreenParams = {
|
||||
params: Record<string, any>
|
||||
visible: boolean
|
||||
scrollElRef: MutableRefObject<FlatList<any> | undefined>
|
||||
scrollElRef?: MutableRefObject<FlatList<any> | undefined>
|
||||
}
|
||||
export type Route = [React.FC<ScreenParams>, IconProp, RegExp]
|
||||
export type MatchResult = {
|
||||
|
|
|
@ -7,7 +7,7 @@ import {useStores} from '../../state'
|
|||
export const PostLikedBy = ({visible, params}: ScreenParams) => {
|
||||
const store = useStores()
|
||||
const {name, recordKey} = params
|
||||
const uri = makeRecordUri(name, 'todo.social.post', recordKey)
|
||||
const uri = makeRecordUri(name, 'app.bsky.post', recordKey)
|
||||
|
||||
useEffect(() => {
|
||||
if (visible) {
|
||||
|
|
|
@ -7,7 +7,7 @@ import {useStores} from '../../state'
|
|||
export const PostRepostedBy = ({visible, params}: ScreenParams) => {
|
||||
const store = useStores()
|
||||
const {name, recordKey} = params
|
||||
const uri = makeRecordUri(name, 'todo.social.post', recordKey)
|
||||
const uri = makeRecordUri(name, 'app.bsky.post', recordKey)
|
||||
|
||||
useEffect(() => {
|
||||
if (visible) {
|
||||
|
|
|
@ -7,7 +7,7 @@ import {useStores} from '../../state'
|
|||
export const PostThread = ({visible, params}: ScreenParams) => {
|
||||
const store = useStores()
|
||||
const {name, recordKey} = params
|
||||
const uri = makeRecordUri(name, 'todo.social.post', recordKey)
|
||||
const uri = makeRecordUri(name, 'app.bsky.post', recordKey)
|
||||
|
||||
useEffect(() => {
|
||||
if (visible) {
|
||||
|
|
|
@ -56,10 +56,12 @@ export const MainMenu = observer(
|
|||
icon,
|
||||
label,
|
||||
url,
|
||||
count,
|
||||
}: {
|
||||
icon: IconProp
|
||||
label: string
|
||||
url: string
|
||||
count?: number
|
||||
}) => (
|
||||
<TouchableOpacity
|
||||
style={[styles.menuItem, styles.menuItemMargin]}
|
||||
|
@ -75,6 +77,11 @@ export const MainMenu = observer(
|
|||
/>
|
||||
)}
|
||||
</View>
|
||||
{count ? (
|
||||
<View style={styles.menuItemCount}>
|
||||
<Text style={styles.menuItemCountLabel}>{count}</Text>
|
||||
</View>
|
||||
) : undefined}
|
||||
<Text style={styles.menuItemLabel} numberOfLines={1}>
|
||||
{label}
|
||||
</Text>
|
||||
|
@ -123,6 +130,7 @@ export const MainMenu = observer(
|
|||
icon={['far', 'bell']}
|
||||
label="Notifications"
|
||||
url="/notifications"
|
||||
count={store.me.notificationCount}
|
||||
/>
|
||||
</Animated.View>
|
||||
</View>
|
||||
|
@ -212,4 +220,18 @@ const styles = StyleSheet.create({
|
|||
menuItemLabel: {
|
||||
fontSize: 13,
|
||||
},
|
||||
menuItemCount: {
|
||||
position: 'absolute',
|
||||
left: 48,
|
||||
top: 10,
|
||||
backgroundColor: colors.red3,
|
||||
paddingHorizontal: 4,
|
||||
paddingBottom: 1,
|
||||
borderRadius: 6,
|
||||
},
|
||||
menuItemCountLabel: {
|
||||
fontSize: 12,
|
||||
fontWeight: 'bold',
|
||||
color: colors.white,
|
||||
},
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue