-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
63 lines (54 loc) · 1.99 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
import React from "react";
import {NativeStackScreenProps} from "@react-navigation/native-stack";
import {createStackNavigator} from '@react-navigation/stack';
import ENV from "./config";
import {EditTimerView} from "./src/EditTimerView";
import {MainView} from "./src/MainView";
import {cardStyle, modalStyle} from "./src/commonStyles";
import {Provider} from "react-redux";
import {reactGenieStore} from "./timeStore";
import { ModalityProvider } from "reactgenie-lib";
export let AppNavigator: any = null;
type Props = NativeStackScreenProps<any, any>
const TimerTab = ({route, navigation}: Props) => {
AppNavigator = navigation
return (
<MainView {...route.params}/>
)
}
const EditTimerTab = ({route, navigation}: Props) => {
AppNavigator = navigation
return (
<EditTimerView {...route.params}/>
)
}
const App = () => {
let TimerStack = () => {
let TimerNavigator = createStackNavigator();
return (
<TimerNavigator.Navigator screenOptions={{
headerShown: true
}}>
<TimerNavigator.Screen name="Timers" component={TimerTab} options={cardStyle}/>
<TimerNavigator.Screen name="EditTimer" component={EditTimerTab} options={modalStyle}/>
</TimerNavigator.Navigator>
);
}
return (
<Provider store={reactGenieStore}>
<ModalityProvider
displayTranscript={true}
codexApiKey={ENV.OPENAI_API_KEY!}
codexApiBaseUrl={ENV.OPENAI_API_BASE_URL!}
azureSpeechRegion={ENV.AZURE_SPEECH_REGION!}
azureSpeechKey={ENV.AZURE_SPEECH_KEY!}
extraPrompt={
'// we are using voice recognition. so there may be errors. Try to think about words with similar sounds. For example "address" can actually be "add this".'
}
>
<TimerStack/>
</ModalityProvider>
</Provider>
);
};
export default App;