File tree Expand file tree Collapse file tree 2 files changed +33
-16
lines changed Expand file tree Collapse file tree 2 files changed +33
-16
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,10 @@ type Props = React.ComponentProps<typeof Surface> & {
41
41
* Text content of the Snackbar.
42
42
*/
43
43
children : React . ReactNode ;
44
+ /**
45
+ * Style for the wrapper of the snackbar
46
+ */
47
+ wrapperStyle ?: StyleProp < ViewStyle > ;
44
48
style ?: StyleProp < ViewStyle > ;
45
49
ref ?: React . RefObject < View > ;
46
50
/**
@@ -218,6 +222,7 @@ class Snackbar extends React.Component<Props, State> {
218
222
onDismiss,
219
223
theme,
220
224
style,
225
+ wrapperStyle,
221
226
// eslint-disable-next-line @typescript-eslint/no-unused-vars
222
227
duration,
223
228
...rest
@@ -229,7 +234,10 @@ class Snackbar extends React.Component<Props, State> {
229
234
}
230
235
231
236
return (
232
- < SafeAreaView pointerEvents = "box-none" style = { styles . wrapper } >
237
+ < SafeAreaView
238
+ pointerEvents = "box-none"
239
+ style = { [ styles . wrapper , wrapperStyle ] }
240
+ >
233
241
< Surface
234
242
pointerEvents = "box-none"
235
243
accessibilityLiveRegion = "polite"
Original file line number Diff line number Diff line change @@ -7,11 +7,14 @@ exports[`renders snackbar with Text as a child 1`] = `
7
7
emulateUnlessSupported = { true }
8
8
pointerEvents = " box-none"
9
9
style = {
10
- Object {
11
- " bottom" : 0 ,
12
- " position" : " absolute" ,
13
- " width" : " 100%" ,
14
- }
10
+ Array [
11
+ Object {
12
+ " bottom" : 0 ,
13
+ " position" : " absolute" ,
14
+ " width" : " 100%" ,
15
+ },
16
+ undefined ,
17
+ ]
15
18
}
16
19
>
17
20
<View
@@ -79,11 +82,14 @@ exports[`renders snackbar with action button 1`] = `
79
82
emulateUnlessSupported = { true }
80
83
pointerEvents = " box-none"
81
84
style = {
82
- Object {
83
- " bottom" : 0 ,
84
- " position" : " absolute" ,
85
- " width" : " 100%" ,
86
- }
85
+ Array [
86
+ Object {
87
+ " bottom" : 0 ,
88
+ " position" : " absolute" ,
89
+ " width" : " 100%" ,
90
+ },
91
+ undefined ,
92
+ ]
87
93
}
88
94
>
89
95
<View
@@ -242,11 +248,14 @@ exports[`renders snackbar with content 1`] = `
242
248
emulateUnlessSupported = { true }
243
249
pointerEvents = " box-none"
244
250
style = {
245
- Object {
246
- " bottom" : 0 ,
247
- " position" : " absolute" ,
248
- " width" : " 100%" ,
249
- }
251
+ Array [
252
+ Object {
253
+ " bottom" : 0 ,
254
+ " position" : " absolute" ,
255
+ " width" : " 100%" ,
256
+ },
257
+ undefined ,
258
+ ]
250
259
}
251
260
>
252
261
<View
You can’t perform that action at this time.
0 commit comments