UNPKG

1.83 kBJavaScriptView Raw
1var __rest = (this && this.__rest) || function (s, e) {
2 var t = {};
3 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4 t[p] = s[p];
5 if (s != null && typeof Object.getOwnPropertySymbols === "function")
6 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7 if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8 t[p[i]] = s[p[i]];
9 }
10 return t;
11};
12import React from 'react';
13import { View, StyleSheet } from 'react-native';
14import Overlay from '../overlay/Overlay';
15import { withTheme } from '../config';
16import DialogLoading from './DialogLoading';
17import DialogTitle from './DialogTitle';
18import DialogButton from './DialogButton';
19import DialogActions from './DialogActions';
20const Dialog = Object.assign((_a) => {
21 var { children, theme, overlayStyle, onBackdropPress, isVisible } = _a, rest = __rest(_a, ["children", "theme", "overlayStyle", "onBackdropPress", "isVisible"]);
22 return (<Overlay isVisible={isVisible} onBackdropPress={onBackdropPress} overlayStyle={StyleSheet.flatten([styles.dialog, overlayStyle])} testID="Internal__Overlay" {...rest}>
23 <View style={styles.childrenContainer}>{children}</View>
24 </Overlay>);
25});
26const styles = StyleSheet.create({
27 dialog: {
28 width: '75%',
29 padding: 20,
30 },
31 childrenContainer: {
32 marginBottom: 5,
33 },
34 buttonView: {
35 marginTop: 10,
36 marginRight: -35,
37 flexDirection: 'row-reverse',
38 justifyContent: 'flex-start',
39 },
40});
41export { Dialog };
42const ThemedDialog = Object.assign(withTheme(Dialog, 'Dialog'), {
43 Loading: DialogLoading,
44 Title: DialogTitle,
45 Actions: DialogActions,
46 Button: DialogButton,
47});
48export default ThemedDialog;