-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHome.tsx
33 lines (29 loc) · 1.2 KB
/
Home.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
// create by LH ([email protected]) at 2020-04-11 13:23:03
import * as React from 'react';
import { StyleSheet, View } from 'react-native';
import { ScrollView } from 'react-native-gesture-handler';
import { useStackNav } from '../../hooks';
import { Screen } from '../../constants';
import { Button, Overlay } from '../../components';
import { HeaderHeight, Header, HeaderZindex } from '../Header';
export const Home: React.FunctionComponent = React.memo(function Home(props) {
const { push } = useStackNav();
const [show, setShow] = React.useState(false);
return (
<View style={style.container.root}>
<Header />
<Overlay show={show} style={style.container.overlay} />
<Button style={style.container.button} title="Dialog" onPress={() => push(Screen.DialogTest)} />
<View style={{ zIndex: 50 }}>
<Button style={style.container.button} title="Overly" onPress={() => setShow(!show)} />
</View>
</View>
);
});
const style = {
container: StyleSheet.create({
root: { paddingTop: HeaderHeight, flex: 1, alignItems: "center" },
button: { marginTop: 20 },
overlay: { zIndex: HeaderZindex + 1 },
}),
}