Skip to content

Commit 7aeff18

Browse files
alanleedevfacebook-github-bot
authored andcommitted
rename overlayColor to backdropColor in Modal (facebook#46523)
Summary: Pull Request resolved: facebook#46523 the name change [commit](facebook@64ee571) was not properly imported from last diff for facebook#46322 redoing the name change: overlayColor -> backdropColor Changelog: [general][Fixed] - rename overlayColor prop in Modal to backdropColor Reviewed By: christophpurrer Differential Revision: D62760028 fbshipit-source-id: 92d6e8f002c92f4e13136542dce946434516988e
1 parent 40c875d commit 7aeff18

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

packages/react-native/Libraries/Modal/Modal.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ export interface ModalBaseProps {
4646
onShow?: ((event: NativeSyntheticEvent<any>) => void) | undefined;
4747

4848
/**
49-
* The `overlayColor` props sets the color of the modal's background overlay.
49+
* The `backdropColor` props sets the background color of the modal's container.
5050
* Defaults to `white` if not provided and transparent is `false`. Ignored if `transparent` is `true`.
5151
*/
52-
overlayColor?: ColorValue | undefined;
52+
backdropColor?: ColorValue | undefined;
5353
}
5454

5555
export interface ModalPropsIOS {

packages/react-native/Libraries/Modal/Modal.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,10 @@ export type Props = $ReadOnly<{|
159159
onOrientationChange?: ?DirectEventHandler<OrientationChangeEvent>,
160160

161161
/**
162-
* The `overlayColor` props sets the color of the modal's background overlay.
162+
* The `backdropColor` props sets the background color of the modal's container.
163163
* Defaults to `white` if not provided and transparent is `false`. Ignored if `transparent` is `true`.
164164
*/
165-
overlayColor?: ?string,
165+
backdropColor?: ?string,
166166
|}>;
167167

168168
function confirmProps(props: Props) {
@@ -257,7 +257,7 @@ class Modal extends React.Component<Props, State> {
257257
backgroundColor:
258258
this.props.transparent === true
259259
? 'transparent'
260-
: this.props.overlayColor ?? 'white',
260+
: this.props.backdropColor ?? 'white',
261261
};
262262

263263
let animationType = this.props.animationType || 'none';

packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6377,7 +6377,7 @@ export type Props = $ReadOnly<{|
63776377
| \\"landscape-right\\",
63786378
>,
63796379
onOrientationChange?: ?DirectEventHandler<OrientationChangeEvent>,
6380-
overlayColor?: ?string,
6380+
backdropColor?: ?string,
63816381
|}>;
63826382
type State = {
63836383
isRendered: boolean,

packages/rn-tester/js/examples/Modal/ModalPresentation.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const supportedOrientations = [
3434
'landscape-right',
3535
];
3636

37-
const overlayColors = ['red', 'blue', undefined];
37+
const backdropColors = ['red', 'blue', undefined];
3838

3939
function ModalPresentation() {
4040
const onDismiss = React.useCallback(() => {
@@ -65,12 +65,12 @@ function ModalPresentation() {
6565
onDismiss: undefined,
6666
onShow: undefined,
6767
visible: false,
68-
overlayColor: undefined,
68+
backdropColor: undefined,
6969
});
7070
const presentationStyle = props.presentationStyle;
7171
const hardwareAccelerated = props.hardwareAccelerated;
7272
const statusBarTranslucent = props.statusBarTranslucent;
73-
const overlayColor = props.overlayColor;
73+
const backdropColor = props.backdropColor;
7474

7575
const [currentOrientation, setCurrentOrientation] = React.useState('unknown');
7676

@@ -216,9 +216,9 @@ function ModalPresentation() {
216216
</View>
217217
</View>
218218
<View style={styles.block}>
219-
<Text style={styles.title}>Overlay Color ⚫️</Text>
219+
<Text style={styles.title}>Backdrop Color ⚫️</Text>
220220
<View style={styles.row}>
221-
{overlayColors.map(type => (
221+
{backdropColors.map(type => (
222222
<RNTOption
223223
key={type}
224224
style={styles.option}
@@ -227,10 +227,10 @@ function ModalPresentation() {
227227
onPress={() =>
228228
setProps(prev => ({
229229
...prev,
230-
overlayColor: type,
230+
backdropColor: type,
231231
}))
232232
}
233-
selected={type === overlayColor}
233+
selected={type === backdropColor}
234234
/>
235235
))}
236236
</View>

0 commit comments

Comments
 (0)