1 | var __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 | };
|
12 | import React from 'react';
|
13 | import { View, StyleSheet } from 'react-native';
|
14 | import Overlay from '../overlay/Overlay';
|
15 | import { withTheme } from '../config';
|
16 | import DialogLoading from './DialogLoading';
|
17 | import DialogTitle from './DialogTitle';
|
18 | import DialogButton from './DialogButton';
|
19 | import DialogActions from './DialogActions';
|
20 | const 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 | });
|
26 | const 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 | });
|
41 | export { Dialog };
|
42 | const ThemedDialog = Object.assign(withTheme(Dialog, 'Dialog'), {
|
43 | Loading: DialogLoading,
|
44 | Title: DialogTitle,
|
45 | Actions: DialogActions,
|
46 | Button: DialogButton,
|
47 | });
|
48 | export default ThemedDialog;
|