-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDraggableDrawer.js
40 lines (33 loc) · 947 Bytes
/
DraggableDrawer.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
import React from 'react';
import {
View,
StyleSheet,
} from 'react-native';
import {
Button,
Divider,
} from 'react-native-paper';
import Animated from 'react-native-reanimated';
const styles = StyleSheet.create({
defaultStyle: {
elevation: 30,
backgroundColor: 'white',
height: '100%',
shadowRadius: 12,
shadowColor: '#000f',
}
})
const DraggableDrawer = (props) => {
const content = props.expanded ? props.contentMax : props.contentMin;
const iconName = props.expanded ? 'chevron-down' : 'chevron-up';
return (
<Animated.View style={[styles.defaultStyle, props.style]} layout={props.layout}>
<View style={[{ flexDirection: 'column' }]}>
<Button style={{ height: 30, justifyContent: 'center', display: 'flex' }} icon={iconName} compact onPress={props.onExpandPressed} />
<Divider />
{content}
</View>
</Animated.View>
);
}
export default DraggableDrawer;