forked from sidhuparas/twitter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
50 lines (45 loc) · 1.16 KB
/
App.js
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
import React from 'react';
import Drawer from 'react-native-drawer';
import Main from './src/components/Main';
import MyDrawer from './src/components/MyDrawer';
export default class App extends React.Component {
constructor(props) {
super(props);
this.state = {
drawerOpen: false,
drawerDisabled: false
};
}
closeDrawer = () => {
this._drawer.close()
};
openDrawer = () => {
this._drawer.open();
}
render() {
return (
// Set up drawer by specifying required params
// Content is provided by MyDrawer.js file.
<Drawer
ref={(ref) => this._drawer = ref}
type="static"
content={<MyDrawer />}
tapToOpen={true}
tapToClose={true}
openDrawerOffset={0.2}
panCloseMask={0.2}
closedDrawerOffset={-3}
styles={drawerStyle}
tweenHandler={(ratio) => ({ main: { opacity: (2 - ratio) / 2 } })
}
>
{/*Then Load the main file*/}
<Main />
</Drawer>
);
}
}
const drawerStyle = {
drawer: { shadowColor: '#000000', shadowOpacity: 0.9, shadowRadius: 3 },
main: { paddingLeft: 4 }
};