-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
32 lines (28 loc) · 1.05 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
import React, {ReactNode, useEffect, useState} from 'react';
import TimePage from "./src/components/time-page/TimePage";
import MeditationSessionsPage from "./src/components/meditation-sessions-page/MeditationSessionsPage";
import "react-native-gesture-handler";
import './src/services/audioNotifications';
import "./src/services/appEventBus";
import "./src/services/hapticFeedback";
import appEventBus from "./src/services/appEventBus";
// import './src/style/common.scss'; //fix? https://github.com/kristerkari/react-native-sass-transformer/issues/9
//have a single instance to prevent flash
const timePage = <TimePage/>;
const meditationSessionPage = <MeditationSessionsPage/>;
const App = () => {
const [modal, setModal] = useState<ReactNode>();
useEffect(()=>{
return appEventBus.app.showModal().on(modalToShow =>{
setModal(modalToShow);
});
}, []);
return (
<React.Fragment>
{timePage}
{meditationSessionPage}
{modal}
</React.Fragment>
);
};
export default App;