-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtypes.tsx
65 lines (54 loc) · 1.83 KB
/
types.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import { CompositeNavigationProp, RouteProp } from '@react-navigation/native'
import { BottomTabNavigationProp } from '@react-navigation/bottom-tabs'
import { NativeStackNavigationProp } from '@react-navigation/native-stack'
export type GoalType = {
title: string
description: string
timestamp?: unknown
key?: string
id: string
isComplete?: boolean
inProgress?: boolean
startDate?: Date
endDate?: Date
category?: string
priority?: 'low' | 'medium' | 'high'
}
export type RootStackParamList = {
Home: undefined
Detail: { id: string }
New: undefined
}
export type HomeScreenNavigationProp = CompositeNavigationProp<
BottomTabNavigationProp<RootStackParamList>,
NativeStackNavigationProp<RootStackParamList, 'Home'>
>
export type HomeScreenRouteProp = RouteProp<RootStackParamList, 'Home'>
export interface HomeScreenProps {
navigation: HomeScreenNavigationProp
route: HomeScreenRouteProp
goals: GoalType[]
setGoals: React.Dispatch<React.SetStateAction<GoalType[]>>
}
export type AddNewGoalScreenNavigationProp = CompositeNavigationProp<
BottomTabNavigationProp<RootStackParamList>,
NativeStackNavigationProp<RootStackParamList, 'New'>
>
export type AddNewGoalScreenRouteProp = RouteProp<RootStackParamList, 'New'>
export type AddNewGoalScreenProps = {
navigation: AddNewGoalScreenNavigationProp
route: AddNewGoalScreenRouteProp
goals: GoalType[]
setGoals: React.Dispatch<React.SetStateAction<GoalType[]>>
}
export type DetailScreenNavigationProp = CompositeNavigationProp<
BottomTabNavigationProp<RootStackParamList>,
NativeStackNavigationProp<RootStackParamList, 'Detail'>
>
export type DetailScreenRouteProp = RouteProp<RootStackParamList, 'Detail'>
export interface DetailScreenProps {
navigation: DetailScreenNavigationProp
route: DetailScreenRouteProp
goals: GoalType[]
setGoals: React.Dispatch<React.SetStateAction<GoalType[]>>
}