mirror of https://github.com/tooot-app/app
Done #79
This commit is contained in:
parent
122dae7404
commit
371830ff19
|
@ -1,4 +1,5 @@
|
||||||
import { useNavigation } from '@react-navigation/native'
|
import { useNavigation } from '@react-navigation/native'
|
||||||
|
import { TabMeStackNavigationProp } from '@utils/navigation/navigators'
|
||||||
import addInstance from '@utils/slices/instances/add'
|
import addInstance from '@utils/slices/instances/add'
|
||||||
import { Instance } from '@utils/slices/instancesSlice'
|
import { Instance } from '@utils/slices/instancesSlice'
|
||||||
import * as AuthSession from 'expo-auth-session'
|
import * as AuthSession from 'expo-auth-session'
|
||||||
|
@ -21,7 +22,9 @@ const InstanceAuth = React.memo(
|
||||||
useProxy: false
|
useProxy: false
|
||||||
})
|
})
|
||||||
|
|
||||||
const navigation = useNavigation()
|
const navigation = useNavigation<
|
||||||
|
TabMeStackNavigationProp<'Tab-Me-Root' | 'Tab-Me-Switch'>
|
||||||
|
>()
|
||||||
const queryClient = useQueryClient()
|
const queryClient = useQueryClient()
|
||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ import AttachmentImage from '@components/Timeline/Shared/Attachment/Image'
|
||||||
import AttachmentUnsupported from '@components/Timeline/Shared/Attachment/Unsupported'
|
import AttachmentUnsupported from '@components/Timeline/Shared/Attachment/Unsupported'
|
||||||
import AttachmentVideo from '@components/Timeline/Shared/Attachment/Video'
|
import AttachmentVideo from '@components/Timeline/Shared/Attachment/Video'
|
||||||
import { useNavigation } from '@react-navigation/native'
|
import { useNavigation } from '@react-navigation/native'
|
||||||
|
import { RootStackParamList } from '@utils/navigation/navigators'
|
||||||
import { StyleConstants } from '@utils/styles/constants'
|
import { StyleConstants } from '@utils/styles/constants'
|
||||||
import layoutAnimation from '@utils/styles/layoutAnimation'
|
import layoutAnimation from '@utils/styles/layoutAnimation'
|
||||||
import React, { useCallback, useMemo, useRef, useState } from 'react'
|
import React, { useCallback, useMemo, useRef, useState } from 'react'
|
||||||
|
@ -35,7 +36,7 @@ const TimelineAttachment = React.memo(
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
const imageUrls = useRef<
|
const imageUrls = useRef<
|
||||||
Nav.RootStackParamList['Screen-ImagesViewer']['imageUrls']
|
RootStackParamList['Screen-ImagesViewer']['imageUrls']
|
||||||
>([])
|
>([])
|
||||||
const navigation = useNavigation()
|
const navigation = useNavigation()
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import apiInstance from '@api/instance'
|
import apiInstance from '@api/instance'
|
||||||
import navigationRef from '@helpers/navigationRef'
|
import navigationRef from '@helpers/navigationRef'
|
||||||
import { NavigationProp, ParamListBase } from '@react-navigation/native'
|
|
||||||
import { store } from '@root/store'
|
import { store } from '@root/store'
|
||||||
import { SearchResult } from '@utils/queryHooks/search'
|
import { SearchResult } from '@utils/queryHooks/search'
|
||||||
import { getInstanceUrl } from '@utils/slices/instancesSlice'
|
import { getInstanceUrl } from '@utils/slices/instancesSlice'
|
||||||
|
@ -22,24 +21,7 @@ const matcherAccount = new RegExp(
|
||||||
|
|
||||||
export let loadingLink = false
|
export let loadingLink = false
|
||||||
|
|
||||||
const openLink = async (
|
const openLink = async (url: string, navigation?: any) => {
|
||||||
url: string,
|
|
||||||
navigation?: NavigationProp<
|
|
||||||
ParamListBase,
|
|
||||||
string,
|
|
||||||
Readonly<{
|
|
||||||
key: string
|
|
||||||
index: number
|
|
||||||
routeNames: string[]
|
|
||||||
history?: unknown[] | undefined
|
|
||||||
routes: any[]
|
|
||||||
type: string
|
|
||||||
stale: false
|
|
||||||
}>,
|
|
||||||
{},
|
|
||||||
{}
|
|
||||||
>
|
|
||||||
) => {
|
|
||||||
if (loadingLink) {
|
if (loadingLink) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { BottomTabScreenProps } from '@react-navigation/bottom-tabs'
|
import { BottomTabScreenProps } from '@react-navigation/bottom-tabs'
|
||||||
import { NavigatorScreenParams } from '@react-navigation/native'
|
import { NavigatorScreenParams } from '@react-navigation/native'
|
||||||
import { NativeStackScreenProps } from '@react-navigation/native-stack'
|
import { NativeStackScreenProps } from '@react-navigation/native-stack'
|
||||||
|
import { StackNavigationProp } from '@react-navigation/stack'
|
||||||
import { QueryKeyTimeline } from '@utils/queryHooks/timeline'
|
import { QueryKeyTimeline } from '@utils/queryHooks/timeline'
|
||||||
|
|
||||||
export type RootStackParamList = {
|
export type RootStackParamList = {
|
||||||
|
@ -155,6 +156,9 @@ export type TabMeStackParamList = {
|
||||||
export type TabMeStackScreenProps<
|
export type TabMeStackScreenProps<
|
||||||
T extends keyof TabMeStackParamList
|
T extends keyof TabMeStackParamList
|
||||||
> = NativeStackScreenProps<TabMeStackParamList, T>
|
> = NativeStackScreenProps<TabMeStackParamList, T>
|
||||||
|
export type TabMeStackNavigationProp<
|
||||||
|
RouteName extends keyof TabMeStackParamList
|
||||||
|
> = StackNavigationProp<TabMeStackParamList, RouteName>
|
||||||
|
|
||||||
export type TabMeProfileStackParamList = {
|
export type TabMeProfileStackParamList = {
|
||||||
'Tab-Me-Profile-Root': undefined
|
'Tab-Me-Profile-Root': undefined
|
||||||
|
|
Loading…
Reference in New Issue