-
Notifications
You must be signed in to change notification settings - Fork 10
/
Main.tsx
34 lines (28 loc) · 963 Bytes
/
Main.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
import Views from 'component/Views/Views';
import { useStore } from './context/store';
import { useEffect } from 'react';
import SwipeDownHandle from 'component/SwipeDownHandle/SwipeDownHandle';
import Overlays from 'component/Overlays/Overlays';
import { action } from 'mobx';
const Main = () => {
const { npvStore, shelfStore, overlayController, viewStore } = useStore();
useEffect(() => {
setTimeout(() => overlayController.maybeShowAModal(), 2000);
}, [overlayController]);
const handlePointerDown = action(() => {
if (viewStore.isNpv && !overlayController.anyOverlayIsShowing) {
npvStore.tipsUiState.dismissVisibleTip();
}
});
const handleClick = action(() => {
shelfStore.shelfController.voiceMuteBannerUiState.dismissVoiceBanner();
});
return (
<div onPointerDown={handlePointerDown} onClick={handleClick}>
<Views />
<Overlays />
<SwipeDownHandle />
</div>
);
};
export default Main;