Skip to content

Commit 2b60477

Browse files
fix: pass width and height to Surface outer layer
1 parent 7c7241a commit 2b60477

17 files changed

+213
-65
lines changed

src/components/Surface.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ const Surface = forwardRef<View, Props>(
229229
start,
230230
end,
231231
flex,
232+
width,
233+
height,
232234
...restStyle
233235
} = (StyleSheet.flatten(style) || {}) as ViewStyle;
234236

@@ -241,11 +243,13 @@ const Surface = forwardRef<View, Props>(
241243
left,
242244
start,
243245
end,
246+
width,
247+
height,
244248
};
245249

246250
const sharedStyle = [{ backgroundColor, flex }, restStyle];
247251

248-
const innerLayerViewStyles = [{ flex }];
252+
const innerLayerViewStyles = { flex };
249253

250254
const outerLayerViewStyles = [absoluteStyles, innerLayerViewStyles];
251255

src/components/__tests__/Appbar/__snapshots__/Appbar.test.tsx.snap

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ exports[`Appbar does not pass any additional props to Searchbar 1`] = `
99
"bottom": undefined,
1010
"end": undefined,
1111
"flex": undefined,
12+
"height": 64,
1213
"left": undefined,
1314
"position": undefined,
1415
"right": undefined,
@@ -21,6 +22,7 @@ exports[`Appbar does not pass any additional props to Searchbar 1`] = `
2122
"shadowRadius": 0,
2223
"start": undefined,
2324
"top": undefined,
25+
"width": undefined,
2426
}
2527
}
2628
testID="surface-outer-layer"
@@ -49,7 +51,6 @@ exports[`Appbar does not pass any additional props to Searchbar 1`] = `
4951
"backgroundColor": "rgba(255, 251, 254, 1)",
5052
"flex": undefined,
5153
"flexDirection": "row",
52-
"height": 64,
5354
"paddingBottom": undefined,
5455
"paddingHorizontal": 4,
5556
"paddingLeft": undefined,
@@ -67,6 +68,7 @@ exports[`Appbar does not pass any additional props to Searchbar 1`] = `
6768
"bottom": undefined,
6869
"end": undefined,
6970
"flex": undefined,
71+
"height": undefined,
7072
"left": undefined,
7173
"position": undefined,
7274
"right": undefined,
@@ -79,6 +81,7 @@ exports[`Appbar does not pass any additional props to Searchbar 1`] = `
7981
"shadowRadius": 0,
8082
"start": undefined,
8183
"top": undefined,
84+
"width": undefined,
8285
}
8386
}
8487
testID="search-bar-container-outer-layer"
@@ -120,6 +123,7 @@ exports[`Appbar does not pass any additional props to Searchbar 1`] = `
120123
"bottom": undefined,
121124
"end": undefined,
122125
"flex": undefined,
126+
"height": 40,
123127
"left": undefined,
124128
"position": undefined,
125129
"right": undefined,
@@ -132,6 +136,7 @@ exports[`Appbar does not pass any additional props to Searchbar 1`] = `
132136
"shadowRadius": 0,
133137
"start": undefined,
134138
"top": undefined,
139+
"width": 40,
135140
}
136141
}
137142
testID="icon-button-container-outer-layer"
@@ -162,10 +167,8 @@ exports[`Appbar does not pass any additional props to Searchbar 1`] = `
162167
"borderWidth": 0,
163168
"elevation": 0,
164169
"flex": undefined,
165-
"height": 40,
166170
"margin": 6,
167171
"overflow": "hidden",
168-
"width": 40,
169172
}
170173
}
171174
testID="icon-button-container"
@@ -319,6 +322,7 @@ exports[`Appbar does not pass any additional props to Searchbar 1`] = `
319322
"bottom": undefined,
320323
"end": undefined,
321324
"flex": undefined,
325+
"height": 40,
322326
"left": undefined,
323327
"position": undefined,
324328
"right": undefined,
@@ -331,6 +335,7 @@ exports[`Appbar does not pass any additional props to Searchbar 1`] = `
331335
"shadowRadius": 0,
332336
"start": undefined,
333337
"top": undefined,
338+
"width": 40,
334339
}
335340
}
336341
testID="icon-button-container-outer-layer"
@@ -361,10 +366,8 @@ exports[`Appbar does not pass any additional props to Searchbar 1`] = `
361366
"borderWidth": 0,
362367
"elevation": 0,
363368
"flex": undefined,
364-
"height": 40,
365369
"margin": 6,
366370
"overflow": "hidden",
367-
"width": 40,
368371
}
369372
}
370373
testID="icon-button-container"
@@ -478,6 +481,7 @@ exports[`Appbar passes additional props to AppbarBackAction, AppbarContent and A
478481
"bottom": undefined,
479482
"end": undefined,
480483
"flex": undefined,
484+
"height": 64,
481485
"left": undefined,
482486
"position": undefined,
483487
"right": undefined,
@@ -490,6 +494,7 @@ exports[`Appbar passes additional props to AppbarBackAction, AppbarContent and A
490494
"shadowRadius": 0,
491495
"start": undefined,
492496
"top": undefined,
497+
"width": undefined,
493498
}
494499
}
495500
testID="surface-outer-layer"
@@ -518,7 +523,6 @@ exports[`Appbar passes additional props to AppbarBackAction, AppbarContent and A
518523
"backgroundColor": "rgba(255, 251, 254, 1)",
519524
"flex": undefined,
520525
"flexDirection": "row",
521-
"height": 64,
522526
"paddingBottom": undefined,
523527
"paddingHorizontal": 4,
524528
"paddingLeft": undefined,
@@ -536,6 +540,7 @@ exports[`Appbar passes additional props to AppbarBackAction, AppbarContent and A
536540
"bottom": undefined,
537541
"end": undefined,
538542
"flex": undefined,
543+
"height": 40,
539544
"left": undefined,
540545
"position": undefined,
541546
"right": undefined,
@@ -548,6 +553,7 @@ exports[`Appbar passes additional props to AppbarBackAction, AppbarContent and A
548553
"shadowRadius": 0,
549554
"start": undefined,
550555
"top": undefined,
556+
"width": 40,
551557
}
552558
}
553559
testID="icon-button-container-outer-layer"
@@ -578,10 +584,8 @@ exports[`Appbar passes additional props to AppbarBackAction, AppbarContent and A
578584
"borderWidth": 0,
579585
"elevation": 0,
580586
"flex": undefined,
581-
"height": 40,
582587
"margin": 6,
583588
"overflow": "hidden",
584-
"width": 40,
585589
}
586590
}
587591
testID="icon-button-container"
@@ -797,6 +801,7 @@ exports[`Appbar passes additional props to AppbarBackAction, AppbarContent and A
797801
"bottom": undefined,
798802
"end": undefined,
799803
"flex": undefined,
804+
"height": 40,
800805
"left": undefined,
801806
"position": undefined,
802807
"right": undefined,
@@ -809,6 +814,7 @@ exports[`Appbar passes additional props to AppbarBackAction, AppbarContent and A
809814
"shadowRadius": 0,
810815
"start": undefined,
811816
"top": undefined,
817+
"width": 40,
812818
}
813819
}
814820
testID="icon-button-container-outer-layer"
@@ -839,10 +845,8 @@ exports[`Appbar passes additional props to AppbarBackAction, AppbarContent and A
839845
"borderWidth": 0,
840846
"elevation": 0,
841847
"flex": undefined,
842-
"height": 40,
843848
"margin": 6,
844849
"overflow": "hidden",
845-
"width": 40,
846850
}
847851
}
848852
testID="icon-button-container"

