-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
160 lines (154 loc) · 4.52 KB
/
App.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
import * as React from 'react';
import { useCallback, useEffect, useState } from 'react'
import { StyleSheet, View} from 'react-native';
import {
MD3LightTheme as DefaultTheme,
Provider as PaperProvider,
BottomNavigation as Screens,
Text,
} from 'react-native-paper';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import {NativeRouter, Route, Routes, useNavigate} from 'react-router-native';
import Dashboard from './src/screens/dashboard';
import ExpensesList from './src/screens/expenses';
import WipScreen from './src/screens/wip';
import AddAPI from './src/screens/add-api';
import AddCard from './src/screens/add-card';
import AddCreditScreen from './src/screens/add-credit';
import AddDebitScreen from './src/screens/add-debit';
import EditCardLimit from './src/screens/edit-limit';
import AccountsScreen from './src/screens/accounts';
import InsightsScreen from './src/screens/insights';
import IncomingScreen from './src/screens/incoming-screen';
import OutgoingScreen from './src/screens/outgoing-screen';
import EditTransactionAmount from './src/screens/edit-transaction';
import CardTransaction from './src/screens/card-transaction';
interface NavRoutes {
key: string;
title: string;
focusedIcon: string;
}
function App(): JSX.Element {
const [index, setIndex] = useState(0);
const [routes] = useState<NavRoutes[]>([
{key: 'dashboard', title: 'Home', unfocusedIcon:'home-outline', focusedIcon: 'home'},
{key: 'cards', title: 'Cards', unfocusedIcon: 'credit-card-outline', focusedIcon: 'credit-card-multiple'},
{key: 'analytics', title: 'Analytics', focusedIcon: 'chart-donut-variant'},
{key: 'expenses', title: 'Transactions', unfocusedIcon: 'file-document-outline', focusedIcon: 'file-document'},
]);
const renderScene = Screens.SceneMap({
dashboard: () => <Dashboard/>,
cards: () => <AccountsScreen/>,
analytics: () => <InsightsScreen/>,
expenses: () => <ExpensesList/>,
});
return (
<SafeAreaProvider>
<PaperProvider>
<NativeRouter>
<Routes>
<Route
path="/"
element={
<Screens
navigationState={{index, routes}}
onIndexChange={setIndex}
renderScene={renderScene}
/>
}
/>
<Route
path="/index"
element={
<Screens
navigationState={{index, routes}}
onIndexChange={setIndex}
renderScene={renderScene}
/>
}
/>
<Route
path="/expenseList"
element={
<ExpensesList/>
}
/>
<Route
path="/add-api"
element={
<AddAPI/>
}
/>
<Route
path="/add-card"
element={
<AddCard/>
}
/>
<Route
path="/add-credit/:cardNumber"
element={
<AddCreditScreen/>
}
/>
<Route
path="/add-debit/:cardNumber"
element={
<AddDebitScreen/>
}
/>
<Route
path="/edit-limit/:cardNumber"
element={
<EditCardLimit/>
}
/>
<Route
path="/accounts"
element={
<AccountsScreen/>
}
/>
<Route
path="/insights"
element={
<InsightsScreen/>
}
/>
<Route
path="/wip"
element={
<WipScreen/>
}
/>
<Route
path="/incoming"
element={
<IncomingScreen/>
}
/>
<Route
path="/outgoing"
element={
<OutgoingScreen/>
}
/>
<Route
path="/edit-transaction/:id"
element={
<EditTransactionAmount/>
}
/>
<Route
path="/card-transaction/:cardNumber"
element={
<CardTransaction/>
}
/>
</Routes>
</NativeRouter>
</PaperProvider>
</SafeAreaProvider>
);
}
export default App;