mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Basic new react-navigation types
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import apiGeneral from '@api/general'
|
||||
import apiTooot from '@api/tooot'
|
||||
import { displayMessage } from '@components/Message'
|
||||
import { NavigationContainerRef } from '@react-navigation/native'
|
||||
import navigationRef from '@helpers/navigationRef'
|
||||
import { Dispatch } from '@reduxjs/toolkit'
|
||||
import { disableAllPushes, Instance } from '@utils/slices/instancesSlice'
|
||||
import * as Notifications from 'expo-notifications'
|
||||
@ -9,20 +9,13 @@ import { useEffect } from 'react'
|
||||
import { TFunction } from 'react-i18next'
|
||||
|
||||
export interface Params {
|
||||
navigationRef: React.RefObject<NavigationContainerRef>
|
||||
mode: 'light' | 'dark'
|
||||
t: TFunction<'screens'>
|
||||
instances: Instance[]
|
||||
dispatch: Dispatch<any>
|
||||
}
|
||||
|
||||
const pushUseConnect = ({
|
||||
navigationRef,
|
||||
mode,
|
||||
t,
|
||||
instances,
|
||||
dispatch
|
||||
}: Params) => {
|
||||
const pushUseConnect = ({ mode, t, instances, dispatch }: Params) => {
|
||||
return useEffect(() => {
|
||||
const connect = async () => {
|
||||
const expoToken = (
|
||||
@ -48,13 +41,13 @@ const pushUseConnect = ({
|
||||
message: t('pushError.message'),
|
||||
description: t('pushError.description'),
|
||||
onPress: () => {
|
||||
navigationRef.current?.navigate('Screen-Tabs', {
|
||||
navigationRef.navigate('Screen-Tabs', {
|
||||
screen: 'Tab-Me',
|
||||
params: {
|
||||
screen: 'Tab-Me-Root'
|
||||
}
|
||||
})
|
||||
navigationRef.current?.navigate('Screen-Tabs', {
|
||||
navigationRef.navigate('Screen-Tabs', {
|
||||
screen: 'Tab-Me',
|
||||
params: {
|
||||
screen: 'Tab-Me-Settings'
|
||||
|
Reference in New Issue
Block a user