src/components/__tests__/Card/__snapshots__/Card.test.tsx.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ exports[`Card renders an outlined card 1`] = `
99
"bottom": undefined,
1010
"end": undefined,
1111
"flex": undefined,
12+
"height": undefined,
1213
"left": undefined,
1314
"position": undefined,
1415
"right": undefined,
@@ -21,6 +22,7 @@ exports[`Card renders an outlined card 1`] = `
2122
"shadowRadius": 0,
2223
"start": undefined,
2324
"top": undefined,
25+
"width": undefined,
2426
}
2527
}
2628
testID="card-container-outer-layer"

src/components/__tests__/__snapshots__/AnimatedFAB.test.tsx.snap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ exports[`renders animated fab 1`] = `
99
"bottom": undefined,
1010
"end": undefined,
1111
"flex": undefined,
12+
"height": undefined,
1213
"left": undefined,
1314
"position": "absolute",
1415
"right": undefined,
@@ -21,6 +22,7 @@ exports[`renders animated fab 1`] = `
2122
"shadowRadius": 8,
2223
"start": undefined,
2324
"top": undefined,
25+
"width": undefined,
2426
}
2527
}
2628
testID="animated-fab-container-outer-layer"
@@ -306,6 +308,7 @@ exports[`renders animated fab with label on the left 1`] = `
306308
"bottom": undefined,
307309
"end": undefined,
308310
"flex": undefined,
311+
"height": undefined,
309312
"left": undefined,
310313
"position": "absolute",
311314
"right": undefined,
@@ -318,6 +321,7 @@ exports[`renders animated fab with label on the left 1`] = `
318321
"shadowRadius": 8,
319322
"start": undefined,
320323
"top": undefined,
324+
"width": undefined,
321325
}
322326
}
323327
testID="animated-fab-container-outer-layer"
@@ -605,6 +609,7 @@ exports[`renders animated fab with label on the right by default 1`] = `
605609
"bottom": undefined,
606610
"end": undefined,
607611
"flex": undefined,
612+
"height": undefined,
608613
"left": undefined,
609614
"position": "absolute",
610615
"right": undefined,
@@ -617,6 +622,7 @@ exports[`renders animated fab with label on the right by default 1`] = `
617622
"shadowRadius": 8,
618623
"start": undefined,
619624
"top": undefined,
625+
"width": undefined,
620626
}
621627
}
622628
testID="animated-fab-container-outer-layer"

0 commit comments

Comments
 (0)