flip the screen type imports to the generated lexicons
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
+10
-12
@@ -1,10 +1,5 @@
|
|||||||
import {useCallback, useMemo, useState} from 'react'
|
import {useCallback, useMemo, useState} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {
|
|
||||||
type $Typed,
|
|
||||||
type AppBskyBookmarkDefs,
|
|
||||||
AppBskyFeedDefs,
|
|
||||||
} from '@atproto/api'
|
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {Trans} from '@lingui/react/macro'
|
import {Trans} from '@lingui/react/macro'
|
||||||
@@ -14,6 +9,9 @@ import {
|
|||||||
useNavigation,
|
useNavigation,
|
||||||
} from '@react-navigation/native'
|
} from '@react-navigation/native'
|
||||||
|
|
||||||
|
import {type $Typed} from '@atproto/lex'
|
||||||
|
import * as bsky from '#/types/bsky'
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {useInitialNumToRender} from '#/lib/hooks/useInitialNumToRender'
|
import {useInitialNumToRender} from '#/lib/hooks/useInitialNumToRender'
|
||||||
import {usePostViewTracking} from '#/lib/hooks/usePostViewTracking'
|
import {usePostViewTracking} from '#/lib/hooks/usePostViewTracking'
|
||||||
import {
|
import {
|
||||||
@@ -78,15 +76,15 @@ type ListItem =
|
|||||||
| {
|
| {
|
||||||
type: 'bookmark'
|
type: 'bookmark'
|
||||||
key: string
|
key: string
|
||||||
bookmark: Omit<AppBskyBookmarkDefs.BookmarkView, 'item'> & {
|
bookmark: Omit<app.bsky.bookmark.defs.BookmarkView, 'item'> & {
|
||||||
item: $Typed<AppBskyFeedDefs.PostView>
|
item: $Typed<app.bsky.feed.defs.PostView>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
type: 'bookmarkNotFound'
|
type: 'bookmarkNotFound'
|
||||||
key: string
|
key: string
|
||||||
bookmark: Omit<AppBskyBookmarkDefs.BookmarkView, 'item'> & {
|
bookmark: Omit<app.bsky.bookmark.defs.BookmarkView, 'item'> & {
|
||||||
item: $Typed<AppBskyFeedDefs.NotFoundPost>
|
item: $Typed<app.bsky.feed.defs.NotFoundPost>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,7 +130,7 @@ function BookmarksInner() {
|
|||||||
|
|
||||||
if (bookmarks.length > 0) {
|
if (bookmarks.length > 0) {
|
||||||
for (const bookmark of bookmarks) {
|
for (const bookmark of bookmarks) {
|
||||||
if (AppBskyFeedDefs.isNotFoundPost(bookmark.item)) {
|
if (bsky.isType(app.bsky.feed.defs.notFoundPost, bookmark.item)) {
|
||||||
i.push({
|
i.push({
|
||||||
type: 'bookmarkNotFound',
|
type: 'bookmarkNotFound',
|
||||||
key: bookmark.item.uri,
|
key: bookmark.item.uri,
|
||||||
@@ -142,7 +140,7 @@ function BookmarksInner() {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (AppBskyFeedDefs.isPostView(bookmark.item)) {
|
if (bsky.isType(app.bsky.feed.defs.postView, bookmark.item)) {
|
||||||
i.push({
|
i.push({
|
||||||
type: 'bookmark',
|
type: 'bookmark',
|
||||||
key: bookmark.item.uri,
|
key: bookmark.item.uri,
|
||||||
@@ -199,7 +197,7 @@ function BookmarkNotFound({
|
|||||||
post,
|
post,
|
||||||
}: {
|
}: {
|
||||||
hideTopBorder: boolean
|
hideTopBorder: boolean
|
||||||
post: $Typed<AppBskyFeedDefs.NotFoundPost>
|
post: $Typed<app.bsky.feed.defs.NotFoundPost>
|
||||||
}) {
|
}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import {useCallback, useMemo, useState} from 'react'
|
import {useCallback, useMemo, useState} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {AtUri} from '@atproto/api'
|
|
||||||
import {Plural, Trans, useLingui} from '@lingui/react/macro'
|
import {Plural, Trans, useLingui} from '@lingui/react/macro'
|
||||||
|
|
||||||
|
import {AtUri} from '@atproto/syntax'
|
||||||
import {TRENDING_HANDLE} from '#/lib/constants'
|
import {TRENDING_HANDLE} from '#/lib/constants'
|
||||||
import {useHaptics} from '#/lib/haptics'
|
import {useHaptics} from '#/lib/haptics'
|
||||||
import {makeCustomFeedLink, makeProfileLink} from '#/lib/routes/links'
|
import {makeCustomFeedLink, makeProfileLink} from '#/lib/routes/links'
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import {useCallback, useEffect, useMemo, useState} from 'react'
|
import {useCallback, useEffect, useMemo, useState} from 'react'
|
||||||
import {useAnimatedRef} from 'react-native-reanimated'
|
import {useAnimatedRef} from 'react-native-reanimated'
|
||||||
import {AppBskyFeedDefs} from '@atproto/api'
|
|
||||||
import {useLingui} from '@lingui/react/macro'
|
import {useLingui} from '@lingui/react/macro'
|
||||||
import {useIsFocused} from '@react-navigation/native'
|
import {useIsFocused} from '@react-navigation/native'
|
||||||
import {type NativeStackScreenProps} from '@react-navigation/native-stack'
|
import {type NativeStackScreenProps} from '@react-navigation/native-stack'
|
||||||
import {useQueryClient} from '@tanstack/react-query'
|
import {useQueryClient} from '@tanstack/react-query'
|
||||||
|
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {TRENDING_DID, TRENDING_HANDLE, VIDEO_FEED_URIS} from '#/lib/constants'
|
import {TRENDING_DID, TRENDING_HANDLE, VIDEO_FEED_URIS} from '#/lib/constants'
|
||||||
import {useOpenComposer} from '#/lib/hooks/useOpenComposer'
|
import {useOpenComposer} from '#/lib/hooks/useOpenComposer'
|
||||||
import {useSetTitle} from '#/lib/hooks/useSetTitle'
|
import {useSetTitle} from '#/lib/hooks/useSetTitle'
|
||||||
@@ -175,7 +175,7 @@ export function CustomFeedScreenInner({
|
|||||||
const isVideoFeed = useMemo(() => {
|
const isVideoFeed = useMemo(() => {
|
||||||
const isBskyVideoFeed = VIDEO_FEED_URIS.includes(feedInfo.uri)
|
const isBskyVideoFeed = VIDEO_FEED_URIS.includes(feedInfo.uri)
|
||||||
const feedIsVideoMode =
|
const feedIsVideoMode =
|
||||||
feedInfo.contentMode === AppBskyFeedDefs.CONTENTMODEVIDEO
|
feedInfo.contentMode === app.bsky.feed.defs.contentModeVideo
|
||||||
const _isVideoFeed = isBskyVideoFeed || feedIsVideoMode
|
const _isVideoFeed = isBskyVideoFeed || feedIsVideoMode
|
||||||
return IS_NATIVE && _isVideoFeed
|
return IS_NATIVE && _isVideoFeed
|
||||||
}, [feedInfo])
|
}, [feedInfo])
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import {useCallback, useMemo, useState} from 'react'
|
import {useCallback, useMemo, useState} from 'react'
|
||||||
import {type ListRenderItemInfo, View} from 'react-native'
|
import {type ListRenderItemInfo, View} from 'react-native'
|
||||||
import {type AppBskyFeedDefs} from '@atproto/api'
|
|
||||||
import {Trans, useLingui} from '@lingui/react/macro'
|
import {Trans, useLingui} from '@lingui/react/macro'
|
||||||
import {type NativeStackScreenProps} from '@react-navigation/native-stack'
|
import {type NativeStackScreenProps} from '@react-navigation/native-stack'
|
||||||
|
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {HITSLOP_10} from '#/lib/constants'
|
import {HITSLOP_10} from '#/lib/constants'
|
||||||
import {useInitialNumToRender} from '#/lib/hooks/useInitialNumToRender'
|
import {useInitialNumToRender} from '#/lib/hooks/useInitialNumToRender'
|
||||||
import {usePostViewTracking} from '#/lib/hooks/usePostViewTracking'
|
import {usePostViewTracking} from '#/lib/hooks/usePostViewTracking'
|
||||||
@@ -29,11 +29,13 @@ import {ListFooter, ListMaybePlaceholder} from '#/components/Lists'
|
|||||||
import {SearchError} from '#/components/SearchError'
|
import {SearchError} from '#/components/SearchError'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
|
|
||||||
const renderItem = ({item}: ListRenderItemInfo<AppBskyFeedDefs.PostView>) => {
|
const renderItem = ({
|
||||||
|
item,
|
||||||
|
}: ListRenderItemInfo<app.bsky.feed.defs.PostView>) => {
|
||||||
return <Post post={item} />
|
return <Post post={item} />
|
||||||
}
|
}
|
||||||
|
|
||||||
const keyExtractor = (item: AppBskyFeedDefs.PostView, index: number) => {
|
const keyExtractor = (item: app.bsky.feed.defs.PostView, index: number) => {
|
||||||
return `${item.uri}-${index}`
|
return `${item.uri}-${index}`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import {useState} from 'react'
|
import {useState} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {AppBskyGraphDefs} from '@atproto/api'
|
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {Trans} from '@lingui/react/macro'
|
import {Trans} from '@lingui/react/macro'
|
||||||
import {useQueryClient} from '@tanstack/react-query'
|
import {useQueryClient} from '@tanstack/react-query'
|
||||||
|
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {useGoBack} from '#/lib/hooks/useGoBack'
|
import {useGoBack} from '#/lib/hooks/useGoBack'
|
||||||
import {sanitizeHandle} from '#/lib/strings/handles'
|
import {sanitizeHandle} from '#/lib/strings/handles'
|
||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
@@ -32,7 +32,7 @@ export function ListHiddenScreen({
|
|||||||
list,
|
list,
|
||||||
preferences,
|
preferences,
|
||||||
}: {
|
}: {
|
||||||
list: AppBskyGraphDefs.ListView
|
list: app.bsky.graph.defs.ListView
|
||||||
preferences: UsePreferencesQueryResponse
|
preferences: UsePreferencesQueryResponse
|
||||||
}) {
|
}) {
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
@@ -43,7 +43,7 @@ export function ListHiddenScreen({
|
|||||||
const goBack = useGoBack()
|
const goBack = useGoBack()
|
||||||
const queryClient = useQueryClient()
|
const queryClient = useQueryClient()
|
||||||
|
|
||||||
const isModList = list.purpose === AppBskyGraphDefs.MODLIST
|
const isModList = list.purpose === app.bsky.graph.defs.modlist
|
||||||
|
|
||||||
const [isProcessing, setIsProcessing] = useState(false)
|
const [isProcessing, setIsProcessing] = useState(false)
|
||||||
const listBlockMutation = useListBlockMutation()
|
const listBlockMutation = useListBlockMutation()
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import {useRef, useState} from 'react'
|
import {useRef, useState} from 'react'
|
||||||
import {Keyboard, type TextInput, View} from 'react-native'
|
import {Keyboard, type TextInput, View} from 'react-native'
|
||||||
import {type ComAtprotoServerDescribeServer} from '@atproto/api'
|
|
||||||
import {LexAuthFactorError} from '@atproto/lex-password-session'
|
import {LexAuthFactorError} from '@atproto/lex-password-session'
|
||||||
import {Trans, useLingui} from '@lingui/react/macro'
|
import {Trans, useLingui} from '@lingui/react/macro'
|
||||||
|
|
||||||
|
import {com} from '#/lexicons'
|
||||||
import {DEFAULT_SERVICE, HITSLOP_10, HITSLOP_20} from '#/lib/constants'
|
import {DEFAULT_SERVICE, HITSLOP_10, HITSLOP_20} from '#/lib/constants'
|
||||||
import {useRequestNotificationsPermission} from '#/lib/notifications/notifications'
|
import {useRequestNotificationsPermission} from '#/lib/notifications/notifications'
|
||||||
import {cleanError, isNetworkError} from '#/lib/strings/errors'
|
import {cleanError, isNetworkError} from '#/lib/strings/errors'
|
||||||
@@ -37,7 +37,7 @@ import {ConfirmHostingProviderDialog} from './components/ConfirmHostingProviderD
|
|||||||
import {HostingProviderDialog} from './components/HostingProviderDialog'
|
import {HostingProviderDialog} from './components/HostingProviderDialog'
|
||||||
import {FormContainer} from './FormContainer'
|
import {FormContainer} from './FormContainer'
|
||||||
|
|
||||||
type ServiceDescription = ComAtprotoServerDescribeServer.OutputSchema
|
type ServiceDescription = com.atproto.server.describeServer.$OutputBody
|
||||||
|
|
||||||
export const LoginForm = ({
|
export const LoginForm = ({
|
||||||
error,
|
error,
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import {useCallback, useEffect, useMemo, useRef, useState} from 'react'
|
import {useCallback, useEffect, useMemo, useRef, useState} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {type ChatBskyActorGetStatus, type ChatBskyConvoDefs} from '@atproto/api'
|
|
||||||
import {Trans, useLingui} from '@lingui/react/macro'
|
import {Trans, useLingui} from '@lingui/react/macro'
|
||||||
import {
|
import {
|
||||||
useFocusEffect,
|
useFocusEffect,
|
||||||
@@ -9,6 +8,7 @@ import {
|
|||||||
} from '@react-navigation/native'
|
} from '@react-navigation/native'
|
||||||
import {type NativeStackScreenProps} from '@react-navigation/native-stack'
|
import {type NativeStackScreenProps} from '@react-navigation/native-stack'
|
||||||
|
|
||||||
|
import {chat} from '#/lexicons'
|
||||||
import {useAppState} from '#/lib/appState'
|
import {useAppState} from '#/lib/appState'
|
||||||
import {useInitialNumToRender} from '#/lib/hooks/useInitialNumToRender'
|
import {useInitialNumToRender} from '#/lib/hooks/useInitialNumToRender'
|
||||||
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
|
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
|
||||||
@@ -63,11 +63,11 @@ import {InboxRequests} from './components/InboxRequests'
|
|||||||
import {useIsWithinSplitView} from './components/splitView/context'
|
import {useIsWithinSplitView} from './components/splitView/context'
|
||||||
import {splitViewLeftScroll} from './components/splitView/leftColumnScroll'
|
import {splitViewLeftScroll} from './components/splitView/leftColumnScroll'
|
||||||
|
|
||||||
type ChatStatus = ChatBskyActorGetStatus.OutputSchema
|
type ChatStatus = chat.bsky.actor.getStatus.$OutputBody
|
||||||
|
|
||||||
type ListItem = {
|
type ListItem = {
|
||||||
type: 'CONVERSATION'
|
type: 'CONVERSATION'
|
||||||
conversation: ChatBskyConvoDefs.ConvoView
|
conversation: chat.bsky.convo.defs.ConvoView
|
||||||
selected: boolean
|
selected: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import {useCallback, useEffect, useMemo, useState} from 'react'
|
import {useCallback, useEffect, useMemo, useState} from 'react'
|
||||||
import {type LayoutChangeEvent, View} from 'react-native'
|
import {type LayoutChangeEvent, View} from 'react-native'
|
||||||
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
||||||
import {ChatBskyConvoDefs} from '@atproto/api'
|
|
||||||
import {
|
import {
|
||||||
ScrollEdgeEffect,
|
ScrollEdgeEffect,
|
||||||
ScrollEdgeEffectProvider,
|
ScrollEdgeEffectProvider,
|
||||||
@@ -16,6 +15,8 @@ import {
|
|||||||
} from '@react-navigation/native'
|
} from '@react-navigation/native'
|
||||||
import {type NativeStackScreenProps} from '@react-navigation/native-stack'
|
import {type NativeStackScreenProps} from '@react-navigation/native-stack'
|
||||||
|
|
||||||
|
import * as bsky from '#/types/bsky'
|
||||||
|
import {chat} from '#/lexicons'
|
||||||
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
|
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
|
||||||
import {useViewportZoomLock} from '#/lib/hooks/useViewportZoomLock'
|
import {useViewportZoomLock} from '#/lib/hooks/useViewportZoomLock'
|
||||||
import {moderateProfile} from '#/lib/moderation/subjects'
|
import {moderateProfile} from '#/lib/moderation/subjects'
|
||||||
@@ -179,7 +180,8 @@ function InnerReady({
|
|||||||
const emailDialogControl = useEmailDialogControl()
|
const emailDialogControl = useEmailDialogControl()
|
||||||
|
|
||||||
const unreadRequestCount =
|
const unreadRequestCount =
|
||||||
convo?.kind === 'group' && ChatBskyConvoDefs.isGroupConvo(convo.view.kind)
|
convo?.kind === 'group' &&
|
||||||
|
bsky.isType(chat.bsky.convo.defs.groupConvo, convo.view.kind)
|
||||||
? (convo.view.kind.unreadJoinRequestCount ?? 0)
|
? (convo.view.kind.unreadJoinRequestCount ?? 0)
|
||||||
: 0
|
: 0
|
||||||
const {mutate: markJoinRequestsRead} = useMarkJoinRequestsRead(convo?.view.id)
|
const {mutate: markJoinRequestsRead} = useMarkJoinRequestsRead(convo?.view.id)
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import {useEffect, useState} from 'react'
|
import {useEffect, useState} from 'react'
|
||||||
import {Pressable, View} from 'react-native'
|
import {Pressable, View} from 'react-native'
|
||||||
import {ChatBskyActorDefs, ChatBskyConvoDefs} from '@atproto/api'
|
|
||||||
import {type ModerationOpts} from '@bsky.app/sdk/moderation'
|
import {type ModerationOpts} from '@bsky.app/sdk/moderation'
|
||||||
import {Trans, useLingui} from '@lingui/react/macro'
|
import {Trans, useLingui} from '@lingui/react/macro'
|
||||||
import {useNavigation} from '@react-navigation/native'
|
import {useNavigation} from '@react-navigation/native'
|
||||||
@@ -171,15 +170,12 @@ function keyExtractor(item: Item) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function isGroupMember(
|
function isGroupMember(
|
||||||
member: ChatBskyActorDefs.ProfileViewBasic,
|
member: chat.bsky.actor.defs.ProfileViewBasic,
|
||||||
): member is GroupConvoMember {
|
): member is GroupConvoMember {
|
||||||
// Kind is missing when the account has been deleted.
|
// Kind is missing when the account has been deleted.
|
||||||
return (
|
return (
|
||||||
member.kind === undefined ||
|
member.kind === undefined ||
|
||||||
bsky.dangerousIsType<ChatBskyActorDefs.GroupConvoMember>(
|
bsky.isType(chat.bsky.actor.defs.groupConvoMember, member.kind)
|
||||||
member.kind,
|
|
||||||
ChatBskyActorDefs.isGroupConvoMember,
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -415,7 +411,7 @@ function SettingsHeader({
|
|||||||
isPending: isLocking,
|
isPending: isLocking,
|
||||||
} = useLockConvo(convoId, {
|
} = useLockConvo(convoId, {
|
||||||
onSuccess: (data, {silent}) => {
|
onSuccess: (data, {silent}) => {
|
||||||
if (!ChatBskyConvoDefs.isGroupConvo(data.convo.kind)) return
|
if (!bsky.isType(chat.bsky.convo.defs.groupConvo, data.convo.kind)) return
|
||||||
if (silent) return
|
if (silent) return
|
||||||
if (data.convo.kind.lockStatus === 'locked') {
|
if (data.convo.kind.lockStatus === 'locked') {
|
||||||
ax.metric('groupchat:owner:lock', {convoId})
|
ax.metric('groupchat:owner:lock', {convoId})
|
||||||
|
|||||||
@@ -1,10 +1,5 @@
|
|||||||
import {useCallback, useMemo, useState} from 'react'
|
import {useCallback, useMemo, useState} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {
|
|
||||||
ChatBskyConvoDefs,
|
|
||||||
type ChatBskyConvoListConvoRequests,
|
|
||||||
ChatBskyGroupDefs,
|
|
||||||
} from '@atproto/api'
|
|
||||||
import {Trans, useLingui} from '@lingui/react/macro'
|
import {Trans, useLingui} from '@lingui/react/macro'
|
||||||
import {useFocusEffect, useNavigation} from '@react-navigation/native'
|
import {useFocusEffect, useNavigation} from '@react-navigation/native'
|
||||||
import {
|
import {
|
||||||
@@ -12,6 +7,8 @@ import {
|
|||||||
type UseInfiniteQueryResult,
|
type UseInfiniteQueryResult,
|
||||||
} from '@tanstack/react-query'
|
} from '@tanstack/react-query'
|
||||||
|
|
||||||
|
import * as bsky from '#/types/bsky'
|
||||||
|
import {chat} from '#/lexicons'
|
||||||
import {useAppState} from '#/lib/appState'
|
import {useAppState} from '#/lib/appState'
|
||||||
import {useInitialNumToRender} from '#/lib/hooks/useInitialNumToRender'
|
import {useInitialNumToRender} from '#/lib/hooks/useInitialNumToRender'
|
||||||
import {
|
import {
|
||||||
@@ -51,8 +48,8 @@ import {useIsWithinSplitView} from './components/splitView/context'
|
|||||||
type Props = NativeStackScreenProps<CommonNavigatorParams, 'MessagesInbox'>
|
type Props = NativeStackScreenProps<CommonNavigatorParams, 'MessagesInbox'>
|
||||||
|
|
||||||
type RequestItem =
|
type RequestItem =
|
||||||
| {type: 'incoming'; view: ChatBskyConvoDefs.ConvoView}
|
| {type: 'incoming'; view: chat.bsky.convo.defs.ConvoView}
|
||||||
| {type: 'outgoing'; view: ChatBskyGroupDefs.JoinRequestConvoView}
|
| {type: 'outgoing'; view: chat.bsky.group.defs.JoinRequestConvoView}
|
||||||
|
|
||||||
export function MessagesInboxScreen(props: Props) {
|
export function MessagesInboxScreen(props: Props) {
|
||||||
const {t: l} = useLingui()
|
const {t: l} = useLingui()
|
||||||
@@ -75,9 +72,11 @@ export function MessagesInboxScreenInner({}: Props) {
|
|||||||
const items: RequestItem[] = []
|
const items: RequestItem[] = []
|
||||||
for (const page of data.pages) {
|
for (const page of data.pages) {
|
||||||
for (const item of page.requests) {
|
for (const item of page.requests) {
|
||||||
if (ChatBskyConvoDefs.isConvoView(item)) {
|
if (bsky.isType(chat.bsky.convo.defs.convoView, item)) {
|
||||||
items.push({type: 'incoming', view: item})
|
items.push({type: 'incoming', view: item})
|
||||||
} else if (ChatBskyGroupDefs.isJoinRequestConvoView(item)) {
|
} else if (
|
||||||
|
bsky.isType(chat.bsky.group.defs.joinRequestConvoView, item)
|
||||||
|
) {
|
||||||
items.push({type: 'outgoing', view: item})
|
items.push({type: 'outgoing', view: item})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -112,7 +111,7 @@ function RequestList({
|
|||||||
conversations,
|
conversations,
|
||||||
}: {
|
}: {
|
||||||
listConvosQuery: UseInfiniteQueryResult<
|
listConvosQuery: UseInfiniteQueryResult<
|
||||||
InfiniteData<ChatBskyConvoListConvoRequests.OutputSchema>,
|
InfiniteData<chat.bsky.convo.listConvoRequests.$OutputBody>,
|
||||||
Error
|
Error
|
||||||
>
|
>
|
||||||
conversations: RequestItem[]
|
conversations: RequestItem[]
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import {useEffect} from 'react'
|
import {useEffect} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {ImageBackground} from 'expo-image'
|
import {ImageBackground} from 'expo-image'
|
||||||
import {ChatBskyGroupDefs} from '@atproto/api'
|
|
||||||
import {type ThemeName} from '@bsky.app/alf'
|
import {type ThemeName} from '@bsky.app/alf'
|
||||||
import {Trans, useLingui} from '@lingui/react/macro'
|
import {Trans, useLingui} from '@lingui/react/macro'
|
||||||
|
|
||||||
|
import * as bsky from '#/types/bsky'
|
||||||
|
import {chat} from '#/lexicons'
|
||||||
import {createSanitizedDisplayName} from '#/lib/moderation/create-sanitized-display-name'
|
import {createSanitizedDisplayName} from '#/lib/moderation/create-sanitized-display-name'
|
||||||
import {moderateProfile} from '#/lib/moderation/subjects'
|
import {moderateProfile} from '#/lib/moderation/subjects'
|
||||||
import {sanitizeHandle} from '#/lib/strings/handles'
|
import {sanitizeHandle} from '#/lib/strings/handles'
|
||||||
@@ -84,7 +85,10 @@ export function JoinRequest({setScreenState}: Props) {
|
|||||||
]}>
|
]}>
|
||||||
{error ||
|
{error ||
|
||||||
(data &&
|
(data &&
|
||||||
!ChatBskyGroupDefs.isJoinLinkPreviewView(joinLinkPreview)) ? (
|
!bsky.isType(
|
||||||
|
chat.bsky.group.defs.joinLinkPreviewView,
|
||||||
|
joinLinkPreview,
|
||||||
|
)) ? (
|
||||||
<Wrapper>
|
<Wrapper>
|
||||||
<ChainLinkBrokenIcon fill={t.palette.primary_500} size="3xl" />
|
<ChainLinkBrokenIcon fill={t.palette.primary_500} size="3xl" />
|
||||||
<Text
|
<Text
|
||||||
@@ -101,7 +105,10 @@ export function JoinRequest({setScreenState}: Props) {
|
|||||||
</Wrapper>
|
</Wrapper>
|
||||||
) : data &&
|
) : data &&
|
||||||
moderationOpts &&
|
moderationOpts &&
|
||||||
ChatBskyGroupDefs.isJoinLinkPreviewView(joinLinkPreview) ? (
|
bsky.isType(
|
||||||
|
chat.bsky.group.defs.joinLinkPreviewView,
|
||||||
|
joinLinkPreview,
|
||||||
|
) ? (
|
||||||
<Wrapper>
|
<Wrapper>
|
||||||
<AvatarBubbles
|
<AvatarBubbles
|
||||||
profiles={[joinLinkPreview.owner]}
|
profiles={[joinLinkPreview.owner]}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import {useState} from 'react'
|
import {useState} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {type ChatBskyGroupListJoinRequests} from '@atproto/api'
|
|
||||||
import {Plural, Trans, useLingui} from '@lingui/react/macro'
|
import {Plural, Trans, useLingui} from '@lingui/react/macro'
|
||||||
import {useNavigation} from '@react-navigation/native'
|
import {useNavigation} from '@react-navigation/native'
|
||||||
import {type InfiniteData, useQueryClient} from '@tanstack/react-query'
|
import {type InfiniteData, useQueryClient} from '@tanstack/react-query'
|
||||||
@@ -140,7 +139,7 @@ function JoinRequestsList({
|
|||||||
|
|
||||||
const getRemainingRequestCount = () => {
|
const getRemainingRequestCount = () => {
|
||||||
const data = queryClient.getQueryData<
|
const data = queryClient.getQueryData<
|
||||||
InfiniteData<ChatBskyGroupListJoinRequests.OutputSchema>
|
InfiniteData<chat.bsky.group.listJoinRequests.$OutputBody>
|
||||||
>(createListJoinRequestsQueryKey({convoId}))
|
>(createListJoinRequestsQueryKey({convoId}))
|
||||||
return data?.pages.reduce((sum, page) => sum + page.requests.length, 0) ?? 0
|
return data?.pages.reduce((sum, page) => sum + page.requests.length, 0) ?? 0
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import {useCallback, useState} from 'react'
|
import {useCallback, useState} from 'react'
|
||||||
import {type StyleProp, View, type ViewStyle} from 'react-native'
|
import {type StyleProp, View, type ViewStyle} from 'react-native'
|
||||||
import {ToolsOzoneReportDefs} from '@atproto/api'
|
|
||||||
import {type DidString} from '@atproto/syntax'
|
import {type DidString} from '@atproto/syntax'
|
||||||
import {Trans, useLingui} from '@lingui/react/macro'
|
import {Trans, useLingui} from '@lingui/react/macro'
|
||||||
import {useMutation} from '@tanstack/react-query'
|
import {useMutation} from '@tanstack/react-query'
|
||||||
@@ -15,7 +14,7 @@ import {Warning_Stroke2_Corner0_Rounded as WarningIcon} from '#/components/icons
|
|||||||
import {Loader} from '#/components/Loader'
|
import {Loader} from '#/components/Loader'
|
||||||
import * as Toast from '#/components/Toast'
|
import * as Toast from '#/components/Toast'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import {com} from '#/lexicons'
|
import {com, tools} from '#/lexicons'
|
||||||
|
|
||||||
export function ChatDisabled({
|
export function ChatDisabled({
|
||||||
shape = 'pill',
|
shape = 'pill',
|
||||||
@@ -104,7 +103,7 @@ function DialogInner() {
|
|||||||
await client.call(
|
await client.call(
|
||||||
com.atproto.moderation.createReport,
|
com.atproto.moderation.createReport,
|
||||||
{
|
{
|
||||||
reasonType: ToolsOzoneReportDefs.REASONAPPEAL,
|
reasonType: tools.ozone.report.defs.reasonAppeal,
|
||||||
subject: {
|
subject: {
|
||||||
$type: 'com.atproto.admin.defs#repoRef',
|
$type: 'com.atproto.admin.defs#repoRef',
|
||||||
// the persisted account did is already resolved
|
// the persisted account did is already resolved
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import {useCallback, useMemo, useState} from 'react'
|
import {useCallback, useMemo, useState} from 'react'
|
||||||
import {type GestureResponderEvent, View} from 'react-native'
|
import {type GestureResponderEvent, View} from 'react-native'
|
||||||
import {ChatBskyConvoDefs} from '@atproto/api'
|
|
||||||
import {
|
import {
|
||||||
type ModerationDecision,
|
type ModerationDecision,
|
||||||
type ModerationOpts,
|
type ModerationOpts,
|
||||||
@@ -9,6 +8,7 @@ import {plural} from '@lingui/core/macro'
|
|||||||
import {useLingui} from '@lingui/react/macro'
|
import {useLingui} from '@lingui/react/macro'
|
||||||
import {useQueryClient} from '@tanstack/react-query'
|
import {useQueryClient} from '@tanstack/react-query'
|
||||||
|
|
||||||
|
import {chat} from '#/lexicons'
|
||||||
import {GestureActionView} from '#/lib/custom-animations/GestureActionView'
|
import {GestureActionView} from '#/lib/custom-animations/GestureActionView'
|
||||||
import {useHaptics} from '#/lib/haptics'
|
import {useHaptics} from '#/lib/haptics'
|
||||||
import {createSanitizedDisplayName} from '#/lib/moderation/create-sanitized-display-name'
|
import {createSanitizedDisplayName} from '#/lib/moderation/create-sanitized-display-name'
|
||||||
@@ -53,7 +53,7 @@ import {ProfileBadges} from '#/components/ProfileBadges'
|
|||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import {useAnalytics} from '#/analytics'
|
import {useAnalytics} from '#/analytics'
|
||||||
import {IS_NATIVE} from '#/env'
|
import {IS_NATIVE} from '#/env'
|
||||||
import type * as bsky from '#/types/bsky'
|
import * as bsky from '#/types/bsky'
|
||||||
import {useIsWithinSplitView} from './splitView/context'
|
import {useIsWithinSplitView} from './splitView/context'
|
||||||
|
|
||||||
export const ChatListItemPortal = createPortalGroup()
|
export const ChatListItemPortal = createPortalGroup()
|
||||||
@@ -64,7 +64,7 @@ export function ChatListItem({
|
|||||||
selected = false,
|
selected = false,
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
convo: ChatBskyConvoDefs.ConvoView
|
convo: chat.bsky.convo.defs.ConvoView
|
||||||
showMenu?: boolean
|
showMenu?: boolean
|
||||||
selected?: boolean
|
selected?: boolean
|
||||||
children?: React.ReactNode
|
children?: React.ReactNode
|
||||||
@@ -314,7 +314,12 @@ function BaseChatItem({
|
|||||||
let lastMessageSentAt: string | null = null
|
let lastMessageSentAt: string | null = null
|
||||||
|
|
||||||
// Deleted message
|
// Deleted message
|
||||||
if (ChatBskyConvoDefs.isDeletedMessageView(convo.view.lastMessage)) {
|
if (
|
||||||
|
bsky.isType(
|
||||||
|
chat.bsky.convo.defs.deletedMessageView,
|
||||||
|
convo.view.lastMessage,
|
||||||
|
)
|
||||||
|
) {
|
||||||
lastMessageSentAt = convo.view.lastMessage.sentAt
|
lastMessageSentAt = convo.view.lastMessage.sentAt
|
||||||
|
|
||||||
lastMessage = isDeletedAccount
|
lastMessage = isDeletedAccount
|
||||||
@@ -323,7 +328,7 @@ function BaseChatItem({
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Message
|
// Message
|
||||||
if (ChatBskyConvoDefs.isMessageView(convo.view.lastMessage)) {
|
if (bsky.isType(chat.bsky.convo.defs.messageView, convo.view.lastMessage)) {
|
||||||
const info = getMessageInfo({
|
const info = getMessageInfo({
|
||||||
convo: convo.view,
|
convo: convo.view,
|
||||||
currentAccountDid: currentAccount?.did,
|
currentAccountDid: currentAccount?.did,
|
||||||
@@ -339,7 +344,12 @@ function BaseChatItem({
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Reaction
|
// Reaction
|
||||||
if (ChatBskyConvoDefs.isMessageAndReactionView(convo.view.lastReaction)) {
|
if (
|
||||||
|
bsky.isType(
|
||||||
|
chat.bsky.convo.defs.messageAndReactionView,
|
||||||
|
convo.view.lastReaction,
|
||||||
|
)
|
||||||
|
) {
|
||||||
const info = getReactionInfo({
|
const info = getReactionInfo({
|
||||||
convo: convo.view,
|
convo: convo.view,
|
||||||
currentAccountDid: currentAccount?.did,
|
currentAccountDid: currentAccount?.did,
|
||||||
@@ -358,7 +368,12 @@ function BaseChatItem({
|
|||||||
}
|
}
|
||||||
|
|
||||||
// System message
|
// System message
|
||||||
if (ChatBskyConvoDefs.isSystemMessageView(convo.view.lastMessage)) {
|
if (
|
||||||
|
bsky.isType(
|
||||||
|
chat.bsky.convo.defs.systemMessageView,
|
||||||
|
convo.view.lastMessage,
|
||||||
|
)
|
||||||
|
) {
|
||||||
const info = getSystemMessageInfo(
|
const info = getSystemMessageInfo(
|
||||||
convo.view.lastMessage.data,
|
convo.view.lastMessage.data,
|
||||||
new Map(convo.view.members.map(m => [m.did, m])),
|
new Map(convo.view.members.map(m => [m.did, m])),
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {type ChatBskyConvoDefs} from '@atproto/api'
|
|
||||||
import {Trans} from '@lingui/react/macro'
|
import {Trans} from '@lingui/react/macro'
|
||||||
|
|
||||||
|
import {chat} from '#/lexicons'
|
||||||
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
||||||
import {useSession} from '#/state/session'
|
import {useSession} from '#/state/session'
|
||||||
import {atoms as a, tokens} from '#/alf'
|
import {atoms as a, tokens} from '#/alf'
|
||||||
@@ -14,7 +14,7 @@ import {AcceptChatButton, DeleteChatButton, RejectMenu} from './RequestButtons'
|
|||||||
export function IncomingRequestListItem({
|
export function IncomingRequestListItem({
|
||||||
convo: convoView,
|
convo: convoView,
|
||||||
}: {
|
}: {
|
||||||
convo: ChatBskyConvoDefs.ConvoView
|
convo: chat.bsky.convo.defs.ConvoView
|
||||||
}) {
|
}) {
|
||||||
const {currentAccount} = useSession()
|
const {currentAccount} = useSession()
|
||||||
const moderationOpts = useModerationOpts()
|
const moderationOpts = useModerationOpts()
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import {useState} from 'react'
|
import {useState} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {Image} from 'expo-image'
|
import {Image} from 'expo-image'
|
||||||
import {type ChatBskyGroupDefs} from '@atproto/api'
|
|
||||||
import {type ModerationOpts} from '@bsky.app/sdk/moderation'
|
import {type ModerationOpts} from '@bsky.app/sdk/moderation'
|
||||||
import {Plural, Trans, useLingui} from '@lingui/react/macro'
|
import {Plural, Trans, useLingui} from '@lingui/react/macro'
|
||||||
|
|
||||||
|
import {chat} from '#/lexicons'
|
||||||
import {useOpenComposer} from '#/lib/hooks/useOpenComposer'
|
import {useOpenComposer} from '#/lib/hooks/useOpenComposer'
|
||||||
import {createSanitizedDisplayName} from '#/lib/moderation/create-sanitized-display-name'
|
import {createSanitizedDisplayName} from '#/lib/moderation/create-sanitized-display-name'
|
||||||
import {moderateProfile} from '#/lib/moderation/subjects'
|
import {moderateProfile} from '#/lib/moderation/subjects'
|
||||||
@@ -560,13 +560,13 @@ export function InviteLinkDialog({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function joinLinkToKey(joinLink: ChatBskyGroupDefs.JoinLinkView): string {
|
function joinLinkToKey(joinLink: chat.bsky.group.defs.JoinLinkView): string {
|
||||||
return `${joinLink.joinRule}${joinLink.requireApproval ? ':requireApproval' : ''}`
|
return `${joinLink.joinRule}${joinLink.requireApproval ? ':requireApproval' : ''}`
|
||||||
}
|
}
|
||||||
|
|
||||||
function keyToJoinLink(
|
function keyToJoinLink(
|
||||||
key: string,
|
key: string,
|
||||||
): Pick<ChatBskyGroupDefs.JoinLinkView, 'joinRule' | 'requireApproval'> {
|
): Pick<chat.bsky.group.defs.JoinLinkView, 'joinRule' | 'requireApproval'> {
|
||||||
const [joinRule, requireApproval] = key.split(':')
|
const [joinRule, requireApproval] = key.split(':')
|
||||||
return {
|
return {
|
||||||
joinRule,
|
joinRule,
|
||||||
|
|||||||
@@ -13,11 +13,12 @@ import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
|||||||
import {scheduleOnRN} from 'react-native-worklets'
|
import {scheduleOnRN} from 'react-native-worklets'
|
||||||
import {GlassContainer} from 'expo-glass-effect'
|
import {GlassContainer} from 'expo-glass-effect'
|
||||||
import {LinearGradient} from 'expo-linear-gradient'
|
import {LinearGradient} from 'expo-linear-gradient'
|
||||||
import {type $Typed, type ChatBskyConvoDefs} from '@atproto/api'
|
|
||||||
import {ScrollEdgeEffect} from '@bsky.app/expo-scroll-edge-effect'
|
import {ScrollEdgeEffect} from '@bsky.app/expo-scroll-edge-effect'
|
||||||
import {useLingui} from '@lingui/react/macro'
|
import {useLingui} from '@lingui/react/macro'
|
||||||
import {countGraphemes} from 'unicode-segmenter/grapheme'
|
import {countGraphemes} from 'unicode-segmenter/grapheme'
|
||||||
|
|
||||||
|
import {type $Typed} from '@atproto/lex'
|
||||||
|
import {chat} from '#/lexicons'
|
||||||
import {HITSLOP_10, MAX_DM_GRAPHEME_LENGTH} from '#/lib/constants'
|
import {HITSLOP_10, MAX_DM_GRAPHEME_LENGTH} from '#/lib/constants'
|
||||||
import {useHaptics} from '#/lib/haptics'
|
import {useHaptics} from '#/lib/haptics'
|
||||||
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
|
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
|
||||||
@@ -53,7 +54,7 @@ export function MessageComposer({
|
|||||||
onSendMessage: (
|
onSendMessage: (
|
||||||
message: string,
|
message: string,
|
||||||
embed?: MessageEmbedState,
|
embed?: MessageEmbedState,
|
||||||
replyTo?: $Typed<ChatBskyConvoDefs.MessageView>,
|
replyTo?: $Typed<chat.bsky.convo.defs.MessageView>,
|
||||||
) => void
|
) => void
|
||||||
messageEmbed: MessageEmbedState | undefined
|
messageEmbed: MessageEmbedState | undefined
|
||||||
setEmbed: (embedUrl: string | undefined) => void
|
setEmbed: (embedUrl: string | undefined) => void
|
||||||
@@ -106,7 +107,7 @@ export function MessageComposer({
|
|||||||
const onSubmit = (
|
const onSubmit = (
|
||||||
message: string,
|
message: string,
|
||||||
embed: MessageEmbedState | undefined,
|
embed: MessageEmbedState | undefined,
|
||||||
replyTo: ChatBskyConvoDefs.MessageView | null,
|
replyTo: chat.bsky.convo.defs.MessageView | null,
|
||||||
) => {
|
) => {
|
||||||
if (!editable) return
|
if (!editable) return
|
||||||
if (!embed && message.trim() === '') return
|
if (!embed && message.trim() === '') return
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import {useCallback, useEffect, useMemo, useState} from 'react'
|
import {useCallback, useEffect, useMemo, useState} from 'react'
|
||||||
import {LayoutAnimation, View} from 'react-native'
|
import {LayoutAnimation, View} from 'react-native'
|
||||||
import {AppBskyFeedPost, AtUri} from '@atproto/api'
|
|
||||||
import {RichText as RichTextAPI} from '@bsky.app/sdk/richtext'
|
import {RichText as RichTextAPI} from '@bsky.app/sdk/richtext'
|
||||||
import {Trans, useLingui} from '@lingui/react/macro'
|
import {Trans, useLingui} from '@lingui/react/macro'
|
||||||
import {type RouteProp, useNavigation, useRoute} from '@react-navigation/native'
|
import {type RouteProp, useNavigation, useRoute} from '@react-navigation/native'
|
||||||
|
|
||||||
|
import {AtUri} from '@atproto/syntax'
|
||||||
import {HITSLOP_20} from '#/lib/constants'
|
import {HITSLOP_20} from '#/lib/constants'
|
||||||
import {moderatePost} from '#/lib/moderation/subjects'
|
import {moderatePost} from '#/lib/moderation/subjects'
|
||||||
import {makeProfileLink} from '#/lib/routes/links'
|
import {makeProfileLink} from '#/lib/routes/links'
|
||||||
@@ -164,13 +164,7 @@ function MessageInputPostEmbed({
|
|||||||
)
|
)
|
||||||
|
|
||||||
const {rt, record} = useMemo(() => {
|
const {rt, record} = useMemo(() => {
|
||||||
if (
|
if (post && bsky.isType(app.bsky.feed.post, post.record)) {
|
||||||
post &&
|
|
||||||
bsky.dangerousIsType<AppBskyFeedPost.Record>(
|
|
||||||
post.record,
|
|
||||||
AppBskyFeedPost.isRecord,
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
return {
|
return {
|
||||||
rt: new RichTextAPI({
|
rt: new RichTextAPI({
|
||||||
text: post.record.text,
|
text: post.record.text,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {LayoutAnimation, View} from 'react-native'
|
import {LayoutAnimation, View} from 'react-native'
|
||||||
import {type ChatBskyConvoDefs} from '@atproto/api'
|
|
||||||
import {useLingui} from '@lingui/react/macro'
|
import {useLingui} from '@lingui/react/macro'
|
||||||
|
|
||||||
|
import {chat} from '#/lexicons'
|
||||||
import {HITSLOP_20} from '#/lib/constants'
|
import {HITSLOP_20} from '#/lib/constants'
|
||||||
import {createSanitizedDisplayName} from '#/lib/moderation/create-sanitized-display-name'
|
import {createSanitizedDisplayName} from '#/lib/moderation/create-sanitized-display-name'
|
||||||
import {useConvoActive} from '#/state/messages/convo'
|
import {useConvoActive} from '#/state/messages/convo'
|
||||||
@@ -29,7 +29,7 @@ export function MessageInputReply() {
|
|||||||
function MessageInputReplyInner({
|
function MessageInputReplyInner({
|
||||||
replyTo,
|
replyTo,
|
||||||
}: {
|
}: {
|
||||||
replyTo: ChatBskyConvoDefs.MessageView
|
replyTo: chat.bsky.convo.defs.MessageView
|
||||||
}) {
|
}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const {t: l} = useLingui()
|
const {t: l} = useLingui()
|
||||||
|
|||||||
@@ -22,16 +22,10 @@ import Animated, {
|
|||||||
} from 'react-native-reanimated'
|
} from 'react-native-reanimated'
|
||||||
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
||||||
import {scheduleOnRN} from 'react-native-worklets'
|
import {scheduleOnRN} from 'react-native-worklets'
|
||||||
import {
|
|
||||||
type $Typed,
|
|
||||||
type AppBskyEmbedRecord,
|
|
||||||
ChatBskyConvoDefs,
|
|
||||||
type ChatBskyEmbedJoinLink,
|
|
||||||
ChatBskyGroupDefs,
|
|
||||||
} from '@atproto/api'
|
|
||||||
import {useScrollEdgeEffectRef} from '@bsky.app/expo-scroll-edge-effect'
|
import {useScrollEdgeEffectRef} from '@bsky.app/expo-scroll-edge-effect'
|
||||||
import {RichText} from '@bsky.app/sdk/richtext'
|
import {RichText} from '@bsky.app/sdk/richtext'
|
||||||
|
|
||||||
|
import {type $Typed} from '@atproto/lex'
|
||||||
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
|
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
|
||||||
import {mergeRefs} from '#/lib/merge-refs'
|
import {mergeRefs} from '#/lib/merge-refs'
|
||||||
import {ScrollProvider} from '#/lib/ScrollContext'
|
import {ScrollProvider} from '#/lib/ScrollContext'
|
||||||
@@ -70,7 +64,7 @@ import {Loader} from '#/components/Loader'
|
|||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import {useAnalytics} from '#/analytics'
|
import {useAnalytics} from '#/analytics'
|
||||||
import {IS_ANDROID, IS_NATIVE, IS_WEB} from '#/env'
|
import {IS_ANDROID, IS_NATIVE, IS_WEB} from '#/env'
|
||||||
import {app, type chat, type com} from '#/lexicons'
|
import {app, chat, type com} from '#/lexicons'
|
||||||
import * as bsky from '#/types/bsky'
|
import * as bsky from '#/types/bsky'
|
||||||
import {ChatStatusInfo} from './ChatStatusInfo'
|
import {ChatStatusInfo} from './ChatStatusInfo'
|
||||||
import {groupSystemMessages, type RenderItem} from './groupSystemMessages'
|
import {groupSystemMessages, type RenderItem} from './groupSystemMessages'
|
||||||
@@ -117,8 +111,8 @@ function getNeighborMessage(
|
|||||||
neighbor.type === 'deleted-message'
|
neighbor.type === 'deleted-message'
|
||||||
) {
|
) {
|
||||||
if (
|
if (
|
||||||
ChatBskyConvoDefs.isMessageView(neighbor.message) ||
|
bsky.isType(chat.bsky.convo.defs.messageView, neighbor.message) ||
|
||||||
ChatBskyConvoDefs.isDeletedMessageView(neighbor.message)
|
bsky.isType(chat.bsky.convo.defs.deletedMessageView, neighbor.message)
|
||||||
) {
|
) {
|
||||||
return neighbor.message
|
return neighbor.message
|
||||||
}
|
}
|
||||||
@@ -525,7 +519,7 @@ export function MessagesList({
|
|||||||
async (
|
async (
|
||||||
text: string,
|
text: string,
|
||||||
embedState?: MessageEmbedState,
|
embedState?: MessageEmbedState,
|
||||||
reply?: $Typed<ChatBskyConvoDefs.MessageView>,
|
reply?: $Typed<chat.bsky.convo.defs.MessageView>,
|
||||||
) => {
|
) => {
|
||||||
let rt = new RichText({text: text.trimEnd()}, {cleanNewlines: true})
|
let rt = new RichText({text: text.trimEnd()}, {cleanNewlines: true})
|
||||||
|
|
||||||
@@ -539,10 +533,10 @@ export function MessagesList({
|
|||||||
|
|
||||||
let embed: chat.bsky.convo.defs.MessageInput['embed']
|
let embed: chat.bsky.convo.defs.MessageInput['embed']
|
||||||
let embedView:
|
let embedView:
|
||||||
| $Typed<AppBskyEmbedRecord.View>
|
| $Typed<app.bsky.embed.record.View>
|
||||||
| $Typed<ChatBskyEmbedJoinLink.View>
|
| $Typed<chat.bsky.embed.joinLink.View>
|
||||||
| undefined
|
| undefined
|
||||||
let replyTo: ChatBskyConvoDefs.ReplyRef | undefined
|
let replyTo: chat.bsky.convo.defs.ReplyRef | undefined
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find the embedded link facet and, if it's at the start or end of the
|
* Find the embedded link facet and, if it's at the start or end of the
|
||||||
@@ -666,7 +660,10 @@ export function MessagesList({
|
|||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
embedView?.$type === 'chat.bsky.embed.joinLink#view' &&
|
embedView?.$type === 'chat.bsky.embed.joinLink#view' &&
|
||||||
ChatBskyGroupDefs.isJoinLinkPreviewView(embedView.joinLinkPreview)
|
bsky.isType(
|
||||||
|
chat.bsky.group.defs.joinLinkPreviewView,
|
||||||
|
embedView.joinLinkPreview,
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
ax.metric('groupchat:inviteLink:shared', {
|
ax.metric('groupchat:inviteLink:shared', {
|
||||||
convoId: embedView.joinLinkPreview.convoId,
|
convoId: embedView.joinLinkPreview.convoId,
|
||||||
@@ -904,7 +901,7 @@ function Composer({
|
|||||||
onSendMessage: (
|
onSendMessage: (
|
||||||
message: string,
|
message: string,
|
||||||
embed?: MessageEmbedState,
|
embed?: MessageEmbedState,
|
||||||
replyTo?: $Typed<ChatBskyConvoDefs.MessageView>,
|
replyTo?: $Typed<chat.bsky.convo.defs.MessageView>,
|
||||||
) => Promise<void>
|
) => Promise<void>
|
||||||
messageEmbed: MessageEmbedState | undefined
|
messageEmbed: MessageEmbedState | undefined
|
||||||
setEmbed: (embedUrl: string | undefined) => void
|
setEmbed: (embedUrl: string | undefined) => void
|
||||||
@@ -914,7 +911,7 @@ function Composer({
|
|||||||
(
|
(
|
||||||
message: string,
|
message: string,
|
||||||
embed?: MessageEmbedState,
|
embed?: MessageEmbedState,
|
||||||
replyTo?: $Typed<ChatBskyConvoDefs.MessageView>,
|
replyTo?: $Typed<chat.bsky.convo.defs.MessageView>,
|
||||||
) => {
|
) => {
|
||||||
void onSendMessage(message, embed, replyTo)
|
void onSendMessage(message, embed, replyTo)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {type ChatBskyGroupDefs} from '@atproto/api'
|
|
||||||
import {Trans, useLingui} from '@lingui/react/macro'
|
import {Trans, useLingui} from '@lingui/react/macro'
|
||||||
|
|
||||||
import {isNetworkError} from '#/lib/strings/errors'
|
import {isNetworkError} from '#/lib/strings/errors'
|
||||||
@@ -17,7 +16,7 @@ import {chat} from '#/lexicons'
|
|||||||
export function OutgoingRequestListItem({
|
export function OutgoingRequestListItem({
|
||||||
convo: convoView,
|
convo: convoView,
|
||||||
}: {
|
}: {
|
||||||
convo: ChatBskyGroupDefs.JoinRequestConvoView
|
convo: chat.bsky.group.defs.JoinRequestConvoView
|
||||||
}) {
|
}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const {t: l} = useLingui()
|
const {t: l} = useLingui()
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import {useCallback} from 'react'
|
import {useCallback} from 'react'
|
||||||
import {type ChatBskyActorDefs, type ChatBskyConvoDefs} from '@atproto/api'
|
|
||||||
import {Trans, useLingui} from '@lingui/react/macro'
|
import {Trans, useLingui} from '@lingui/react/macro'
|
||||||
import {StackActions, useNavigation} from '@react-navigation/native'
|
import {StackActions, useNavigation} from '@react-navigation/native'
|
||||||
import {useQueryClient} from '@tanstack/react-query'
|
import {useQueryClient} from '@tanstack/react-query'
|
||||||
|
|
||||||
|
import {chat} from '#/lexicons'
|
||||||
import {type NavigationProp} from '#/lib/routes/types'
|
import {type NavigationProp} from '#/lib/routes/types'
|
||||||
import {useProfileShadow} from '#/state/cache/profile-shadow'
|
import {useProfileShadow} from '#/state/cache/profile-shadow'
|
||||||
import {useEmail} from '#/state/email-verification'
|
import {useEmail} from '#/state/email-verification'
|
||||||
@@ -56,7 +56,7 @@ export function RejectMenu({
|
|||||||
label?: string
|
label?: string
|
||||||
icon?: boolean
|
icon?: boolean
|
||||||
convo: ConvoWithDetails
|
convo: ConvoWithDetails
|
||||||
profile: ChatBskyActorDefs.ProfileViewBasic
|
profile: chat.bsky.actor.defs.ProfileViewBasic
|
||||||
showDeleteConvo?: boolean
|
showDeleteConvo?: boolean
|
||||||
currentScreen: 'list' | 'conversation'
|
currentScreen: 'list' | 'conversation'
|
||||||
}) {
|
}) {
|
||||||
@@ -214,7 +214,7 @@ export function AcceptChatButton({
|
|||||||
}: Omit<ButtonProps, 'onPress' | 'children' | 'label'> & {
|
}: Omit<ButtonProps, 'onPress' | 'children' | 'label'> & {
|
||||||
label?: string
|
label?: string
|
||||||
icon?: boolean
|
icon?: boolean
|
||||||
convo: ChatBskyConvoDefs.ConvoView
|
convo: chat.bsky.convo.defs.ConvoView
|
||||||
onAcceptConvo?: () => void
|
onAcceptConvo?: () => void
|
||||||
currentScreen: 'list' | 'conversation'
|
currentScreen: 'list' | 'conversation'
|
||||||
}) {
|
}) {
|
||||||
@@ -301,7 +301,7 @@ export function DeleteChatButton({
|
|||||||
}: Omit<ButtonProps, 'children' | 'label'> & {
|
}: Omit<ButtonProps, 'children' | 'label'> & {
|
||||||
label?: string
|
label?: string
|
||||||
icon?: boolean
|
icon?: boolean
|
||||||
convo: ChatBskyConvoDefs.ConvoView
|
convo: chat.bsky.convo.defs.ConvoView
|
||||||
currentScreen: 'list' | 'conversation'
|
currentScreen: 'list' | 'conversation'
|
||||||
}) {
|
}) {
|
||||||
const {t: l} = useLingui()
|
const {t: l} = useLingui()
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import {useState} from 'react'
|
import {useState} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {type AppBskyGraphDefs, AppBskyGraphStarterpack} from '@atproto/api'
|
|
||||||
import {type AtUriString} from '@atproto/syntax'
|
import {type AtUriString} from '@atproto/syntax'
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {Trans} from '@lingui/react/macro'
|
import {Trans} from '@lingui/react/macro'
|
||||||
import {useQueryClient} from '@tanstack/react-query'
|
import {useQueryClient} from '@tanstack/react-query'
|
||||||
|
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {batchedUpdates} from '#/lib/batchedUpdates'
|
import {batchedUpdates} from '#/lib/batchedUpdates'
|
||||||
import {isBlockedOrBlocking, isMuted} from '#/lib/moderation/blocked-and-muted'
|
import {isBlockedOrBlocking, isMuted} from '#/lib/moderation/blocked-and-muted'
|
||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
@@ -29,7 +29,7 @@ const IGNORED_ACCOUNT = 'did:plc:pifkcjimdcfwaxkanzhwxufp'
|
|||||||
export function StarterPackCard({
|
export function StarterPackCard({
|
||||||
view,
|
view,
|
||||||
}: {
|
}: {
|
||||||
view: AppBskyGraphDefs.StarterPackView
|
view: app.bsky.graph.defs.StarterPackView
|
||||||
}) {
|
}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
@@ -48,7 +48,7 @@ export function StarterPackCard({
|
|||||||
|
|
||||||
setIsProcessing(true)
|
setIsProcessing(true)
|
||||||
|
|
||||||
let listItems: AppBskyGraphDefs.ListItemView[] = []
|
let listItems: app.bsky.graph.defs.ListItemView[] = []
|
||||||
try {
|
try {
|
||||||
listItems = await getAllListMembers(appviewClient, view.list.uri)
|
listItems = await getAllListMembers(appviewClient, view.list.uri)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -105,12 +105,7 @@ export function StarterPackCard({
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (!bsky.isType(app.bsky.graph.starterpack, record)) {
|
||||||
!bsky.dangerousIsType<AppBskyGraphStarterpack.Record>(
|
|
||||||
record,
|
|
||||||
AppBskyGraphStarterpack.isRecord,
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {type AppBskyFeedDefs, AtUri} from '@atproto/api'
|
|
||||||
import {Plural, Trans, useLingui} from '@lingui/react/macro'
|
import {Plural, Trans, useLingui} from '@lingui/react/macro'
|
||||||
|
|
||||||
|
import {AtUri} from '@atproto/syntax'
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {moderateProfile} from '#/lib/moderation/subjects'
|
import {moderateProfile} from '#/lib/moderation/subjects'
|
||||||
import {makeProfileLink} from '#/lib/routes/links'
|
import {makeProfileLink} from '#/lib/routes/links'
|
||||||
import {sanitizeDisplayName} from '#/lib/strings/display-names'
|
import {sanitizeDisplayName} from '#/lib/strings/display-names'
|
||||||
@@ -22,7 +23,7 @@ const AVI_SIZE = 20
|
|||||||
* The plain "N likes" stat for the expanded anchor post, linking to the likes
|
* The plain "N likes" stat for the expanded anchor post, linking to the likes
|
||||||
* list. Renders nothing when the post has no likes.
|
* list. Renders nothing when the post has no likes.
|
||||||
*/
|
*/
|
||||||
export function LikesStat({post}: {post: AppBskyFeedDefs.PostView}) {
|
export function LikesStat({post}: {post: app.bsky.feed.defs.PostView}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const {t: l} = useLingui()
|
const {t: l} = useLingui()
|
||||||
const formatPostStatCount = useFormatPostStatCount()
|
const formatPostStatCount = useFormatPostStatCount()
|
||||||
@@ -62,7 +63,7 @@ export function LikesStat({post}: {post: AppBskyFeedDefs.PostView}) {
|
|||||||
* likes, the API max per page), so they are a sample of the most recent
|
* likes, the API max per page), so they are a sample of the most recent
|
||||||
* likers, not an exhaustive list.
|
* likers, not an exhaustive list.
|
||||||
*/
|
*/
|
||||||
export function KnownLikers({post}: {post: AppBskyFeedDefs.PostView}) {
|
export function KnownLikers({post}: {post: app.bsky.feed.defs.PostView}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const {t: l} = useLingui()
|
const {t: l} = useLingui()
|
||||||
const {hasSession, currentAccount} = useSession()
|
const {hasSession, currentAccount} = useSession()
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
import {memo, useMemo} from 'react'
|
import {memo, useMemo} from 'react'
|
||||||
import {Text as RNText, View} from 'react-native'
|
import {Text as RNText, View} from 'react-native'
|
||||||
import {
|
|
||||||
AppBskyFeedDefs,
|
|
||||||
AppBskyFeedPost,
|
|
||||||
type AppBskyFeedThreadgate,
|
|
||||||
AtUri,
|
|
||||||
} from '@atproto/api'
|
|
||||||
import {RichText as RichTextAPI} from '@bsky.app/sdk/richtext'
|
import {RichText as RichTextAPI} from '@bsky.app/sdk/richtext'
|
||||||
import {Plural, Trans, useLingui} from '@lingui/react/macro'
|
import {Plural, Trans, useLingui} from '@lingui/react/macro'
|
||||||
|
|
||||||
|
import {AtUri} from '@atproto/syntax'
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
|
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
|
||||||
import {useOpenComposer} from '#/lib/hooks/useOpenComposer'
|
import {useOpenComposer} from '#/lib/hooks/useOpenComposer'
|
||||||
import {makeProfileLink} from '#/lib/routes/links'
|
import {makeProfileLink} from '#/lib/routes/links'
|
||||||
@@ -75,7 +71,7 @@ export function ThreadItemAnchor({
|
|||||||
}: {
|
}: {
|
||||||
item: Extract<ThreadItem, {type: 'threadPost'}>
|
item: Extract<ThreadItem, {type: 'threadPost'}>
|
||||||
onPostSuccess?: (data: OnPostSuccessData) => void
|
onPostSuccess?: (data: OnPostSuccessData) => void
|
||||||
threadgateRecord?: AppBskyFeedThreadgate.Record
|
threadgateRecord?: app.bsky.feed.threadgate.Main
|
||||||
postSource?: PostSource
|
postSource?: PostSource
|
||||||
}) {
|
}) {
|
||||||
const postShadow = usePostShadow(item.value.post)
|
const postShadow = usePostShadow(item.value.post)
|
||||||
@@ -176,9 +172,9 @@ const ThreadItemAnchorInner = memo(function ThreadItemAnchorInner({
|
|||||||
}: {
|
}: {
|
||||||
item: Extract<ThreadItem, {type: 'threadPost'}>
|
item: Extract<ThreadItem, {type: 'threadPost'}>
|
||||||
isRoot: boolean
|
isRoot: boolean
|
||||||
postShadow: Shadow<AppBskyFeedDefs.PostView>
|
postShadow: Shadow<app.bsky.feed.defs.PostView>
|
||||||
onPostSuccess?: (data: OnPostSuccessData) => void
|
onPostSuccess?: (data: OnPostSuccessData) => void
|
||||||
threadgateRecord?: AppBskyFeedThreadgate.Record
|
threadgateRecord?: app.bsky.feed.threadgate.Main
|
||||||
postSource?: PostSource
|
postSource?: PostSource
|
||||||
}) {
|
}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
@@ -244,7 +240,11 @@ const ThreadItemAnchorInner = memo(function ThreadItemAnchorInner({
|
|||||||
const viaRepost = useMemo(() => {
|
const viaRepost = useMemo(() => {
|
||||||
const reason = postSource?.post.reason
|
const reason = postSource?.post.reason
|
||||||
|
|
||||||
if (AppBskyFeedDefs.isReasonRepost(reason) && reason.uri && reason.cid) {
|
if (
|
||||||
|
bsky.isType(app.bsky.feed.defs.reasonRepost, reason) &&
|
||||||
|
reason.uri &&
|
||||||
|
reason.cid
|
||||||
|
) {
|
||||||
return {
|
return {
|
||||||
uri: reason.uri,
|
uri: reason.uri,
|
||||||
cid: reason.cid,
|
cid: reason.cid,
|
||||||
@@ -574,16 +574,13 @@ function ExpandedPostDetails({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function BackdatedPostIndicator({post}: {post: AppBskyFeedDefs.PostView}) {
|
function BackdatedPostIndicator({post}: {post: app.bsky.feed.defs.PostView}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const {t: l, i18n} = useLingui()
|
const {t: l, i18n} = useLingui()
|
||||||
const control = Prompt.usePromptControl()
|
const control = Prompt.usePromptControl()
|
||||||
|
|
||||||
const indexedAt = new Date(post.indexedAt)
|
const indexedAt = new Date(post.indexedAt)
|
||||||
const createdAt = bsky.dangerousIsType<AppBskyFeedPost.Record>(
|
const createdAt = bsky.isType(app.bsky.feed.post, post.record)
|
||||||
post.record,
|
|
||||||
AppBskyFeedPost.isRecord,
|
|
||||||
)
|
|
||||||
? new Date(post.record.createdAt)
|
? new Date(post.record.createdAt)
|
||||||
: new Date(post.indexedAt)
|
: new Date(post.indexedAt)
|
||||||
|
|
||||||
@@ -664,8 +661,8 @@ function BackdatedPostIndicator({post}: {post: AppBskyFeedDefs.PostView}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getThreadAuthor(
|
function getThreadAuthor(
|
||||||
post: AppBskyFeedDefs.PostView,
|
post: app.bsky.feed.defs.PostView,
|
||||||
record: AppBskyFeedPost.Record,
|
record: app.bsky.feed.post.Main,
|
||||||
): string {
|
): string {
|
||||||
if (!record.reply) {
|
if (!record.reply) {
|
||||||
return post.author.did
|
return post.author.did
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import {useCallback, useEffect, useMemo, useState} from 'react'
|
import {useCallback, useEffect, useMemo, useState} from 'react'
|
||||||
import {type AppBskyActorDefs} from '@atproto/api'
|
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {Trans} from '@lingui/react/macro'
|
import {Trans} from '@lingui/react/macro'
|
||||||
import {useNavigation} from '@react-navigation/native'
|
import {useNavigation} from '@react-navigation/native'
|
||||||
|
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
import {useProfileShadow} from '#/state/cache/profile-shadow'
|
import {useProfileShadow} from '#/state/cache/profile-shadow'
|
||||||
import {
|
import {
|
||||||
@@ -57,7 +57,7 @@ export function ThreadItemAnchorFollowButtonInner({
|
|||||||
function PostThreadFollowBtnLoaded({
|
function PostThreadFollowBtnLoaded({
|
||||||
profile: profileUnshadowed,
|
profile: profileUnshadowed,
|
||||||
}: {
|
}: {
|
||||||
profile: AppBskyActorDefs.ProfileViewDetailed
|
profile: app.bsky.actor.defs.ProfileViewDetailed
|
||||||
}) {
|
}) {
|
||||||
const navigation = useNavigation()
|
const navigation = useNavigation()
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
import {memo, type ReactNode, useCallback, useMemo, useState} from 'react'
|
import {memo, type ReactNode, useCallback, useMemo, useState} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {
|
|
||||||
type AppBskyFeedDefs,
|
|
||||||
type AppBskyFeedThreadgate,
|
|
||||||
AtUri,
|
|
||||||
} from '@atproto/api'
|
|
||||||
import {RichText as RichTextAPI} from '@bsky.app/sdk/richtext'
|
import {RichText as RichTextAPI} from '@bsky.app/sdk/richtext'
|
||||||
import {Trans} from '@lingui/react/macro'
|
import {Trans} from '@lingui/react/macro'
|
||||||
|
|
||||||
|
import {AtUri} from '@atproto/syntax'
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {MAX_POST_LINES} from '#/lib/constants'
|
import {MAX_POST_LINES} from '#/lib/constants'
|
||||||
import {useOpenComposer} from '#/lib/hooks/useOpenComposer'
|
import {useOpenComposer} from '#/lib/hooks/useOpenComposer'
|
||||||
import {makeProfileLink} from '#/lib/routes/links'
|
import {makeProfileLink} from '#/lib/routes/links'
|
||||||
@@ -63,7 +60,7 @@ export type ThreadItemPostProps = {
|
|||||||
topBorder?: boolean
|
topBorder?: boolean
|
||||||
}
|
}
|
||||||
onPostSuccess?: (data: OnPostSuccessData) => void
|
onPostSuccess?: (data: OnPostSuccessData) => void
|
||||||
threadgateRecord?: AppBskyFeedThreadgate.Record
|
threadgateRecord?: app.bsky.feed.threadgate.Main
|
||||||
}
|
}
|
||||||
|
|
||||||
export function ThreadItemPost({
|
export function ThreadItemPost({
|
||||||
@@ -197,7 +194,7 @@ const ThreadItemPostInner = memo(function ThreadItemPostInner({
|
|||||||
onPostSuccess,
|
onPostSuccess,
|
||||||
threadgateRecord,
|
threadgateRecord,
|
||||||
}: ThreadItemPostProps & {
|
}: ThreadItemPostProps & {
|
||||||
postShadow: Shadow<AppBskyFeedDefs.PostView>
|
postShadow: Shadow<app.bsky.feed.defs.PostView>
|
||||||
}) {
|
}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const {openComposer} = useOpenComposer()
|
const {openComposer} = useOpenComposer()
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
import {memo, useCallback, useMemo, useState} from 'react'
|
import {memo, useCallback, useMemo, useState} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {
|
|
||||||
type AppBskyFeedDefs,
|
|
||||||
type AppBskyFeedThreadgate,
|
|
||||||
AtUri,
|
|
||||||
} from '@atproto/api'
|
|
||||||
import {RichText as RichTextAPI} from '@bsky.app/sdk/richtext'
|
import {RichText as RichTextAPI} from '@bsky.app/sdk/richtext'
|
||||||
import {Trans} from '@lingui/react/macro'
|
import {Trans} from '@lingui/react/macro'
|
||||||
|
|
||||||
|
import {AtUri} from '@atproto/syntax'
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {MAX_POST_LINES} from '#/lib/constants'
|
import {MAX_POST_LINES} from '#/lib/constants'
|
||||||
import {useOpenComposer} from '#/lib/hooks/useOpenComposer'
|
import {useOpenComposer} from '#/lib/hooks/useOpenComposer'
|
||||||
import {makeProfileLink} from '#/lib/routes/links'
|
import {makeProfileLink} from '#/lib/routes/links'
|
||||||
@@ -69,7 +66,7 @@ export function ThreadItemTreePost({
|
|||||||
topBorder?: boolean
|
topBorder?: boolean
|
||||||
}
|
}
|
||||||
onPostSuccess?: (data: OnPostSuccessData) => void
|
onPostSuccess?: (data: OnPostSuccessData) => void
|
||||||
threadgateRecord?: AppBskyFeedThreadgate.Record
|
threadgateRecord?: app.bsky.feed.threadgate.Main
|
||||||
}) {
|
}) {
|
||||||
const postShadow = usePostShadow(item.value.post)
|
const postShadow = usePostShadow(item.value.post)
|
||||||
|
|
||||||
@@ -252,13 +249,13 @@ const ThreadItemTreePostInner = memo(function ThreadItemTreePostInner({
|
|||||||
threadgateRecord,
|
threadgateRecord,
|
||||||
}: {
|
}: {
|
||||||
item: Extract<ThreadItem, {type: 'threadPost'}>
|
item: Extract<ThreadItem, {type: 'threadPost'}>
|
||||||
postShadow: Shadow<AppBskyFeedDefs.PostView>
|
postShadow: Shadow<app.bsky.feed.defs.PostView>
|
||||||
overrides?: {
|
overrides?: {
|
||||||
moderation?: boolean
|
moderation?: boolean
|
||||||
topBorder?: boolean
|
topBorder?: boolean
|
||||||
}
|
}
|
||||||
onPostSuccess?: (data: OnPostSuccessData) => void
|
onPostSuccess?: (data: OnPostSuccessData) => void
|
||||||
threadgateRecord?: AppBskyFeedThreadgate.Record
|
threadgateRecord?: app.bsky.feed.threadgate.Main
|
||||||
}): React.ReactNode {
|
}): React.ReactNode {
|
||||||
const {openComposer} = useOpenComposer()
|
const {openComposer} = useOpenComposer()
|
||||||
const {currentAccount} = useSession()
|
const {currentAccount} = useSession()
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {type AppBskyActorDefs} from '@atproto/api'
|
|
||||||
import {type ModerationDecision} from '@bsky.app/sdk/moderation'
|
import {type ModerationDecision} from '@bsky.app/sdk/moderation'
|
||||||
|
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {sanitizeDisplayName} from '#/lib/strings/display-names'
|
import {sanitizeDisplayName} from '#/lib/strings/display-names'
|
||||||
import {sanitizeHandle} from '#/lib/strings/handles'
|
import {sanitizeHandle} from '#/lib/strings/handles'
|
||||||
import {type Shadow} from '#/state/cache/types'
|
import {type Shadow} from '#/state/cache/types'
|
||||||
@@ -13,7 +13,7 @@ export function ProfileHeaderDisplayName({
|
|||||||
profile,
|
profile,
|
||||||
moderation,
|
moderation,
|
||||||
}: {
|
}: {
|
||||||
profile: Shadow<AppBskyActorDefs.ProfileViewDetailed>
|
profile: Shadow<app.bsky.actor.defs.ProfileViewDetailed>
|
||||||
moderation: ModerationDecision
|
moderation: ModerationDecision
|
||||||
}) {
|
}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import {useCallback, useEffect, useState} from 'react'
|
import {useCallback, useEffect, useState} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {type AppBskyActorDefs} from '@atproto/api'
|
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {Plural, Trans} from '@lingui/react/macro'
|
import {Plural, Trans} from '@lingui/react/macro'
|
||||||
|
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {MAX_DESCRIPTION, MAX_DISPLAY_NAME, urls} from '#/lib/constants'
|
import {MAX_DESCRIPTION, MAX_DISPLAY_NAME, urls} from '#/lib/constants'
|
||||||
import {cleanError} from '#/lib/strings/errors'
|
import {cleanError} from '#/lib/strings/errors'
|
||||||
import {isOverMaxGraphemeCount} from '#/lib/strings/helpers'
|
import {isOverMaxGraphemeCount} from '#/lib/strings/helpers'
|
||||||
@@ -31,7 +31,7 @@ export function EditProfileDialog({
|
|||||||
control,
|
control,
|
||||||
onUpdate,
|
onUpdate,
|
||||||
}: {
|
}: {
|
||||||
profile: AppBskyActorDefs.ProfileViewDetailed
|
profile: app.bsky.actor.defs.ProfileViewDetailed
|
||||||
control: Dialog.DialogControlProps
|
control: Dialog.DialogControlProps
|
||||||
onUpdate?: () => void
|
onUpdate?: () => void
|
||||||
}) {
|
}) {
|
||||||
@@ -89,7 +89,7 @@ function DialogInner({
|
|||||||
setDirty,
|
setDirty,
|
||||||
onPressCancel,
|
onPressCancel,
|
||||||
}: {
|
}: {
|
||||||
profile: AppBskyActorDefs.ProfileViewDetailed
|
profile: app.bsky.actor.defs.ProfileViewDetailed
|
||||||
onUpdate?: () => void
|
onUpdate?: () => void
|
||||||
setDirty: (dirty: boolean) => void
|
setDirty: (dirty: boolean) => void
|
||||||
onPressCancel: () => void
|
onPressCancel: () => void
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {type AppBskyActorDefs} from '@atproto/api'
|
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {Trans} from '@lingui/react/macro'
|
import {Trans} from '@lingui/react/macro'
|
||||||
|
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {isInvalidHandle, sanitizeHandle} from '#/lib/strings/handles'
|
import {isInvalidHandle, sanitizeHandle} from '#/lib/strings/handles'
|
||||||
import {type Shadow} from '#/state/cache/types'
|
import {type Shadow} from '#/state/cache/types'
|
||||||
import {atoms as a, useTheme, web} from '#/alf'
|
import {atoms as a, useTheme, web} from '#/alf'
|
||||||
@@ -15,7 +15,7 @@ export function ProfileHeaderHandle({
|
|||||||
profile,
|
profile,
|
||||||
disableTaps,
|
disableTaps,
|
||||||
}: {
|
}: {
|
||||||
profile: Shadow<AppBskyActorDefs.ProfileViewDetailed>
|
profile: Shadow<app.bsky.actor.defs.ProfileViewDetailed>
|
||||||
disableTaps?: boolean
|
disableTaps?: boolean
|
||||||
}) {
|
}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {type AppBskyActorDefs} from '@atproto/api'
|
|
||||||
import {msg, plural} from '@lingui/core/macro'
|
import {msg, plural} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
|
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {makeProfileLink} from '#/lib/routes/links'
|
import {makeProfileLink} from '#/lib/routes/links'
|
||||||
import {type Shadow} from '#/state/cache/types'
|
import {type Shadow} from '#/state/cache/types'
|
||||||
import {formatCount} from '#/view/com/util/numeric/format'
|
import {formatCount} from '#/view/com/util/numeric/format'
|
||||||
@@ -13,7 +13,7 @@ import {Text} from '#/components/Typography'
|
|||||||
export function ProfileHeaderMetrics({
|
export function ProfileHeaderMetrics({
|
||||||
profile,
|
profile,
|
||||||
}: {
|
}: {
|
||||||
profile: Shadow<AppBskyActorDefs.ProfileViewDetailed>
|
profile: Shadow<app.bsky.actor.defs.ProfileViewDetailed>
|
||||||
}) {
|
}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const {_, i18n} = useLingui()
|
const {_, i18n} = useLingui()
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import {memo, useCallback, useMemo, useState} from 'react'
|
import {memo, useCallback, useMemo, useState} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {type AppBskyActorDefs} from '@atproto/api'
|
|
||||||
import {type ModerationOpts} from '@bsky.app/sdk/moderation'
|
import {type ModerationOpts} from '@bsky.app/sdk/moderation'
|
||||||
import {type RichText as RichTextAPI} from '@bsky.app/sdk/richtext'
|
import {type RichText as RichTextAPI} from '@bsky.app/sdk/richtext'
|
||||||
import {msg, plural} from '@lingui/core/macro'
|
import {msg, plural} from '@lingui/core/macro'
|
||||||
@@ -34,7 +33,7 @@ import * as Toast from '#/components/Toast'
|
|||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import {useAnalytics} from '#/analytics'
|
import {useAnalytics} from '#/analytics'
|
||||||
import {IS_IOS} from '#/env'
|
import {IS_IOS} from '#/env'
|
||||||
import {type app} from '#/lexicons'
|
import {app} from '#/lexicons'
|
||||||
import {ProfileHeaderDisplayName} from './DisplayName'
|
import {ProfileHeaderDisplayName} from './DisplayName'
|
||||||
import {EditProfileDialog} from './EditProfileDialog'
|
import {EditProfileDialog} from './EditProfileDialog'
|
||||||
import {ProfileHeaderHandle} from './Handle'
|
import {ProfileHeaderHandle} from './Handle'
|
||||||
@@ -42,7 +41,7 @@ import {ProfileHeaderMetrics} from './Metrics'
|
|||||||
import {ProfileHeaderShell} from './Shell'
|
import {ProfileHeaderShell} from './Shell'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
profile: AppBskyActorDefs.ProfileViewDetailed
|
profile: app.bsky.actor.defs.ProfileViewDetailed
|
||||||
labeler: app.bsky.labeler.defs.LabelerViewDetailed
|
labeler: app.bsky.labeler.defs.LabelerViewDetailed
|
||||||
descriptionRT: RichTextAPI | null
|
descriptionRT: RichTextAPI | null
|
||||||
moderationOpts: ModerationOpts
|
moderationOpts: ModerationOpts
|
||||||
@@ -58,7 +57,7 @@ let ProfileHeaderLabeler = ({
|
|||||||
hideBackButton = false,
|
hideBackButton = false,
|
||||||
isPlaceholderProfile,
|
isPlaceholderProfile,
|
||||||
}: Props): React.ReactNode => {
|
}: Props): React.ReactNode => {
|
||||||
const profile: Shadow<AppBskyActorDefs.ProfileViewDetailed> =
|
const profile: Shadow<app.bsky.actor.defs.ProfileViewDetailed> =
|
||||||
useProfileShadow(profileUnshadowed)
|
useProfileShadow(profileUnshadowed)
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const ax = useAnalytics()
|
const ax = useAnalytics()
|
||||||
@@ -232,7 +231,7 @@ export function HeaderLabelerButtons({
|
|||||||
profile,
|
profile,
|
||||||
minimal = false,
|
minimal = false,
|
||||||
}: {
|
}: {
|
||||||
profile: Shadow<AppBskyActorDefs.ProfileViewDetailed>
|
profile: Shadow<app.bsky.actor.defs.ProfileViewDetailed>
|
||||||
/** disable the subscribe button */
|
/** disable the subscribe button */
|
||||||
minimal?: boolean
|
minimal?: boolean
|
||||||
}) {
|
}) {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import {memo, useMemo, useState} from 'react'
|
import {memo, useMemo, useState} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {type AppBskyActorDefs} from '@atproto/api'
|
|
||||||
import {
|
import {
|
||||||
type ModerationDecision,
|
type ModerationDecision,
|
||||||
type ModerationOpts,
|
type ModerationOpts,
|
||||||
@@ -10,6 +9,7 @@ import {msg} from '@lingui/core/macro'
|
|||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {Trans} from '@lingui/react/macro'
|
import {Trans} from '@lingui/react/macro'
|
||||||
|
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {useHaptics} from '#/lib/haptics'
|
import {useHaptics} from '#/lib/haptics'
|
||||||
import {moderateProfile} from '#/lib/moderation/subjects'
|
import {moderateProfile} from '#/lib/moderation/subjects'
|
||||||
import {sanitizeDisplayName} from '#/lib/strings/display-names'
|
import {sanitizeDisplayName} from '#/lib/strings/display-names'
|
||||||
@@ -49,7 +49,7 @@ import {ProfileHeaderShell} from './Shell'
|
|||||||
import {ProfileHeaderSuggestedFollows} from './SuggestedFollows'
|
import {ProfileHeaderSuggestedFollows} from './SuggestedFollows'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
profile: AppBskyActorDefs.ProfileViewDetailed
|
profile: app.bsky.actor.defs.ProfileViewDetailed
|
||||||
descriptionRT: RichTextAPI | null
|
descriptionRT: RichTextAPI | null
|
||||||
moderationOpts: ModerationOpts
|
moderationOpts: ModerationOpts
|
||||||
hideBackButton?: boolean
|
hideBackButton?: boolean
|
||||||
@@ -64,7 +64,7 @@ let ProfileHeaderStandard = ({
|
|||||||
isPlaceholderProfile,
|
isPlaceholderProfile,
|
||||||
}: Props): React.ReactNode => {
|
}: Props): React.ReactNode => {
|
||||||
const profile =
|
const profile =
|
||||||
useProfileShadow<AppBskyActorDefs.ProfileViewDetailed>(profileUnshadowed)
|
useProfileShadow<app.bsky.actor.defs.ProfileViewDetailed>(profileUnshadowed)
|
||||||
const {currentAccount} = useSession()
|
const {currentAccount} = useSession()
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
const moderation = useMemo(
|
const moderation = useMemo(
|
||||||
@@ -213,7 +213,7 @@ export function HeaderStandardButtons({
|
|||||||
onUnfollow,
|
onUnfollow,
|
||||||
minimal,
|
minimal,
|
||||||
}: {
|
}: {
|
||||||
profile: Shadow<AppBskyActorDefs.ProfileViewDetailed>
|
profile: Shadow<app.bsky.actor.defs.ProfileViewDetailed>
|
||||||
moderation: ModerationDecision
|
moderation: ModerationDecision
|
||||||
moderationOpts: ModerationOpts
|
moderationOpts: ModerationOpts
|
||||||
onFollow?: () => void
|
onFollow?: () => void
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ import Animated, {
|
|||||||
useAnimatedRef,
|
useAnimatedRef,
|
||||||
} from 'react-native-reanimated'
|
} from 'react-native-reanimated'
|
||||||
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
||||||
import {type AppBskyActorDefs} from '@atproto/api'
|
|
||||||
import {utils} from '@bsky.app/alf'
|
import {utils} from '@bsky.app/alf'
|
||||||
import {type ModerationDecision} from '@bsky.app/sdk/moderation'
|
import {type ModerationDecision} from '@bsky.app/sdk/moderation'
|
||||||
import {useLingui} from '@lingui/react/macro'
|
import {useLingui} from '@lingui/react/macro'
|
||||||
import {useNavigation} from '@react-navigation/native'
|
import {useNavigation} from '@react-navigation/native'
|
||||||
|
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {BACK_HITSLOP} from '#/lib/constants'
|
import {BACK_HITSLOP} from '#/lib/constants'
|
||||||
import {useHaptics} from '#/lib/haptics'
|
import {useHaptics} from '#/lib/haptics'
|
||||||
import {type NavigationProp} from '#/lib/routes/types'
|
import {type NavigationProp} from '#/lib/routes/types'
|
||||||
@@ -37,7 +37,7 @@ import {GrowableBanner} from './GrowableBanner'
|
|||||||
import {StatusBarShadow} from './StatusBarShadow'
|
import {StatusBarShadow} from './StatusBarShadow'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
profile: Shadow<AppBskyActorDefs.ProfileViewDetailed>
|
profile: Shadow<app.bsky.actor.defs.ProfileViewDetailed>
|
||||||
moderation: ModerationDecision
|
moderation: ModerationDecision
|
||||||
hideBackButton?: boolean
|
hideBackButton?: boolean
|
||||||
isPlaceholderProfile?: boolean
|
isPlaceholderProfile?: boolean
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import Animated, {
|
|||||||
} from 'react-native-reanimated'
|
} from 'react-native-reanimated'
|
||||||
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
||||||
import {scheduleOnRN} from 'react-native-worklets'
|
import {scheduleOnRN} from 'react-native-worklets'
|
||||||
import {type AppBskyActorDefs} from '@atproto/api'
|
|
||||||
import {type ModerationOpts} from '@bsky.app/sdk/moderation'
|
import {type ModerationOpts} from '@bsky.app/sdk/moderation'
|
||||||
import {type RichText as RichTextAPI} from '@bsky.app/sdk/richtext'
|
import {type RichText as RichTextAPI} from '@bsky.app/sdk/richtext'
|
||||||
import {useIsFocused} from '@react-navigation/native'
|
import {useIsFocused} from '@react-navigation/native'
|
||||||
@@ -23,7 +22,7 @@ import {atoms as a, useTheme} from '#/alf'
|
|||||||
import {Header} from '#/components/Layout'
|
import {Header} from '#/components/Layout'
|
||||||
import * as ProfileCard from '#/components/ProfileCard'
|
import * as ProfileCard from '#/components/ProfileCard'
|
||||||
import {IS_NATIVE} from '#/env'
|
import {IS_NATIVE} from '#/env'
|
||||||
import {type app} from '#/lexicons'
|
import {app} from '#/lexicons'
|
||||||
import {
|
import {
|
||||||
HeaderLabelerButtons,
|
HeaderLabelerButtons,
|
||||||
ProfileHeaderLabeler,
|
ProfileHeaderLabeler,
|
||||||
@@ -58,7 +57,7 @@ ProfileHeaderLoading = memo(ProfileHeaderLoading)
|
|||||||
export {ProfileHeaderLoading}
|
export {ProfileHeaderLoading}
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
profile: AppBskyActorDefs.ProfileViewDetailed
|
profile: app.bsky.actor.defs.ProfileViewDetailed
|
||||||
labeler: app.bsky.labeler.defs.LabelerViewDetailed | undefined
|
labeler: app.bsky.labeler.defs.LabelerViewDetailed | undefined
|
||||||
descriptionRT: RichTextAPI | null
|
descriptionRT: RichTextAPI | null
|
||||||
moderationOpts: ModerationOpts
|
moderationOpts: ModerationOpts
|
||||||
@@ -103,7 +102,7 @@ const MinimalHeader = memo(function MinimalHeader({
|
|||||||
hideBackButton = false,
|
hideBackButton = false,
|
||||||
}: {
|
}: {
|
||||||
onLayout: (e: LayoutChangeEvent) => void
|
onLayout: (e: LayoutChangeEvent) => void
|
||||||
profile: AppBskyActorDefs.ProfileViewDetailed
|
profile: app.bsky.actor.defs.ProfileViewDetailed
|
||||||
labeler?: app.bsky.labeler.defs.LabelerViewDetailed
|
labeler?: app.bsky.labeler.defs.LabelerViewDetailed
|
||||||
hideBackButton?: boolean
|
hideBackButton?: boolean
|
||||||
}) {
|
}) {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import {useMemo, useState} from 'react'
|
import {useMemo, useState} from 'react'
|
||||||
import {type AppBskyActorDefs} from '@atproto/api'
|
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
|
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {useInitialNumToRender} from '#/lib/hooks/useInitialNumToRender'
|
import {useInitialNumToRender} from '#/lib/hooks/useInitialNumToRender'
|
||||||
import {
|
import {
|
||||||
type CommonNavigatorParams,
|
type CommonNavigatorParams,
|
||||||
@@ -22,7 +22,7 @@ function renderItem({
|
|||||||
item,
|
item,
|
||||||
index,
|
index,
|
||||||
}: {
|
}: {
|
||||||
item: AppBskyActorDefs.ProfileView
|
item: app.bsky.actor.defs.ProfileView
|
||||||
index: number
|
index: number
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
@@ -34,7 +34,7 @@ function renderItem({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function keyExtractor(item: AppBskyActorDefs.ProfileView) {
|
function keyExtractor(item: app.bsky.actor.defs.ProfileView) {
|
||||||
return item.did
|
return item.did
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import {Platform, View} from 'react-native'
|
import {Platform, View} from 'react-native'
|
||||||
import {Image} from 'expo-image'
|
import {Image} from 'expo-image'
|
||||||
import {type AppBskyActorDefs} from '@atproto/api'
|
|
||||||
import {type Client} from '@atproto/lex'
|
import {type Client} from '@atproto/lex'
|
||||||
import {type DidString} from '@atproto/syntax'
|
import {type DidString} from '@atproto/syntax'
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
@@ -29,7 +28,7 @@ export function GermButton({
|
|||||||
germ,
|
germ,
|
||||||
profile,
|
profile,
|
||||||
}: {
|
}: {
|
||||||
germ: AppBskyActorDefs.ProfileAssociatedGerm
|
germ: app.bsky.actor.defs.ProfileAssociatedGerm
|
||||||
profile: bsky.profile.AnyProfileView
|
profile: bsky.profile.AnyProfileView
|
||||||
}) {
|
}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
@@ -279,7 +278,7 @@ function GermSelfButton({did}: {did: string}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function constructGermUrl(
|
function constructGermUrl(
|
||||||
declaration: AppBskyActorDefs.ProfileAssociatedGerm,
|
declaration: app.bsky.actor.defs.ProfileAssociatedGerm,
|
||||||
profile: bsky.profile.AnyProfileView,
|
profile: bsky.profile.AnyProfileView,
|
||||||
viewerDid?: string,
|
viewerDid?: string,
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import {useCallback, useImperativeHandle, useState} from 'react'
|
import {useCallback, useImperativeHandle, useState} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {type AppBskyGraphDefs} from '@atproto/api'
|
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {Trans} from '@lingui/react/macro'
|
import {Trans} from '@lingui/react/macro'
|
||||||
|
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {useSession} from '#/state/session'
|
import {useSession} from '#/state/session'
|
||||||
import {ListMembers} from '#/view/com/lists/ListMembers'
|
import {ListMembers} from '#/view/com/lists/ListMembers'
|
||||||
import {EmptyState} from '#/view/com/util/EmptyState'
|
import {EmptyState} from '#/view/com/util/EmptyState'
|
||||||
@@ -22,7 +22,7 @@ interface SectionRef {
|
|||||||
|
|
||||||
interface AboutSectionProps {
|
interface AboutSectionProps {
|
||||||
ref?: React.Ref<SectionRef>
|
ref?: React.Ref<SectionRef>
|
||||||
list: AppBskyGraphDefs.ListView
|
list: app.bsky.graph.defs.ListView
|
||||||
onPressAddUser: () => void
|
onPressAddUser: () => void
|
||||||
headerHeight: number
|
headerHeight: number
|
||||||
scrollElRef: ListRef
|
scrollElRef: ListRef
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import {useMemo} from 'react'
|
import {useMemo} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {AppBskyGraphDefs} from '@atproto/api'
|
|
||||||
import {RichText as RichTextAPI} from '@bsky.app/sdk/richtext'
|
import {RichText as RichTextAPI} from '@bsky.app/sdk/richtext'
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {Trans} from '@lingui/react/macro'
|
import {Trans} from '@lingui/react/macro'
|
||||||
|
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {useHaptics} from '#/lib/haptics'
|
import {useHaptics} from '#/lib/haptics'
|
||||||
import {makeListLink} from '#/lib/routes/links'
|
import {makeListLink} from '#/lib/routes/links'
|
||||||
import {asSdkFacets} from '#/lib/strings/rich-text-helpers'
|
import {asSdkFacets} from '#/lib/strings/rich-text-helpers'
|
||||||
@@ -34,14 +34,14 @@ export function Header({
|
|||||||
preferences,
|
preferences,
|
||||||
}: {
|
}: {
|
||||||
rkey: string
|
rkey: string
|
||||||
list: AppBskyGraphDefs.ListView
|
list: app.bsky.graph.defs.ListView
|
||||||
preferences: UsePreferencesQueryResponse
|
preferences: UsePreferencesQueryResponse
|
||||||
}) {
|
}) {
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
const ax = useAnalytics()
|
const ax = useAnalytics()
|
||||||
const {currentAccount} = useSession()
|
const {currentAccount} = useSession()
|
||||||
const isCurateList = list.purpose === AppBskyGraphDefs.CURATELIST
|
const isCurateList = list.purpose === app.bsky.graph.defs.curatelist
|
||||||
const isModList = list.purpose === AppBskyGraphDefs.MODLIST
|
const isModList = list.purpose === app.bsky.graph.defs.modlist
|
||||||
const isBlocking = !!list.viewer?.blocked
|
const isBlocking = !!list.viewer?.blocked
|
||||||
const isMuting = !!list.viewer?.muted
|
const isMuting = !!list.viewer?.muted
|
||||||
const playHaptic = useHaptics()
|
const playHaptic = useHaptics()
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
import {type AppBskyActorDefs, AppBskyGraphDefs, AtUri} from '@atproto/api'
|
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {Trans} from '@lingui/react/macro'
|
import {Trans} from '@lingui/react/macro'
|
||||||
import {useNavigation} from '@react-navigation/native'
|
import {useNavigation} from '@react-navigation/native'
|
||||||
|
|
||||||
|
import {AtUri} from '@atproto/syntax'
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {type NavigationProp} from '#/lib/routes/types'
|
import {type NavigationProp} from '#/lib/routes/types'
|
||||||
import {shareUrl} from '#/lib/sharing'
|
import {shareUrl} from '#/lib/sharing'
|
||||||
import {toShareUrl} from '#/lib/strings/url-helpers'
|
import {toShareUrl} from '#/lib/strings/url-helpers'
|
||||||
@@ -41,8 +42,8 @@ export function MoreOptionsMenu({
|
|||||||
list,
|
list,
|
||||||
savedFeedConfig,
|
savedFeedConfig,
|
||||||
}: {
|
}: {
|
||||||
list: AppBskyGraphDefs.ListView
|
list: app.bsky.graph.defs.ListView
|
||||||
savedFeedConfig?: AppBskyActorDefs.SavedFeed
|
savedFeedConfig?: app.bsky.actor.defs.SavedFeed
|
||||||
}) {
|
}) {
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
const ax = useAnalytics()
|
const ax = useAnalytics()
|
||||||
@@ -57,8 +58,8 @@ export function MoreOptionsMenu({
|
|||||||
const {mutateAsync: muteList} = useListMuteMutation()
|
const {mutateAsync: muteList} = useListMuteMutation()
|
||||||
const {mutateAsync: blockList} = useListBlockMutation()
|
const {mutateAsync: blockList} = useListBlockMutation()
|
||||||
|
|
||||||
const isCurateList = list.purpose === AppBskyGraphDefs.CURATELIST
|
const isCurateList = list.purpose === app.bsky.graph.defs.curatelist
|
||||||
const isModList = list.purpose === AppBskyGraphDefs.MODLIST
|
const isModList = list.purpose === app.bsky.graph.defs.modlist
|
||||||
const isBlocking = !!list.viewer?.blocked
|
const isBlocking = !!list.viewer?.blocked
|
||||||
const isMuting = !!list.viewer?.muted
|
const isMuting = !!list.viewer?.muted
|
||||||
const isPinned = Boolean(savedFeedConfig?.pinned)
|
const isPinned = Boolean(savedFeedConfig?.pinned)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import {type AppBskyGraphDefs} from '@atproto/api'
|
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {Trans} from '@lingui/react/macro'
|
import {Trans} from '@lingui/react/macro'
|
||||||
|
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {useListBlockMutation, useListMuteMutation} from '#/state/queries/list'
|
import {useListBlockMutation, useListMuteMutation} from '#/state/queries/list'
|
||||||
import {atoms as a} from '#/alf'
|
import {atoms as a} from '#/alf'
|
||||||
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
|
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
|
||||||
@@ -14,7 +14,7 @@ import * as Prompt from '#/components/Prompt'
|
|||||||
import * as Toast from '#/components/Toast'
|
import * as Toast from '#/components/Toast'
|
||||||
import {useAnalytics} from '#/analytics'
|
import {useAnalytics} from '#/analytics'
|
||||||
|
|
||||||
export function SubscribeMenu({list}: {list: AppBskyGraphDefs.ListView}) {
|
export function SubscribeMenu({list}: {list: app.bsky.graph.defs.ListView}) {
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
const ax = useAnalytics()
|
const ax = useAnalytics()
|
||||||
const subscribeMutePromptControl = Prompt.usePromptControl()
|
const subscribeMutePromptControl = Prompt.usePromptControl()
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import {useCallback, useMemo, useRef, useState} from 'react'
|
import {useCallback, useMemo, useRef, useState} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {useAnimatedRef} from 'react-native-reanimated'
|
import {useAnimatedRef} from 'react-native-reanimated'
|
||||||
import {AppBskyGraphDefs, AtUri} from '@atproto/api'
|
|
||||||
import {type ModerationOpts} from '@bsky.app/sdk/moderation'
|
import {type ModerationOpts} from '@bsky.app/sdk/moderation'
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
@@ -9,6 +8,8 @@ import {Trans} from '@lingui/react/macro'
|
|||||||
import {useIsFocused} from '@react-navigation/native'
|
import {useIsFocused} from '@react-navigation/native'
|
||||||
import {useQueryClient} from '@tanstack/react-query'
|
import {useQueryClient} from '@tanstack/react-query'
|
||||||
|
|
||||||
|
import {AtUri} from '@atproto/syntax'
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {useOpenComposer} from '#/lib/hooks/useOpenComposer'
|
import {useOpenComposer} from '#/lib/hooks/useOpenComposer'
|
||||||
import {useSetTitle} from '#/lib/hooks/useSetTitle'
|
import {useSetTitle} from '#/lib/hooks/useSetTitle'
|
||||||
import {moderateUserList} from '#/lib/moderation/subjects'
|
import {moderateUserList} from '#/lib/moderation/subjects'
|
||||||
@@ -143,7 +144,7 @@ function ProfileListScreenLoaded({
|
|||||||
preferences,
|
preferences,
|
||||||
}: Props & {
|
}: Props & {
|
||||||
uri: string
|
uri: string
|
||||||
list: AppBskyGraphDefs.ListView
|
list: app.bsky.graph.defs.ListView
|
||||||
moderationOpts: ModerationOpts
|
moderationOpts: ModerationOpts
|
||||||
preferences: UsePreferencesQueryResponse
|
preferences: UsePreferencesQueryResponse
|
||||||
}) {
|
}) {
|
||||||
@@ -155,7 +156,7 @@ function ProfileListScreenLoaded({
|
|||||||
const {rkey} = route.params
|
const {rkey} = route.params
|
||||||
const feedSectionRef = useRef<SectionRef>(null)
|
const feedSectionRef = useRef<SectionRef>(null)
|
||||||
const aboutSectionRef = useRef<SectionRef>(null)
|
const aboutSectionRef = useRef<SectionRef>(null)
|
||||||
const isCurateList = list.purpose === AppBskyGraphDefs.CURATELIST
|
const isCurateList = list.purpose === app.bsky.graph.defs.curatelist
|
||||||
const isScreenFocused = useIsFocused()
|
const isScreenFocused = useIsFocused()
|
||||||
const isHidden = list.labels?.findIndex(l => l.val === '!hide') !== -1
|
const isHidden = list.labels?.findIndex(l => l.val === '!hide') !== -1
|
||||||
const isOwner = currentAccount?.did === list.creator.did
|
const isOwner = currentAccount?.did === list.creator.did
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import {useState} from 'react'
|
|||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import type Animated from 'react-native-reanimated'
|
import type Animated from 'react-native-reanimated'
|
||||||
import {useAnimatedRef, useScrollOffset} from 'react-native-reanimated'
|
import {useAnimatedRef, useScrollOffset} from 'react-native-reanimated'
|
||||||
import {type AppBskyActorDefs} from '@atproto/api'
|
|
||||||
import {TID} from '@atproto/common-web'
|
import {TID} from '@atproto/common-web'
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
@@ -10,6 +9,7 @@ import {Trans} from '@lingui/react/macro'
|
|||||||
import {useNavigation} from '@react-navigation/native'
|
import {useNavigation} from '@react-navigation/native'
|
||||||
import {type NativeStackScreenProps} from '@react-navigation/native-stack'
|
import {type NativeStackScreenProps} from '@react-navigation/native-stack'
|
||||||
|
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {RECOMMENDED_SAVED_FEEDS, TIMELINE_SAVED_FEED} from '#/lib/constants'
|
import {RECOMMENDED_SAVED_FEEDS, TIMELINE_SAVED_FEED} from '#/lib/constants'
|
||||||
import {useHaptics} from '#/lib/haptics'
|
import {useHaptics} from '#/lib/haptics'
|
||||||
import {
|
import {
|
||||||
@@ -424,10 +424,10 @@ function PinnedFeedItem({
|
|||||||
onMoveUp,
|
onMoveUp,
|
||||||
onMoveDown,
|
onMoveDown,
|
||||||
}: {
|
}: {
|
||||||
feed: AppBskyActorDefs.SavedFeed
|
feed: app.bsky.actor.defs.SavedFeed
|
||||||
currentFeeds: AppBskyActorDefs.SavedFeed[]
|
currentFeeds: app.bsky.actor.defs.SavedFeed[]
|
||||||
setCurrentFeeds: React.Dispatch<
|
setCurrentFeeds: React.Dispatch<
|
||||||
React.SetStateAction<AppBskyActorDefs.SavedFeed[]>
|
React.SetStateAction<app.bsky.actor.defs.SavedFeed[]>
|
||||||
>
|
>
|
||||||
dragHandle?: React.ReactNode
|
dragHandle?: React.ReactNode
|
||||||
index?: number
|
index?: number
|
||||||
@@ -507,10 +507,10 @@ function UnpinnedFeedItem({
|
|||||||
currentFeeds,
|
currentFeeds,
|
||||||
setCurrentFeeds,
|
setCurrentFeeds,
|
||||||
}: {
|
}: {
|
||||||
feed: AppBskyActorDefs.SavedFeed
|
feed: app.bsky.actor.defs.SavedFeed
|
||||||
currentFeeds: AppBskyActorDefs.SavedFeed[]
|
currentFeeds: app.bsky.actor.defs.SavedFeed[]
|
||||||
setCurrentFeeds: React.Dispatch<
|
setCurrentFeeds: React.Dispatch<
|
||||||
React.SetStateAction<AppBskyActorDefs.SavedFeed[]>
|
React.SetStateAction<app.bsky.actor.defs.SavedFeed[]>
|
||||||
>
|
>
|
||||||
}) {
|
}) {
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
import {useCallback, useMemo, useRef, useState} from 'react'
|
import {useCallback, useMemo, useRef, useState} from 'react'
|
||||||
import {View, type ViewabilityConfig} from 'react-native'
|
import {View, type ViewabilityConfig} from 'react-native'
|
||||||
import {
|
|
||||||
type AppBskyActorDefs,
|
|
||||||
type AppBskyFeedDefs,
|
|
||||||
type AppBskyGraphDefs,
|
|
||||||
} from '@atproto/api'
|
|
||||||
import {Trans, useLingui} from '@lingui/react/macro'
|
import {Trans, useLingui} from '@lingui/react/macro'
|
||||||
import {useQueryClient} from '@tanstack/react-query'
|
import {useQueryClient} from '@tanstack/react-query'
|
||||||
import * as bcp47Match from 'bcp-47-match'
|
import * as bcp47Match from 'bcp-47-match'
|
||||||
|
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {popularInterests, useInterestsDisplayNames} from '#/lib/interests'
|
import {popularInterests, useInterestsDisplayNames} from '#/lib/interests'
|
||||||
import {cleanError} from '#/lib/strings/errors'
|
import {cleanError} from '#/lib/strings/errors'
|
||||||
import {sanitizeHandle} from '#/lib/strings/handles'
|
import {sanitizeHandle} from '#/lib/strings/handles'
|
||||||
@@ -155,7 +151,7 @@ type ExploreScreenItems =
|
|||||||
| {
|
| {
|
||||||
type: 'profile'
|
type: 'profile'
|
||||||
key: string
|
key: string
|
||||||
profile: AppBskyActorDefs.ProfileView
|
profile: app.bsky.actor.defs.ProfileView
|
||||||
recId?: string
|
recId?: string
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
@@ -165,7 +161,7 @@ type ExploreScreenItems =
|
|||||||
| {
|
| {
|
||||||
type: 'feed'
|
type: 'feed'
|
||||||
key: string
|
key: string
|
||||||
feed: AppBskyFeedDefs.GeneratorView
|
feed: app.bsky.feed.defs.GeneratorView
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
type: 'loadMore'
|
type: 'loadMore'
|
||||||
@@ -191,7 +187,7 @@ type ExploreScreenItems =
|
|||||||
| {
|
| {
|
||||||
type: 'starterPack'
|
type: 'starterPack'
|
||||||
key: string
|
key: string
|
||||||
view: AppBskyGraphDefs.StarterPackView
|
view: app.bsky.graph.defs.StarterPackView
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
type: 'starterPackSkeleton'
|
type: 'starterPackSkeleton'
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import {memo, useCallback, useMemo, useState} from 'react'
|
import {memo, useCallback, useMemo, useState} from 'react'
|
||||||
import {ActivityIndicator, View} from 'react-native'
|
import {ActivityIndicator, View} from 'react-native'
|
||||||
import {type AppBskyFeedDefs, type AppBskyGraphDefs} from '@atproto/api'
|
|
||||||
import {Trans, useLingui} from '@lingui/react/macro'
|
import {Trans, useLingui} from '@lingui/react/macro'
|
||||||
|
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {urls} from '#/lib/constants'
|
import {urls} from '#/lib/constants'
|
||||||
import {usePostViewTracking} from '#/lib/hooks/usePostViewTracking'
|
import {usePostViewTracking} from '#/lib/hooks/usePostViewTracking'
|
||||||
import {useCallOnce} from '#/lib/once'
|
import {useCallOnce} from '#/lib/once'
|
||||||
@@ -292,7 +292,7 @@ type SearchResultSlice =
|
|||||||
| {
|
| {
|
||||||
type: 'post'
|
type: 'post'
|
||||||
key: string
|
key: string
|
||||||
post: AppBskyFeedDefs.PostView
|
post: app.bsky.feed.defs.PostView
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
type: 'loadingMore'
|
type: 'loadingMore'
|
||||||
@@ -504,7 +504,7 @@ function SearchPost({
|
|||||||
}: {
|
}: {
|
||||||
from: Metrics['search:result:press']['tab']
|
from: Metrics['search:result:press']['tab']
|
||||||
position: Metrics['search:result:press']['position']
|
position: Metrics['search:result:press']['position']
|
||||||
post: AppBskyFeedDefs.PostView
|
post: app.bsky.feed.defs.PostView
|
||||||
}) {
|
}) {
|
||||||
const ax = useAnalytics()
|
const ax = useAnalytics()
|
||||||
|
|
||||||
@@ -672,7 +672,7 @@ let SearchScreenFeedsResults = ({
|
|||||||
item,
|
item,
|
||||||
index,
|
index,
|
||||||
}: {
|
}: {
|
||||||
item: AppBskyFeedDefs.GeneratorView
|
item: app.bsky.feed.defs.GeneratorView
|
||||||
index: number
|
index: number
|
||||||
}) => (
|
}) => (
|
||||||
<View
|
<View
|
||||||
@@ -685,7 +685,7 @@ let SearchScreenFeedsResults = ({
|
|||||||
<SearchFeedCard position={index} view={item} />
|
<SearchFeedCard position={index} view={item} />
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
keyExtractor={(item: AppBskyFeedDefs.GeneratorView) => item.uri}
|
keyExtractor={(item: app.bsky.feed.defs.GeneratorView) => item.uri}
|
||||||
desktopFixedHeight
|
desktopFixedHeight
|
||||||
ListFooterComponent={<ListFooter />}
|
ListFooterComponent={<ListFooter />}
|
||||||
/>
|
/>
|
||||||
@@ -704,7 +704,7 @@ function SearchFeedCard({
|
|||||||
view,
|
view,
|
||||||
}: {
|
}: {
|
||||||
position: number
|
position: number
|
||||||
view: AppBskyFeedDefs.GeneratorView
|
view: app.bsky.feed.defs.GeneratorView
|
||||||
}) {
|
}) {
|
||||||
const ax = useAnalytics()
|
const ax = useAnalytics()
|
||||||
|
|
||||||
@@ -790,14 +790,14 @@ let SearchScreenStarterPackResults = ({
|
|||||||
item,
|
item,
|
||||||
index,
|
index,
|
||||||
}: {
|
}: {
|
||||||
item: AppBskyGraphDefs.StarterPackView
|
item: app.bsky.graph.defs.StarterPackView
|
||||||
index: number
|
index: number
|
||||||
}) => (
|
}) => (
|
||||||
<View style={[a.px_lg, a.pb_lg, index === 0 && a.pt_lg]}>
|
<View style={[a.px_lg, a.pb_lg, index === 0 && a.pt_lg]}>
|
||||||
<SearchStarterPack position={index} view={item} />
|
<SearchStarterPack position={index} view={item} />
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
keyExtractor={(item: AppBskyGraphDefs.StarterPackView) => item.uri}
|
keyExtractor={(item: app.bsky.graph.defs.StarterPackView) => item.uri}
|
||||||
refreshing={isPTR}
|
refreshing={isPTR}
|
||||||
onRefresh={() => void onPullToRefresh()}
|
onRefresh={() => void onPullToRefresh()}
|
||||||
onEndReached={onEndReached}
|
onEndReached={onEndReached}
|
||||||
@@ -824,7 +824,7 @@ function SearchStarterPack({
|
|||||||
view,
|
view,
|
||||||
}: {
|
}: {
|
||||||
position: number
|
position: number
|
||||||
view: AppBskyGraphDefs.StarterPackView
|
view: app.bsky.graph.defs.StarterPackView
|
||||||
}) {
|
}) {
|
||||||
const ax = useAnalytics()
|
const ax = useAnalytics()
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import {useMemo} from 'react'
|
import {useMemo} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {type AppBskyFeedDefs, AtUri} from '@atproto/api'
|
|
||||||
|
|
||||||
|
import {AtUri} from '@atproto/syntax'
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {PressableScale} from '#/lib/custom-animations/PressableScale'
|
import {PressableScale} from '#/lib/custom-animations/PressableScale'
|
||||||
import {makeCustomFeedLink} from '#/lib/routes/links'
|
import {makeCustomFeedLink} from '#/lib/routes/links'
|
||||||
import {UserAvatar} from '#/view/com/util/UserAvatar'
|
import {UserAvatar} from '#/view/com/util/UserAvatar'
|
||||||
@@ -46,7 +47,7 @@ export function FeedLink({
|
|||||||
feed,
|
feed,
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
feed: AppBskyFeedDefs.GeneratorView
|
feed: app.bsky.feed.defs.GeneratorView
|
||||||
children?: React.ReactNode
|
children?: React.ReactNode
|
||||||
}) {
|
}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
@@ -75,7 +76,7 @@ export function FeedLink({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function FeedAvatar({feed}: {feed: AppBskyFeedDefs.GeneratorView}) {
|
export function FeedAvatar({feed}: {feed: app.bsky.feed.defs.GeneratorView}) {
|
||||||
return <UserAvatar type="algo" size={38} avatar={feed.avatar} />
|
return <UserAvatar type="algo" size={38} avatar={feed.avatar} />
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,7 +179,7 @@ export function EllipsisButton({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function PinButton({feed}: {feed: AppBskyFeedDefs.GeneratorView}) {
|
export function PinButton({feed}: {feed: app.bsky.feed.defs.GeneratorView}) {
|
||||||
return (
|
return (
|
||||||
<View style={[a.z_20, {marginRight: -6}]}>
|
<View style={[a.z_20, {marginRight: -6}]}>
|
||||||
<FeedCard.SaveButton
|
<FeedCard.SaveButton
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import {useState} from 'react'
|
import {useState} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {type AppBskyGraphDefs, AppBskyGraphStarterpack} from '@atproto/api'
|
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {Trans} from '@lingui/react/macro'
|
import {Trans} from '@lingui/react/macro'
|
||||||
|
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {moderateProfile} from '#/lib/moderation/subjects'
|
import {moderateProfile} from '#/lib/moderation/subjects'
|
||||||
import {sanitizeHandle} from '#/lib/strings/handles'
|
import {sanitizeHandle} from '#/lib/strings/handles'
|
||||||
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
||||||
@@ -25,7 +25,7 @@ export function StarterPackCard({
|
|||||||
view,
|
view,
|
||||||
onPress,
|
onPress,
|
||||||
}: {
|
}: {
|
||||||
view: AppBskyGraphDefs.StarterPackView
|
view: app.bsky.graph.defs.StarterPackView
|
||||||
onPress?: () => void
|
onPress?: () => void
|
||||||
}) {
|
}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
@@ -35,12 +35,7 @@ export function StarterPackCard({
|
|||||||
const link = useStarterPackLink({view})
|
const link = useStarterPackLink({view})
|
||||||
const record = view.record
|
const record = view.record
|
||||||
|
|
||||||
if (
|
if (!bsky.isType(app.bsky.graph.starterpack, record)) {
|
||||||
!bsky.dangerousIsType<AppBskyGraphStarterpack.Record>(
|
|
||||||
record,
|
|
||||||
AppBskyGraphStarterpack.isRecord,
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import {memo, useEffect} from 'react'
|
import {memo, useEffect} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {type AppBskyActorSearchActors} from '@atproto/api'
|
|
||||||
import {type ModerationOpts} from '@bsky.app/sdk/moderation'
|
import {type ModerationOpts} from '@bsky.app/sdk/moderation'
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {type InfiniteData} from '@tanstack/react-query'
|
import {type InfiniteData} from '@tanstack/react-query'
|
||||||
|
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {popularInterests, useInterestsDisplayNames} from '#/lib/interests'
|
import {popularInterests, useInterestsDisplayNames} from '#/lib/interests'
|
||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
import {usePreferencesQuery} from '#/state/queries/preferences'
|
import {usePreferencesQuery} from '#/state/queries/preferences'
|
||||||
@@ -25,7 +25,7 @@ export function useLoadEnoughProfiles({
|
|||||||
fetchNextPage,
|
fetchNextPage,
|
||||||
}: {
|
}: {
|
||||||
interest: string | null
|
interest: string | null
|
||||||
data?: InfiniteData<AppBskyActorSearchActors.OutputSchema>
|
data?: InfiniteData<app.bsky.actor.searchActors.$OutputBody>
|
||||||
isLoading: boolean
|
isLoading: boolean
|
||||||
isFetchingNextPage: boolean
|
isFetchingNextPage: boolean
|
||||||
hasNextPage: boolean
|
hasNextPage: boolean
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import {useMemo} from 'react'
|
import {useMemo} from 'react'
|
||||||
import {Pressable, View} from 'react-native'
|
import {Pressable, View} from 'react-native'
|
||||||
import {Image} from 'expo-image'
|
import {Image} from 'expo-image'
|
||||||
import {type AppBskyUnspeccedDefs} from '@atproto/api'
|
|
||||||
import {RichText as RichTextApi} from '@bsky.app/sdk/richtext'
|
import {RichText as RichTextApi} from '@bsky.app/sdk/richtext'
|
||||||
import {Plural, Trans, useLingui} from '@lingui/react/macro'
|
import {Plural, Trans, useLingui} from '@lingui/react/macro'
|
||||||
|
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {moderateProfile} from '#/lib/moderation/subjects'
|
import {moderateProfile} from '#/lib/moderation/subjects'
|
||||||
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
||||||
import {
|
import {
|
||||||
@@ -118,7 +118,7 @@ export function TrendRow({
|
|||||||
children,
|
children,
|
||||||
onPress,
|
onPress,
|
||||||
}: ViewStyleProp & {
|
}: ViewStyleProp & {
|
||||||
trend: AppBskyUnspeccedDefs.TrendView
|
trend: app.bsky.unspecced.defs.TrendView
|
||||||
rank: number
|
rank: number
|
||||||
recId?: string
|
recId?: string
|
||||||
children?: React.ReactNode
|
children?: React.ReactNode
|
||||||
@@ -229,7 +229,7 @@ export function TrendRow({
|
|||||||
|
|
||||||
// Unused atm, but leaving here so we don't lose localization. -dsb
|
// Unused atm, but leaving here so we don't lose localization. -dsb
|
||||||
export function useCategoryDisplayName(
|
export function useCategoryDisplayName(
|
||||||
category: AppBskyUnspeccedDefs.TrendView['category'],
|
category: app.bsky.unspecced.defs.TrendView['category'],
|
||||||
) {
|
) {
|
||||||
const {t: l} = useLingui()
|
const {t: l} = useLingui()
|
||||||
|
|
||||||
@@ -297,7 +297,7 @@ export function TrendingTopicRowSkeleton() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function useModerateTrendingActors(
|
function useModerateTrendingActors(
|
||||||
actors: AppBskyUnspeccedDefs.TrendView['actors'],
|
actors: app.bsky.unspecced.defs.TrendView['actors'],
|
||||||
) {
|
) {
|
||||||
const moderationOpts = useModerationOpts()
|
const moderationOpts = useModerationOpts()
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
import {useMemo} from 'react'
|
import {useMemo} from 'react'
|
||||||
import {ScrollView, View} from 'react-native'
|
import {ScrollView, View} from 'react-native'
|
||||||
import {AppBskyEmbedVideo, AtUri} from '@atproto/api'
|
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {Trans} from '@lingui/react/macro'
|
import {Trans} from '@lingui/react/macro'
|
||||||
import {useFocusEffect} from '@react-navigation/native'
|
import {useFocusEffect} from '@react-navigation/native'
|
||||||
import {useQueryClient} from '@tanstack/react-query'
|
import {useQueryClient} from '@tanstack/react-query'
|
||||||
|
|
||||||
|
import {AtUri} from '@atproto/syntax'
|
||||||
|
import * as bsky from '#/types/bsky'
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {VIDEO_FEED_URI} from '#/lib/constants'
|
import {VIDEO_FEED_URI} from '#/lib/constants'
|
||||||
import {makeCustomFeedLink} from '#/lib/routes/links'
|
import {makeCustomFeedLink} from '#/lib/routes/links'
|
||||||
import {RQKEY, usePostFeedQuery} from '#/state/queries/post-feed'
|
import {RQKEY, usePostFeedQuery} from '#/state/queries/post-feed'
|
||||||
@@ -158,7 +160,7 @@ function VideoCards({
|
|||||||
.flatMap(page => page.slices)
|
.flatMap(page => page.slices)
|
||||||
.map(slice => slice.items[0])
|
.map(slice => slice.items[0])
|
||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
.filter(item => AppBskyEmbedVideo.isView(item.post.embed))
|
.filter(item => bsky.isType(app.bsky.embed.video.view, item.post.embed))
|
||||||
.slice(0, 8)
|
.slice(0, 8)
|
||||||
}, [data])
|
}, [data])
|
||||||
const href = useMemo(() => {
|
const href = useMemo(() => {
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {type AppBskyNotificationDeclaration} from '@atproto/api'
|
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {Trans} from '@lingui/react/macro'
|
import {Trans} from '@lingui/react/macro'
|
||||||
@@ -12,6 +11,7 @@ import {
|
|||||||
useNotificationDeclarationMutation,
|
useNotificationDeclarationMutation,
|
||||||
useNotificationDeclarationQuery,
|
useNotificationDeclarationQuery,
|
||||||
} from '#/state/queries/activity-subscriptions'
|
} from '#/state/queries/activity-subscriptions'
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {atoms as a, useTheme} from '#/alf'
|
import {atoms as a, useTheme} from '#/alf'
|
||||||
import {Admonition} from '#/components/Admonition'
|
import {Admonition} from '#/components/Admonition'
|
||||||
import * as Toggle from '#/components/forms/Toggle'
|
import * as Toggle from '#/components/forms/Toggle'
|
||||||
@@ -85,7 +85,7 @@ export function Inner({
|
|||||||
notificationDeclaration: {
|
notificationDeclaration: {
|
||||||
uri?: string
|
uri?: string
|
||||||
cid?: string
|
cid?: string
|
||||||
value: AppBskyNotificationDeclaration.Record
|
value: app.bsky.notification.declaration.Main
|
||||||
}
|
}
|
||||||
}) {
|
}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {type $Typed, ComAtprotoLabelDefs} from '@atproto/api'
|
|
||||||
import {Trans, useLingui} from '@lingui/react/macro'
|
import {Trans, useLingui} from '@lingui/react/macro'
|
||||||
import {type NativeStackScreenProps} from '@react-navigation/native-stack'
|
import {type NativeStackScreenProps} from '@react-navigation/native-stack'
|
||||||
import {useQueryClient} from '@tanstack/react-query'
|
import {useQueryClient} from '@tanstack/react-query'
|
||||||
|
|
||||||
|
import {type $Typed} from '@atproto/lex'
|
||||||
|
import {com} from '#/lexicons'
|
||||||
import {type CommonNavigatorParams} from '#/lib/routes/types'
|
import {type CommonNavigatorParams} from '#/lib/routes/types'
|
||||||
import {RQKEY_ROOT as POST_FEED_RQKEY_ROOT} from '#/state/queries/post-feed'
|
import {RQKEY_ROOT as POST_FEED_RQKEY_ROOT} from '#/state/queries/post-feed'
|
||||||
import {
|
import {
|
||||||
@@ -53,15 +54,13 @@ export function AutomationLabelSettingsScreen({}: Props) {
|
|||||||
{
|
{
|
||||||
profile,
|
profile,
|
||||||
updates: existing => {
|
updates: existing => {
|
||||||
const labels: $Typed<ComAtprotoLabelDefs.SelfLabels> = bsky.validate(
|
const labels: $Typed<com.atproto.label.defs.SelfLabels> =
|
||||||
existing.labels,
|
bsky.matches(com.atproto.label.defs.selfLabels, existing.labels)
|
||||||
ComAtprotoLabelDefs.validateSelfLabels,
|
? existing.labels
|
||||||
)
|
: {
|
||||||
? existing.labels
|
$type: 'com.atproto.label.defs#selfLabels',
|
||||||
: {
|
values: [],
|
||||||
$type: 'com.atproto.label.defs#selfLabels',
|
}
|
||||||
values: [],
|
|
||||||
}
|
|
||||||
|
|
||||||
const hasLabel = labels.values.some(l => l.val === 'bot')
|
const hasLabel = labels.values.some(l => l.val === 'bot')
|
||||||
if (hasLabel) {
|
if (hasLabel) {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import {useCallback, useEffect, useState} from 'react'
|
import {useCallback, useEffect, useState} from 'react'
|
||||||
import {type ListRenderItemInfo, View} from 'react-native'
|
import {type ListRenderItemInfo, View} from 'react-native'
|
||||||
import * as Contacts from 'expo-contacts'
|
import * as Contacts from 'expo-contacts'
|
||||||
import {type AppBskyContactDefs} from '@atproto/api'
|
|
||||||
import {type DidString} from '@atproto/syntax'
|
import {type DidString} from '@atproto/syntax'
|
||||||
import {type ModerationOpts} from '@bsky.app/sdk/moderation'
|
import {type ModerationOpts} from '@bsky.app/sdk/moderation'
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
@@ -189,7 +188,7 @@ function SyncStatus({
|
|||||||
info,
|
info,
|
||||||
refetchStatus,
|
refetchStatus,
|
||||||
}: {
|
}: {
|
||||||
info: AppBskyContactDefs.SyncStatus
|
info: app.bsky.contact.defs.SyncStatus
|
||||||
refetchStatus: () => Promise<any>
|
refetchStatus: () => Promise<any>
|
||||||
}) {
|
}) {
|
||||||
const ax = useAnalytics()
|
const ax = useAnalytics()
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import {type AppBskyNotificationDeclaration} from '@atproto/api'
|
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {Trans} from '@lingui/react/macro'
|
import {Trans} from '@lingui/react/macro'
|
||||||
import {type NativeStackScreenProps} from '@react-navigation/native-stack'
|
import {type NativeStackScreenProps} from '@react-navigation/native-stack'
|
||||||
|
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {type CommonNavigatorParams} from '#/lib/routes/types'
|
import {type CommonNavigatorParams} from '#/lib/routes/types'
|
||||||
import {useNotificationDeclarationQuery} from '#/state/queries/activity-subscriptions'
|
import {useNotificationDeclarationQuery} from '#/state/queries/activity-subscriptions'
|
||||||
import {useAppPasswordsQuery} from '#/state/queries/app-passwords'
|
import {useAppPasswordsQuery} from '#/state/queries/app-passwords'
|
||||||
@@ -146,7 +146,7 @@ function NotificationDeclaration({
|
|||||||
isError,
|
isError,
|
||||||
}: {
|
}: {
|
||||||
data?: {
|
data?: {
|
||||||
value: AppBskyNotificationDeclaration.Record
|
value: app.bsky.notification.declaration.Main
|
||||||
}
|
}
|
||||||
isError?: boolean
|
isError?: boolean
|
||||||
}) {
|
}) {
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import {useState} from 'react'
|
import {useState} from 'react'
|
||||||
import {Alert, LayoutAnimation, Linking, Pressable, View} from 'react-native'
|
import {Alert, LayoutAnimation, Linking, Pressable, View} from 'react-native'
|
||||||
import {useReducedMotion} from 'react-native-reanimated'
|
import {useReducedMotion} from 'react-native-reanimated'
|
||||||
import {type AppBskyActorDefs} from '@atproto/api'
|
|
||||||
import {removeNuxs} from '@bsky.app/sdk'
|
import {removeNuxs} from '@bsky.app/sdk'
|
||||||
import {Trans, useLingui} from '@lingui/react/macro'
|
import {Trans, useLingui} from '@lingui/react/macro'
|
||||||
import {useNavigation} from '@react-navigation/native'
|
import {useNavigation} from '@react-navigation/native'
|
||||||
import {type NativeStackScreenProps} from '@react-navigation/native-stack'
|
import {type NativeStackScreenProps} from '@react-navigation/native-stack'
|
||||||
|
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {HELP_DESK_URL, HITSLOP_10} from '#/lib/constants'
|
import {HELP_DESK_URL, HITSLOP_10} from '#/lib/constants'
|
||||||
import {useAccountSwitcher} from '#/lib/hooks/useAccountSwitcher'
|
import {useAccountSwitcher} from '#/lib/hooks/useAccountSwitcher'
|
||||||
import {useApplyPullRequestOTAUpdate} from '#/lib/hooks/useOTAUpdates'
|
import {useApplyPullRequestOTAUpdate} from '#/lib/hooks/useOTAUpdates'
|
||||||
@@ -321,7 +321,7 @@ export function SettingsScreen({}: Props) {
|
|||||||
function ProfilePreview({
|
function ProfilePreview({
|
||||||
profile,
|
profile,
|
||||||
}: {
|
}: {
|
||||||
profile: AppBskyActorDefs.ProfileViewDetailed
|
profile: app.bsky.actor.defs.ProfileViewDetailed
|
||||||
}) {
|
}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const {gtMobile} = useBreakpoints()
|
const {gtMobile} = useBreakpoints()
|
||||||
@@ -608,7 +608,7 @@ function AccountRow({
|
|||||||
pendingDid,
|
pendingDid,
|
||||||
onPressSwitchAccount,
|
onPressSwitchAccount,
|
||||||
}: {
|
}: {
|
||||||
profile?: AppBskyActorDefs.ProfileViewDetailed
|
profile?: app.bsky.actor.defs.ProfileViewDetailed
|
||||||
account: SessionAccount
|
account: SessionAccount
|
||||||
pendingDid: string | null
|
pendingDid: string | null
|
||||||
onPressSwitchAccount: (
|
onPressSwitchAccount: (
|
||||||
|
|||||||
@@ -10,12 +10,12 @@ import Animated, {
|
|||||||
SlideOutLeft,
|
SlideOutLeft,
|
||||||
SlideOutRight,
|
SlideOutRight,
|
||||||
} from 'react-native-reanimated'
|
} from 'react-native-reanimated'
|
||||||
import {type ComAtprotoServerDescribeServer} from '@atproto/api'
|
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {Trans} from '@lingui/react/macro'
|
import {Trans} from '@lingui/react/macro'
|
||||||
import {useMutation, useQueryClient} from '@tanstack/react-query'
|
import {useMutation, useQueryClient} from '@tanstack/react-query'
|
||||||
|
|
||||||
|
import {com} from '#/lexicons'
|
||||||
import {HITSLOP_10, urls} from '#/lib/constants'
|
import {HITSLOP_10, urls} from '#/lib/constants'
|
||||||
import {cleanError} from '#/lib/strings/errors'
|
import {cleanError} from '#/lib/strings/errors'
|
||||||
import {
|
import {
|
||||||
@@ -147,7 +147,7 @@ function ProvidedHandlePage({
|
|||||||
serviceInfo,
|
serviceInfo,
|
||||||
goToOwnHandle,
|
goToOwnHandle,
|
||||||
}: {
|
}: {
|
||||||
serviceInfo: ComAtprotoServerDescribeServer.OutputSchema
|
serviceInfo: com.atproto.server.describeServer.$OutputBody
|
||||||
goToOwnHandle: () => void
|
goToOwnHandle: () => void
|
||||||
}) {
|
}) {
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import {useCallback} from 'react'
|
import {useCallback} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {type $Typed, ComAtprotoLabelDefs} from '@atproto/api'
|
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {Trans} from '@lingui/react/macro'
|
import {Trans} from '@lingui/react/macro'
|
||||||
@@ -9,6 +8,8 @@ import {
|
|||||||
useProfileQuery,
|
useProfileQuery,
|
||||||
useProfileUpdateMutation,
|
useProfileUpdateMutation,
|
||||||
} from '#/state/queries/profile'
|
} from '#/state/queries/profile'
|
||||||
|
import {type $Typed} from '@atproto/lex'
|
||||||
|
import {com} from '#/lexicons'
|
||||||
import {useSession} from '#/state/session'
|
import {useSession} from '#/state/session'
|
||||||
import {atoms as a, useTheme} from '#/alf'
|
import {atoms as a, useTheme} from '#/alf'
|
||||||
import * as Toggle from '#/components/forms/Toggle'
|
import * as Toggle from '#/components/forms/Toggle'
|
||||||
@@ -35,9 +36,9 @@ export function PwiOptOut() {
|
|||||||
profile,
|
profile,
|
||||||
updates: existing => {
|
updates: existing => {
|
||||||
// create labels attr if needed
|
// create labels attr if needed
|
||||||
const labels: $Typed<ComAtprotoLabelDefs.SelfLabels> = bsky.validate(
|
const labels: $Typed<com.atproto.label.defs.SelfLabels> = bsky.matches(
|
||||||
|
com.atproto.label.defs.selfLabels,
|
||||||
existing.labels,
|
existing.labels,
|
||||||
ComAtprotoLabelDefs.validateSelfLabels,
|
|
||||||
)
|
)
|
||||||
? existing.labels
|
? existing.labels
|
||||||
: {
|
: {
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import {type ComAtprotoTempCheckHandleAvailability} from '@atproto/api'
|
|
||||||
import {Sift, SiftItem} from '@bsky.app/sift'
|
import {Sift, SiftItem} from '@bsky.app/sift'
|
||||||
import {Trans, useLingui} from '@lingui/react/macro'
|
import {Trans, useLingui} from '@lingui/react/macro'
|
||||||
|
|
||||||
|
import {com} from '#/lexicons'
|
||||||
import {atoms as a, useTheme} from '#/alf'
|
import {atoms as a, useTheme} from '#/alf'
|
||||||
import {Portal} from '#/components/Portal'
|
import {Portal} from '#/components/Portal'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
import {type HandleSuggestionsProps} from './shared'
|
import {type HandleSuggestionsProps} from './shared'
|
||||||
|
|
||||||
type Suggestion = ComAtprotoTempCheckHandleAvailability.Suggestion & {
|
type Suggestion = com.atproto.temp.checkHandleAvailability.Suggestion & {
|
||||||
key: string
|
key: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import {type ComAtprotoTempCheckHandleAvailability} from '@atproto/api'
|
|
||||||
import {type UseSiftReturn} from '@bsky.app/sift'
|
import {type UseSiftReturn} from '@bsky.app/sift'
|
||||||
|
import {com} from '#/lexicons'
|
||||||
|
|
||||||
export type HandleSuggestionsProps = {
|
export type HandleSuggestionsProps = {
|
||||||
suggestions: ComAtprotoTempCheckHandleAvailability.Suggestion[]
|
suggestions: com.atproto.temp.checkHandleAvailability.Suggestion[]
|
||||||
onSelect: (
|
onSelect: (
|
||||||
suggestion: ComAtprotoTempCheckHandleAvailability.Suggestion,
|
suggestion: com.atproto.temp.checkHandleAvailability.Suggestion,
|
||||||
) => void
|
) => void
|
||||||
/**
|
/**
|
||||||
* Web only: the Sift instance shared with the handle input. It carries the
|
* Web only: the Sift instance shared with the handle input. It carries the
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import {type ReactElement} from 'react'
|
import {type ReactElement} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {type ComAtprotoServerDescribeServer} from '@atproto/api'
|
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {Trans} from '@lingui/react/macro'
|
import {Trans} from '@lingui/react/macro'
|
||||||
|
|
||||||
|
import {com} from '#/lexicons'
|
||||||
import {atoms as a, useTheme} from '#/alf'
|
import {atoms as a, useTheme} from '#/alf'
|
||||||
import {Admonition} from '#/components/Admonition'
|
import {Admonition} from '#/components/Admonition'
|
||||||
import {InlineLinkText} from '#/components/Link'
|
import {InlineLinkText} from '#/components/Link'
|
||||||
@@ -13,7 +13,7 @@ import {Text} from '#/components/Typography'
|
|||||||
export const Policies = ({
|
export const Policies = ({
|
||||||
serviceDescription,
|
serviceDescription,
|
||||||
}: {
|
}: {
|
||||||
serviceDescription: ComAtprotoServerDescribeServer.OutputSchema
|
serviceDescription: com.atproto.server.describeServer.$OutputBody
|
||||||
}) => {
|
}) => {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ import {AppState, type AppStateStatus, View} from 'react-native'
|
|||||||
import ReactNativeDeviceAttest from 'react-native-device-attest'
|
import ReactNativeDeviceAttest from 'react-native-device-attest'
|
||||||
import {KeyboardAvoidingView} from 'react-native-keyboard-controller'
|
import {KeyboardAvoidingView} from 'react-native-keyboard-controller'
|
||||||
import Animated, {FadeIn, LayoutAnimationConfig} from 'react-native-reanimated'
|
import Animated, {FadeIn, LayoutAnimationConfig} from 'react-native-reanimated'
|
||||||
import {AppBskyGraphStarterpack} from '@atproto/api'
|
|
||||||
import {tokens} from '@bsky.app/alf'
|
import {tokens} from '@bsky.app/alf'
|
||||||
import {Trans, useLingui} from '@lingui/react/macro'
|
import {Trans, useLingui} from '@lingui/react/macro'
|
||||||
|
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {FEEDBACK_FORM_URL} from '#/lib/constants'
|
import {FEEDBACK_FORM_URL} from '#/lib/constants'
|
||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
import {useServiceQuery} from '#/state/queries/service'
|
import {useServiceQuery} from '#/state/queries/service'
|
||||||
@@ -141,10 +141,7 @@ export function Signup({onPressBack}: {onPressBack: () => void}) {
|
|||||||
scrollable>
|
scrollable>
|
||||||
<View testID="createAccount" style={a.flex_1}>
|
<View testID="createAccount" style={a.flex_1}>
|
||||||
{showStarterPackCard &&
|
{showStarterPackCard &&
|
||||||
bsky.dangerousIsType<AppBskyGraphStarterpack.Record>(
|
bsky.isType(app.bsky.graph.starterpack, starterPack.record) ? (
|
||||||
starterPack.record,
|
|
||||||
AppBskyGraphStarterpack.isRecord,
|
|
||||||
) ? (
|
|
||||||
<Animated.View
|
<Animated.View
|
||||||
entering={!isFetchedAtMount ? FadeIn : undefined}>
|
entering={!isFetchedAtMount ? FadeIn : undefined}>
|
||||||
<LinearGradientBackground
|
<LinearGradientBackground
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import {createContext, useCallback, useContext} from 'react'
|
import {createContext, useCallback, useContext} from 'react'
|
||||||
import {LayoutAnimation} from 'react-native'
|
import {LayoutAnimation} from 'react-native'
|
||||||
import {type ComAtprotoServerDescribeServer} from '@atproto/api'
|
|
||||||
import {useLingui} from '@lingui/react/macro'
|
import {useLingui} from '@lingui/react/macro'
|
||||||
import * as EmailValidator from 'email-validator'
|
import * as EmailValidator from 'email-validator'
|
||||||
|
|
||||||
@@ -14,7 +13,7 @@ import {useOnboardingDispatch} from '#/state/shell'
|
|||||||
import {type AnalyticsContextType, useAnalytics} from '#/analytics'
|
import {type AnalyticsContextType, useAnalytics} from '#/analytics'
|
||||||
import {com} from '#/lexicons'
|
import {com} from '#/lexicons'
|
||||||
|
|
||||||
export type ServiceDescription = ComAtprotoServerDescribeServer.OutputSchema
|
export type ServiceDescription = com.atproto.server.describeServer.$OutputBody
|
||||||
|
|
||||||
const date = new Date()
|
const date = new Date()
|
||||||
date.setFullYear(date.getFullYear() - 20) // default to 20 years ago
|
date.setFullYear(date.getFullYear() - 20) // default to 20 years ago
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
import {useEffect, useState} from 'react'
|
import {useEffect, useState} from 'react'
|
||||||
import {Pressable, View} from 'react-native'
|
import {Pressable, View} from 'react-native'
|
||||||
import Animated, {FadeIn, FadeOut} from 'react-native-reanimated'
|
import Animated, {FadeIn, FadeOut} from 'react-native-reanimated'
|
||||||
import {AppBskyGraphDefs, AppBskyGraphStarterpack, AtUri} from '@atproto/api'
|
|
||||||
import {type ModerationOpts} from '@bsky.app/sdk/moderation'
|
import {type ModerationOpts} from '@bsky.app/sdk/moderation'
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {Trans} from '@lingui/react/macro'
|
import {Trans} from '@lingui/react/macro'
|
||||||
|
|
||||||
|
import {AtUri} from '@atproto/syntax'
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {JOINED_THIS_WEEK} from '#/lib/constants'
|
import {JOINED_THIS_WEEK} from '#/lib/constants'
|
||||||
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
|
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
|
||||||
import {createStarterPackGooglePlayUri} from '#/lib/strings/starter-pack'
|
import {createStarterPackGooglePlayUri} from '#/lib/strings/starter-pack'
|
||||||
@@ -68,8 +69,8 @@ export function LandingScreen({
|
|||||||
const isValid =
|
const isValid =
|
||||||
starterPack &&
|
starterPack &&
|
||||||
starterPack.list &&
|
starterPack.list &&
|
||||||
AppBskyGraphDefs.validateStarterPackView(starterPack) &&
|
bsky.matches(app.bsky.graph.defs.starterPackView, starterPack) &&
|
||||||
AppBskyGraphStarterpack.validateRecord(starterPack.record)
|
bsky.matches(app.bsky.graph.starterpack, starterPack.record)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isErrorStarterPack || (starterPack && !isValid)) {
|
if (isErrorStarterPack || (starterPack && !isValid)) {
|
||||||
@@ -82,12 +83,7 @@ export function LandingScreen({
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Just for types, this cannot be hit
|
// Just for types, this cannot be hit
|
||||||
if (
|
if (!bsky.isType(app.bsky.graph.starterpack, starterPack.record)) {
|
||||||
!bsky.dangerousIsType<AppBskyGraphStarterpack.Record>(
|
|
||||||
starterPack.record,
|
|
||||||
AppBskyGraphStarterpack.isRecord,
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,8 +105,8 @@ function LandingScreenLoaded({
|
|||||||
|
|
||||||
moderationOpts,
|
moderationOpts,
|
||||||
}: {
|
}: {
|
||||||
starterPack: AppBskyGraphDefs.StarterPackView
|
starterPack: app.bsky.graph.defs.StarterPackView
|
||||||
starterPackRecord: AppBskyGraphStarterpack.Record
|
starterPackRecord: app.bsky.graph.starterpack.Main
|
||||||
setScreenState: (state: LoggedOutScreenState) => void
|
setScreenState: (state: LoggedOutScreenState) => void
|
||||||
moderationOpts: ModerationOpts
|
moderationOpts: ModerationOpts
|
||||||
}) {
|
}) {
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import {useCallback, useEffect, useState} from 'react'
|
import {useCallback, useEffect, useState} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {Image} from 'expo-image'
|
import {Image} from 'expo-image'
|
||||||
import {AppBskyGraphDefs, AppBskyGraphStarterpack, AtUri} from '@atproto/api'
|
import {type AtUriString, AtUri} from '@atproto/syntax'
|
||||||
import {type AtUriString} from '@atproto/syntax'
|
|
||||||
import {type ModerationOpts} from '@bsky.app/sdk/moderation'
|
import {type ModerationOpts} from '@bsky.app/sdk/moderation'
|
||||||
import {RichText as RichTextAPI} from '@bsky.app/sdk/richtext'
|
import {RichText as RichTextAPI} from '@bsky.app/sdk/richtext'
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
@@ -12,6 +11,7 @@ import {useNavigation} from '@react-navigation/native'
|
|||||||
import {type NativeStackScreenProps} from '@react-navigation/native-stack'
|
import {type NativeStackScreenProps} from '@react-navigation/native-stack'
|
||||||
import {useQueryClient} from '@tanstack/react-query'
|
import {useQueryClient} from '@tanstack/react-query'
|
||||||
|
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {batchedUpdates} from '#/lib/batchedUpdates'
|
import {batchedUpdates} from '#/lib/batchedUpdates'
|
||||||
import {HITSLOP_20} from '#/lib/constants'
|
import {HITSLOP_20} from '#/lib/constants'
|
||||||
import {isBlockedOrBlocking, isMuted} from '#/lib/moderation/blocked-and-muted'
|
import {isBlockedOrBlocking, isMuted} from '#/lib/moderation/blocked-and-muted'
|
||||||
@@ -147,8 +147,8 @@ export function StarterPackScreenInner({
|
|||||||
const isValid =
|
const isValid =
|
||||||
starterPack &&
|
starterPack &&
|
||||||
(starterPack.list || starterPack?.creator?.did === currentAccount?.did) &&
|
(starterPack.list || starterPack?.creator?.did === currentAccount?.did) &&
|
||||||
AppBskyGraphDefs.validateStarterPackView(starterPack) &&
|
bsky.matches(app.bsky.graph.defs.starterPackView, starterPack) &&
|
||||||
AppBskyGraphStarterpack.validateRecord(starterPack.record)
|
bsky.matches(app.bsky.graph.starterpack, starterPack.record)
|
||||||
|
|
||||||
if (!did || !starterPack || !isValid || !moderationOpts) {
|
if (!did || !starterPack || !isValid || !moderationOpts) {
|
||||||
return (
|
return (
|
||||||
@@ -179,7 +179,7 @@ function StarterPackScreenLoaded({
|
|||||||
routeParams,
|
routeParams,
|
||||||
moderationOpts,
|
moderationOpts,
|
||||||
}: {
|
}: {
|
||||||
starterPack: AppBskyGraphDefs.StarterPackView
|
starterPack: app.bsky.graph.defs.StarterPackView
|
||||||
routeParams: StarterPackScreeProps['route']['params']
|
routeParams: StarterPackScreeProps['route']['params']
|
||||||
moderationOpts: ModerationOpts
|
moderationOpts: ModerationOpts
|
||||||
}) {
|
}) {
|
||||||
@@ -301,7 +301,7 @@ function Header({
|
|||||||
routeParams,
|
routeParams,
|
||||||
onOpenShareDialog,
|
onOpenShareDialog,
|
||||||
}: {
|
}: {
|
||||||
starterPack: AppBskyGraphDefs.StarterPackView
|
starterPack: app.bsky.graph.defs.StarterPackView
|
||||||
routeParams: StarterPackScreeProps['route']['params']
|
routeParams: StarterPackScreeProps['route']['params']
|
||||||
onOpenShareDialog: () => void
|
onOpenShareDialog: () => void
|
||||||
}) {
|
}) {
|
||||||
@@ -350,7 +350,7 @@ function Header({
|
|||||||
|
|
||||||
setIsProcessing(true)
|
setIsProcessing(true)
|
||||||
|
|
||||||
let listItems: AppBskyGraphDefs.ListItemView[] = []
|
let listItems: app.bsky.graph.defs.ListItemView[] = []
|
||||||
try {
|
try {
|
||||||
listItems = await getAllListMembers(appviewClient, starterPack.list.uri)
|
listItems = await getAllListMembers(appviewClient, starterPack.list.uri)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -406,12 +406,7 @@ function Header({
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (!bsky.isType(app.bsky.graph.starterpack, record)) {
|
||||||
!bsky.dangerousIsType<AppBskyGraphStarterpack.Record>(
|
|
||||||
record,
|
|
||||||
AppBskyGraphStarterpack.isRecord,
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -522,7 +517,7 @@ function OverflowMenu({
|
|||||||
routeParams,
|
routeParams,
|
||||||
onOpenShareDialog,
|
onOpenShareDialog,
|
||||||
}: {
|
}: {
|
||||||
starterPack: AppBskyGraphDefs.StarterPackView
|
starterPack: app.bsky.graph.defs.StarterPackView
|
||||||
routeParams: StarterPackScreeProps['route']['params']
|
routeParams: StarterPackScreeProps['route']['params']
|
||||||
onOpenShareDialog: () => void
|
onOpenShareDialog: () => void
|
||||||
}) {
|
}) {
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
import {createContext, useContext, useReducer} from 'react'
|
import {createContext, useContext, useReducer} from 'react'
|
||||||
import {
|
|
||||||
type AppBskyFeedDefs,
|
|
||||||
type AppBskyGraphDefs,
|
|
||||||
AppBskyGraphStarterpack,
|
|
||||||
} from '@atproto/api'
|
|
||||||
import {msg, plural} from '@lingui/core/macro'
|
import {msg, plural} from '@lingui/core/macro'
|
||||||
|
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {STARTER_PACK_MAX_SIZE} from '#/lib/constants'
|
import {STARTER_PACK_MAX_SIZE} from '#/lib/constants'
|
||||||
import * as Toast from '#/components/Toast'
|
import * as Toast from '#/components/Toast'
|
||||||
import * as bsky from '#/types/bsky'
|
import * as bsky from '#/types/bsky'
|
||||||
@@ -21,7 +17,7 @@ type Action =
|
|||||||
| {type: 'SetDescription'; description: string}
|
| {type: 'SetDescription'; description: string}
|
||||||
| {type: 'AddProfile'; profile: bsky.profile.AnyProfileView}
|
| {type: 'AddProfile'; profile: bsky.profile.AnyProfileView}
|
||||||
| {type: 'RemoveProfile'; profileDid: string}
|
| {type: 'RemoveProfile'; profileDid: string}
|
||||||
| {type: 'AddFeed'; feed: AppBskyFeedDefs.GeneratorView}
|
| {type: 'AddFeed'; feed: app.bsky.feed.defs.GeneratorView}
|
||||||
| {type: 'RemoveFeed'; feedUri: string}
|
| {type: 'RemoveFeed'; feedUri: string}
|
||||||
| {type: 'SetProcessing'; processing: boolean}
|
| {type: 'SetProcessing'; processing: boolean}
|
||||||
| {type: 'SetError'; error: string}
|
| {type: 'SetError'; error: string}
|
||||||
@@ -32,7 +28,7 @@ interface State {
|
|||||||
name?: string
|
name?: string
|
||||||
description?: string
|
description?: string
|
||||||
profiles: bsky.profile.AnyProfileView[]
|
profiles: bsky.profile.AnyProfileView[]
|
||||||
feeds: AppBskyFeedDefs.GeneratorView[]
|
feeds: app.bsky.feed.defs.GeneratorView[]
|
||||||
processing: boolean
|
processing: boolean
|
||||||
error?: string
|
error?: string
|
||||||
transitionDirection: 'Backward' | 'Forward'
|
transitionDirection: 'Backward' | 'Forward'
|
||||||
@@ -125,8 +121,8 @@ export function Provider({
|
|||||||
targetProfile,
|
targetProfile,
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
starterPack?: AppBskyGraphDefs.StarterPackView
|
starterPack?: app.bsky.graph.defs.StarterPackView
|
||||||
listItems?: AppBskyGraphDefs.ListItemView[]
|
listItems?: app.bsky.graph.defs.ListItemView[]
|
||||||
targetProfile: bsky.profile.AnyProfileView
|
targetProfile: bsky.profile.AnyProfileView
|
||||||
children: React.ReactNode
|
children: React.ReactNode
|
||||||
}) {
|
}) {
|
||||||
@@ -135,7 +131,7 @@ export function Provider({
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
starterPack &&
|
starterPack &&
|
||||||
bsky.validate(starterPack.record, AppBskyGraphStarterpack.validateRecord)
|
bsky.matches(app.bsky.graph.starterpack, starterPack.record)
|
||||||
) {
|
) {
|
||||||
return {
|
return {
|
||||||
canNext: true,
|
canNext: true,
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import {useState} from 'react'
|
import {useState} from 'react'
|
||||||
import {type ListRenderItemInfo, View} from 'react-native'
|
import {type ListRenderItemInfo, View} from 'react-native'
|
||||||
import {KeyboardAwareScrollView} from 'react-native-keyboard-controller'
|
import {KeyboardAwareScrollView} from 'react-native-keyboard-controller'
|
||||||
import {type AppBskyFeedDefs} from '@atproto/api'
|
|
||||||
import {type ModerationOpts} from '@bsky.app/sdk/moderation'
|
import {type ModerationOpts} from '@bsky.app/sdk/moderation'
|
||||||
import {Trans} from '@lingui/react/macro'
|
import {Trans} from '@lingui/react/macro'
|
||||||
|
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {DISCOVER_FEED_URI} from '#/lib/constants'
|
import {DISCOVER_FEED_URI} from '#/lib/constants'
|
||||||
import {useA11y} from '#/state/a11y'
|
import {useA11y} from '#/state/a11y'
|
||||||
import {
|
import {
|
||||||
@@ -22,7 +22,7 @@ import {ScreenTransition} from '#/components/ScreenTransition'
|
|||||||
import {WizardFeedCard} from '#/components/StarterPack/Wizard/WizardListCard'
|
import {WizardFeedCard} from '#/components/StarterPack/Wizard/WizardListCard'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
|
|
||||||
function keyExtractor(item: AppBskyFeedDefs.GeneratorView) {
|
function keyExtractor(item: app.bsky.feed.defs.GeneratorView) {
|
||||||
return item.uri
|
return item.uri
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ export function StepFeeds({moderationOpts}: {moderationOpts: ModerationOpts}) {
|
|||||||
useSavedFeeds()
|
useSavedFeeds()
|
||||||
const savedFeeds = savedFeedsAndLists?.feeds
|
const savedFeeds = savedFeedsAndLists?.feeds
|
||||||
.filter(f => f.type === 'feed' && f.view.uri !== DISCOVER_FEED_URI)
|
.filter(f => f.type === 'feed' && f.view.uri !== DISCOVER_FEED_URI)
|
||||||
.map(f => f.view) as AppBskyFeedDefs.GeneratorView[]
|
.map(f => f.view) as app.bsky.feed.defs.GeneratorView[]
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: popularFeedsPages,
|
data: popularFeedsPages,
|
||||||
@@ -67,7 +67,7 @@ export function StepFeeds({moderationOpts}: {moderationOpts: ModerationOpts}) {
|
|||||||
|
|
||||||
const renderItem = ({
|
const renderItem = ({
|
||||||
item,
|
item,
|
||||||
}: ListRenderItemInfo<AppBskyFeedDefs.GeneratorView>) => {
|
}: ListRenderItemInfo<app.bsky.feed.defs.GeneratorView>) => {
|
||||||
return (
|
return (
|
||||||
<WizardFeedCard
|
<WizardFeedCard
|
||||||
generator={item}
|
generator={item}
|
||||||
|
|||||||
@@ -3,12 +3,6 @@ import {Keyboard, View} from 'react-native'
|
|||||||
import {KeyboardAwareScrollView} from 'react-native-keyboard-controller'
|
import {KeyboardAwareScrollView} from 'react-native-keyboard-controller'
|
||||||
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
||||||
import {Image} from 'expo-image'
|
import {Image} from 'expo-image'
|
||||||
import {
|
|
||||||
type AppBskyActorDefs,
|
|
||||||
type AppBskyFeedDefs,
|
|
||||||
type AppBskyGraphDefs,
|
|
||||||
AtUri,
|
|
||||||
} from '@atproto/api'
|
|
||||||
import {type ModerationOpts} from '@bsky.app/sdk/moderation'
|
import {type ModerationOpts} from '@bsky.app/sdk/moderation'
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
@@ -16,6 +10,8 @@ import {Plural, Trans} from '@lingui/react/macro'
|
|||||||
import {useNavigation} from '@react-navigation/native'
|
import {useNavigation} from '@react-navigation/native'
|
||||||
import {type NativeStackScreenProps} from '@react-navigation/native-stack'
|
import {type NativeStackScreenProps} from '@react-navigation/native-stack'
|
||||||
|
|
||||||
|
import {AtUri} from '@atproto/syntax'
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {STARTER_PACK_MAX_SIZE} from '#/lib/constants'
|
import {STARTER_PACK_MAX_SIZE} from '#/lib/constants'
|
||||||
import {createSanitizedDisplayName} from '#/lib/moderation/create-sanitized-display-name'
|
import {createSanitizedDisplayName} from '#/lib/moderation/create-sanitized-display-name'
|
||||||
import {
|
import {
|
||||||
@@ -159,9 +155,9 @@ function WizardInner({
|
|||||||
fromDialog,
|
fromDialog,
|
||||||
onSuccess,
|
onSuccess,
|
||||||
}: {
|
}: {
|
||||||
currentStarterPack?: AppBskyGraphDefs.StarterPackView
|
currentStarterPack?: app.bsky.graph.defs.StarterPackView
|
||||||
currentListItems?: AppBskyGraphDefs.ListItemView[]
|
currentListItems?: app.bsky.graph.defs.ListItemView[]
|
||||||
profile: AppBskyActorDefs.ProfileViewDetailed
|
profile: app.bsky.actor.defs.ProfileViewDetailed
|
||||||
moderationOpts: ModerationOpts
|
moderationOpts: ModerationOpts
|
||||||
fromDialog?: boolean
|
fromDialog?: boolean
|
||||||
onSuccess?: () => void
|
onSuccess?: () => void
|
||||||
@@ -625,7 +621,7 @@ function Footer({
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getName(
|
function getName(
|
||||||
item: bsky.profile.AnyProfileView | AppBskyFeedDefs.GeneratorView,
|
item: bsky.profile.AnyProfileView | app.bsky.feed.defs.GeneratorView,
|
||||||
) {
|
) {
|
||||||
if (typeof item.displayName === 'string') {
|
if (typeof item.displayName === 'string') {
|
||||||
return enforceLen(sanitizeDisplayName(item.displayName), 28, true)
|
return enforceLen(sanitizeDisplayName(item.displayName), 28, true)
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import {useState} from 'react'
|
|||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {KeyboardAwareScrollView} from 'react-native-keyboard-controller'
|
import {KeyboardAwareScrollView} from 'react-native-keyboard-controller'
|
||||||
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
||||||
import {ToolsOzoneReportDefs} from '@atproto/api'
|
|
||||||
import {type DidString} from '@atproto/syntax'
|
import {type DidString} from '@atproto/syntax'
|
||||||
import {msg} from '@lingui/core/macro'
|
import {msg} from '@lingui/core/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
@@ -25,7 +24,7 @@ import {SimpleInlineLinkText} from '#/components/Link'
|
|||||||
import {Loader} from '#/components/Loader'
|
import {Loader} from '#/components/Loader'
|
||||||
import {P, Text} from '#/components/Typography'
|
import {P, Text} from '#/components/Typography'
|
||||||
import {IS_WEB} from '#/env'
|
import {IS_WEB} from '#/env'
|
||||||
import {com} from '#/lexicons'
|
import {com, tools} from '#/lexicons'
|
||||||
|
|
||||||
const COL_WIDTH = 400
|
const COL_WIDTH = 400
|
||||||
|
|
||||||
@@ -55,7 +54,7 @@ export function Takendown() {
|
|||||||
await client.call(
|
await client.call(
|
||||||
com.atproto.moderation.createReport,
|
com.atproto.moderation.createReport,
|
||||||
{
|
{
|
||||||
reasonType: ToolsOzoneReportDefs.REASONAPPEAL,
|
reasonType: tools.ozone.report.defs.reasonAppeal,
|
||||||
subject: {
|
subject: {
|
||||||
$type: 'com.atproto.admin.defs#repoRef',
|
$type: 'com.atproto.admin.defs#repoRef',
|
||||||
// the persisted account did is already resolved
|
// the persisted account did is already resolved
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import {useCallback, useMemo, useState} from 'react'
|
import {useCallback, useMemo, useState} from 'react'
|
||||||
import {type ListRenderItemInfo, View} from 'react-native'
|
import {type ListRenderItemInfo, View} from 'react-native'
|
||||||
import {type AppBskyFeedDefs} from '@atproto/api'
|
|
||||||
import {useLingui} from '@lingui/react/macro'
|
import {useLingui} from '@lingui/react/macro'
|
||||||
import {type NativeStackScreenProps} from '@react-navigation/native-stack'
|
import {type NativeStackScreenProps} from '@react-navigation/native-stack'
|
||||||
|
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {HITSLOP_10} from '#/lib/constants'
|
import {HITSLOP_10} from '#/lib/constants'
|
||||||
import {useInitialNumToRender} from '#/lib/hooks/useInitialNumToRender'
|
import {useInitialNumToRender} from '#/lib/hooks/useInitialNumToRender'
|
||||||
import {usePostViewTracking} from '#/lib/hooks/usePostViewTracking'
|
import {usePostViewTracking} from '#/lib/hooks/usePostViewTracking'
|
||||||
@@ -22,11 +22,13 @@ import {ArrowOutOfBoxModified_Stroke2_Corner2_Rounded as Share} from '#/componen
|
|||||||
import * as Layout from '#/components/Layout'
|
import * as Layout from '#/components/Layout'
|
||||||
import {ListFooter, ListMaybePlaceholder} from '#/components/Lists'
|
import {ListFooter, ListMaybePlaceholder} from '#/components/Lists'
|
||||||
|
|
||||||
const renderItem = ({item}: ListRenderItemInfo<AppBskyFeedDefs.PostView>) => {
|
const renderItem = ({
|
||||||
|
item,
|
||||||
|
}: ListRenderItemInfo<app.bsky.feed.defs.PostView>) => {
|
||||||
return <Post post={item} />
|
return <Post post={item} />
|
||||||
}
|
}
|
||||||
|
|
||||||
const keyExtractor = (item: AppBskyFeedDefs.PostView, index: number) => {
|
const keyExtractor = (item: app.bsky.feed.defs.PostView, index: number) => {
|
||||||
return `${item.uri}-${index}`
|
return `${item.uri}-${index}`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,12 +25,6 @@ import {useEvent, useEventListener} from 'expo'
|
|||||||
import {Image, type ImageStyle} from 'expo-image'
|
import {Image, type ImageStyle} from 'expo-image'
|
||||||
import {LinearGradient} from 'expo-linear-gradient'
|
import {LinearGradient} from 'expo-linear-gradient'
|
||||||
import {createVideoPlayer, type VideoPlayer, VideoView} from 'expo-video'
|
import {createVideoPlayer, type VideoPlayer, VideoView} from 'expo-video'
|
||||||
import {
|
|
||||||
AppBskyEmbedVideo,
|
|
||||||
type AppBskyFeedDefs,
|
|
||||||
AppBskyFeedPost,
|
|
||||||
AtUri,
|
|
||||||
} from '@atproto/api'
|
|
||||||
import {type ModerationDecision} from '@bsky.app/sdk/moderation'
|
import {type ModerationDecision} from '@bsky.app/sdk/moderation'
|
||||||
import {RichText as RichTextAPI} from '@bsky.app/sdk/richtext'
|
import {RichText as RichTextAPI} from '@bsky.app/sdk/richtext'
|
||||||
import {Trans, useLingui} from '@lingui/react/macro'
|
import {Trans, useLingui} from '@lingui/react/macro'
|
||||||
@@ -43,6 +37,8 @@ import {
|
|||||||
} from '@react-navigation/native'
|
} from '@react-navigation/native'
|
||||||
import {type NativeStackScreenProps} from '@react-navigation/native-stack'
|
import {type NativeStackScreenProps} from '@react-navigation/native-stack'
|
||||||
|
|
||||||
|
import {AtUri} from '@atproto/syntax'
|
||||||
|
import {app} from '#/lexicons'
|
||||||
import {HITSLOP_20} from '#/lib/constants'
|
import {HITSLOP_20} from '#/lib/constants'
|
||||||
import {useHaptics} from '#/lib/haptics'
|
import {useHaptics} from '#/lib/haptics'
|
||||||
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
|
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
|
||||||
@@ -177,8 +173,8 @@ type CurrentSource = {
|
|||||||
|
|
||||||
type VideoItem = {
|
type VideoItem = {
|
||||||
moderation: ModerationDecision
|
moderation: ModerationDecision
|
||||||
post: AppBskyFeedDefs.PostView
|
post: app.bsky.feed.defs.PostView
|
||||||
video: AppBskyEmbedVideo.View
|
video: app.bsky.embed.video.View
|
||||||
feedContext: string | undefined
|
feedContext: string | undefined
|
||||||
reqId: string | undefined
|
reqId: string | undefined
|
||||||
}
|
}
|
||||||
@@ -216,8 +212,8 @@ function Feed() {
|
|||||||
const items: {
|
const items: {
|
||||||
_reactKey: string
|
_reactKey: string
|
||||||
moderation: ModerationDecision
|
moderation: ModerationDecision
|
||||||
post: AppBskyFeedDefs.PostView
|
post: app.bsky.feed.defs.PostView
|
||||||
video: AppBskyEmbedVideo.View
|
video: app.bsky.embed.video.View
|
||||||
feedContext: string | undefined
|
feedContext: string | undefined
|
||||||
reqId: string | undefined
|
reqId: string | undefined
|
||||||
}[] = []
|
}[] = []
|
||||||
@@ -225,7 +221,10 @@ function Feed() {
|
|||||||
const feedPost = slice.items.find(
|
const feedPost = slice.items.find(
|
||||||
item => item.uri === slice.feedPostUri,
|
item => item.uri === slice.feedPostUri,
|
||||||
)
|
)
|
||||||
if (feedPost && AppBskyEmbedVideo.isView(feedPost.post.embed)) {
|
if (
|
||||||
|
feedPost &&
|
||||||
|
bsky.isType(app.bsky.embed.video.view, feedPost.post.embed)
|
||||||
|
) {
|
||||||
items.push({
|
items.push({
|
||||||
_reactKey: feedPost._reactKey,
|
_reactKey: feedPost._reactKey,
|
||||||
moderation: feedPost.moderation,
|
moderation: feedPost.moderation,
|
||||||
@@ -294,14 +293,14 @@ function Feed() {
|
|||||||
const prevPost = prevSlice?.post
|
const prevPost = prevSlice?.post
|
||||||
const prevEmbed = prevPost?.embed
|
const prevEmbed = prevPost?.embed
|
||||||
const prevVideo =
|
const prevVideo =
|
||||||
prevEmbed && AppBskyEmbedVideo.isView(prevEmbed)
|
prevEmbed && bsky.isType(app.bsky.embed.video.view, prevEmbed)
|
||||||
? prevEmbed.playlist
|
? prevEmbed.playlist
|
||||||
: null
|
: null
|
||||||
const currSlice = videos.at(index)
|
const currSlice = videos.at(index)
|
||||||
const currPost = currSlice?.post
|
const currPost = currSlice?.post
|
||||||
const currEmbed = currPost?.embed
|
const currEmbed = currPost?.embed
|
||||||
const currVideo =
|
const currVideo =
|
||||||
currEmbed && AppBskyEmbedVideo.isView(currEmbed)
|
currEmbed && bsky.isType(app.bsky.embed.video.view, currEmbed)
|
||||||
? currEmbed.playlist
|
? currEmbed.playlist
|
||||||
: null
|
: null
|
||||||
const currVideoModeration = currSlice?.moderation
|
const currVideoModeration = currSlice?.moderation
|
||||||
@@ -309,7 +308,7 @@ function Feed() {
|
|||||||
const nextPost = nextSlice?.post
|
const nextPost = nextSlice?.post
|
||||||
const nextEmbed = nextPost?.embed
|
const nextEmbed = nextPost?.embed
|
||||||
const nextVideo =
|
const nextVideo =
|
||||||
nextEmbed && AppBskyEmbedVideo.isView(nextEmbed)
|
nextEmbed && bsky.isType(app.bsky.embed.video.view, nextEmbed)
|
||||||
? nextEmbed.playlist
|
? nextEmbed.playlist
|
||||||
: null
|
: null
|
||||||
|
|
||||||
@@ -479,8 +478,8 @@ let VideoItem = ({
|
|||||||
reqId,
|
reqId,
|
||||||
}: {
|
}: {
|
||||||
player?: VideoPlayer
|
player?: VideoPlayer
|
||||||
post: AppBskyFeedDefs.PostView
|
post: app.bsky.feed.defs.PostView
|
||||||
embed: AppBskyEmbedVideo.View
|
embed: app.bsky.embed.video.View
|
||||||
active: boolean
|
active: boolean
|
||||||
adjacent: boolean
|
adjacent: boolean
|
||||||
scrollGesture: NativeGesture
|
scrollGesture: NativeGesture
|
||||||
@@ -590,7 +589,7 @@ function VideoItemInner({
|
|||||||
active,
|
active,
|
||||||
}: {
|
}: {
|
||||||
player: VideoPlayer
|
player: VideoPlayer
|
||||||
embed: AppBskyEmbedVideo.View
|
embed: app.bsky.embed.video.View
|
||||||
active: boolean
|
active: boolean
|
||||||
}) {
|
}) {
|
||||||
const {bottom} = useSafeAreaInsets()
|
const {bottom} = useSafeAreaInsets()
|
||||||
@@ -707,7 +706,7 @@ function ModerationOverlay({
|
|||||||
embed,
|
embed,
|
||||||
onPressShow,
|
onPressShow,
|
||||||
}: {
|
}: {
|
||||||
embed: AppBskyEmbedVideo.View
|
embed: app.bsky.embed.video.View
|
||||||
onPressShow: () => void
|
onPressShow: () => void
|
||||||
}) {
|
}) {
|
||||||
const {t: l} = useLingui()
|
const {t: l} = useLingui()
|
||||||
@@ -805,8 +804,8 @@ function Overlay({
|
|||||||
reqId,
|
reqId,
|
||||||
}: {
|
}: {
|
||||||
player?: VideoPlayer
|
player?: VideoPlayer
|
||||||
post: Shadow<AppBskyFeedDefs.PostView>
|
post: Shadow<app.bsky.feed.defs.PostView>
|
||||||
embed: AppBskyEmbedVideo.View
|
embed: app.bsky.embed.video.View
|
||||||
active: boolean
|
active: boolean
|
||||||
scrollGesture: NativeGesture
|
scrollGesture: NativeGesture
|
||||||
moderation: ModerationDecision
|
moderation: ModerationDecision
|
||||||
@@ -827,10 +826,7 @@ function Overlay({
|
|||||||
)
|
)
|
||||||
|
|
||||||
const rkey = new AtUri(post.uri).rkey
|
const rkey = new AtUri(post.uri).rkey
|
||||||
const record = bsky.dangerousIsType<AppBskyFeedPost.Record>(
|
const record = bsky.isType(app.bsky.feed.post, post.record)
|
||||||
post.record,
|
|
||||||
AppBskyFeedPost.isRecord,
|
|
||||||
)
|
|
||||||
? post.record
|
? post.record
|
||||||
: undefined
|
: undefined
|
||||||
const richText = new RichTextAPI({
|
const richText = new RichTextAPI({
|
||||||
@@ -1090,7 +1086,7 @@ function VideoItemPlaceholder({
|
|||||||
style,
|
style,
|
||||||
blur,
|
blur,
|
||||||
}: {
|
}: {
|
||||||
embed: AppBskyEmbedVideo.View
|
embed: app.bsky.embed.video.View
|
||||||
style?: ImageStyle
|
style?: ImageStyle
|
||||||
blur?: boolean
|
blur?: boolean
|
||||||
}) {
|
}) {
|
||||||
@@ -1131,7 +1127,7 @@ function PlayPauseTapArea({
|
|||||||
reqId,
|
reqId,
|
||||||
}: {
|
}: {
|
||||||
player: VideoPlayer
|
player: VideoPlayer
|
||||||
post: Shadow<AppBskyFeedDefs.PostView>
|
post: Shadow<app.bsky.feed.defs.PostView>
|
||||||
feedContext: string | undefined
|
feedContext: string | undefined
|
||||||
reqId: string | undefined
|
reqId: string | undefined
|
||||||
}) {
|
}) {
|
||||||
@@ -1273,7 +1269,9 @@ function EndMessage() {
|
|||||||
/*
|
/*
|
||||||
* If the video is taller than 9:16
|
* If the video is taller than 9:16
|
||||||
*/
|
*/
|
||||||
function isTallAspectRatio(aspectRatio: AppBskyEmbedVideo.View['aspectRatio']) {
|
function isTallAspectRatio(
|
||||||
|
aspectRatio: app.bsky.embed.video.View['aspectRatio'],
|
||||||
|
) {
|
||||||
const videoAspectRatio =
|
const videoAspectRatio =
|
||||||
(aspectRatio?.width ?? 1) / (aspectRatio?.height ?? 1)
|
(aspectRatio?.width ?? 1) / (aspectRatio?.height ?? 1)
|
||||||
return videoAspectRatio <= 9 / 16
|
return videoAspectRatio <= 9 / 16
|
||||||
|
|||||||
Reference in New Issue
Block a user