-
Notifications
You must be signed in to change notification settings - Fork 0
/
FooterSheet.tsx
61 lines (57 loc) · 1.43 KB
/
FooterSheet.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
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
import * as React from 'react';
import { Text, StyleSheet } from 'react-native';
import {
BottomSheet,
SheetManager,
type SheetProps,
} from 'react-native-bottom-sheet-manager';
import { Button } from '../components';
import type { BottomSheetFooterProps } from '@gorhom/bottom-sheet';
const FooterSheet: React.FC<SheetProps<'footer'>> = ({ id }) => {
const renderFooter = React.useCallback(
(props: BottomSheetFooterProps) => (
<BottomSheet.Footer {...props} style={styles.footer}>
<Button title="Close" onPress={() => SheetManager.hide(id)} />
</BottomSheet.Footer>
),
[id]
);
return (
<BottomSheet
id={id}
style={styles.container}
footerComponent={renderFooter}
>
<BottomSheet.View style={styles.contentContainer}>
<Text>Sheet With Backdrop</Text>
</BottomSheet.View>
</BottomSheet>
);
};
const styles = StyleSheet.create({
container: {
shadowColor: '#000',
shadowOffset: {
width: 0,
height: 12,
},
shadowOpacity: 0.58,
shadowRadius: 16.0,
elevation: 24,
backgroundColor: '#ffffff',
borderTopLeftRadius: 20,
borderTopRightRadius: 20,
},
footer: {
padding: 10,
borderTopWidth: StyleSheet.hairlineWidth,
borderTopColor: '#555555',
backgroundColor: '#FFFFFF',
},
contentContainer: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
});
export default FooterSheet;