-
Notifications
You must be signed in to change notification settings - Fork 379
Expand file tree
/
Copy pathApp.js
More file actions
65 lines (61 loc) · 1.4 KB
/
App.js
File metadata and controls
65 lines (61 loc) · 1.4 KB
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
import React, {
Component,
PropTypes,
StyleSheet,
Text,
View,
} from 'react-native'
import Drawer from 'react-native-drawer'
import ControlPanel from './ControlPanel'
import Main from './Main'
export default class App extends Component {
state={
drawerOpen: false,
drawerDisabled: false,
};
closeDrawer = () => {
this.setState({drawerOpen: false})
};
openDrawer = () => {
this.setState({drawerOpen: true})
};
render() {
return (
<Drawer
type="static"
content={
<ControlPanel closeDrawer={this.closeDrawer} />
}
acceptDoubleTap
styles={{main: {shadowColor: '#000000', shadowOpacity: 0.3, shadowRadius: 15}}}
open={this.state.drawerOpen}
onOpen={() => {
console.log('onopen')
this.setState({drawerOpen: true})
}}
onClose={() => {
console.log('onclose')
this.setState({drawerOpen: false})
}}
captureGestures={false}
tweenDuration={100}
panThreshold={0.08}
disabled={this.state.drawerDisabled}
openDrawerOffset={(viewport) => {
return 100
}}
closedDrawerOffset={() => 50}
panOpenMask={0.2}
negotiatePan
>
<Main openDrawer={this.openDrawer} />
</Drawer>
)
}
}
const styles = StyleSheet.create({
container: {
padding: 20,
flex: 1,
}
})