3
3
import * as React from 'react' ;
4
4
import { StyleSheet , Platform , Animated } from 'react-native' ;
5
5
import Modal from '../Modal' ;
6
- import { white } from '../../styles/colors' ;
7
- import Paper from '../Paper' ;
6
+ import Surface from '../Surface' ;
8
7
import DialogActions from './DialogActions' ;
9
8
import DialogTitle from './DialogTitle' ;
10
9
import DialogContent from './DialogContent' ;
11
- import withTheme from '../../core/withTheme' ;
12
- import type { Theme } from '../../types' ;
13
10
14
- const AnimatedPaper = Animated . createAnimatedComponent ( Paper ) ;
11
+ const AnimatedSurface = Animated . createAnimatedComponent ( Surface ) ;
15
12
16
13
type Props = {
17
14
/**
@@ -31,10 +28,6 @@ type Props = {
31
28
*/
32
29
children : React . Node ,
33
30
style ?: any ,
34
- /**
35
- * @optional
36
- */
37
- theme : Theme ,
38
31
} ;
39
32
40
33
/**
@@ -82,23 +75,14 @@ type Props = {
82
75
* }
83
76
* ```
84
77
*/
85
- class Dialog extends React . Component < Props , void > {
78
+ export default class Dialog extends React . Component < Props , void > {
86
79
static defaultProps = {
87
80
dismissable : true ,
88
81
visible : false ,
89
82
} ;
90
83
91
84
render ( ) {
92
- const {
93
- children ,
94
- dismissable,
95
- onDismiss,
96
- visible,
97
- style,
98
- theme,
99
- } = this . props ;
100
-
101
- const backgroundColor = theme . colors . paper ;
85
+ const { children , dismissable, onDismiss, visible, style } = this . props ;
102
86
103
87
const childrenArray = React . Children . toArray ( children ) ;
104
88
/* $FlowFixMe */
@@ -128,18 +112,16 @@ class Dialog extends React.Component<Props, void> {
128
112
}
129
113
return (
130
114
< Modal dismissable = { dismissable } onDismiss = { onDismiss } visible = { visible } >
131
- < AnimatedPaper style = { [ styles . container , { backgroundColor } , style ] } >
115
+ < AnimatedSurface style = { [ styles . container , style ] } >
132
116
{ title }
133
117
{ restOfChildrenWithoutTitle }
134
118
{ actionBtnsChildren }
135
- </ AnimatedPaper >
119
+ </ AnimatedSurface >
136
120
</ Modal >
137
121
) ;
138
122
}
139
123
}
140
124
141
- export default withTheme ( Dialog ) ;
142
-
143
125
const styles = StyleSheet . create ( {
144
126
container : {
145
127
/**
@@ -152,7 +134,6 @@ const styles = StyleSheet.create({
152
134
marginVertical : Platform . OS === 'android' ? 44 : 0 ,
153
135
marginHorizontal : 26 ,
154
136
borderRadius : 2 ,
155
- backgroundColor : white ,
156
137
elevation : 24 ,
157
138
} ,
158
139
} ) ;
0 commit comments