Skip to content

Commit d1e5b13

Browse files
committed
Fix LogBox notification toasts on iPhone Duo
1 parent a4c421a commit d1e5b13

3 files changed

Lines changed: 36 additions & 17 deletions

File tree

‎packages/react-native/Libraries/LogBox/LogBoxNotificationContainer.js‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,21 @@ export function LogBoxNotificationContainer(props: Props): React.Node {
111111

112112
const styles = StyleSheet.create({
113113
list: {
114-
bottom: 20,
114+
alignItems: 'center',
115+
bottom: 16,
116+
gap: 5,
115117
left: 10,
116118
right: 10,
119+
// The container spans the width of the screen, so it passes touches outside the toasts through to the app, such
120+
// as to a tab bar beside them.
121+
pointerEvents: 'box-none',
117122
position: 'absolute',
118123
},
119124
toast: {
120-
borderRadius: 8,
121-
marginBottom: 5,
125+
borderRadius: 12,
126+
maxWidth: 600,
122127
overflow: 'hidden',
128+
width: '100%',
123129
},
124130
});
125131

‎packages/react-native/Libraries/LogBox/UI/LogBoxNotificationDismissButton.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ export default function LogBoxNotificationDismissButton(props: {
2424
<LogBoxButton
2525
id={props.id}
2626
backgroundColor={{
27-
default: LogBoxStyle.getTextColor(0.3),
28-
pressed: LogBoxStyle.getTextColor(0.5),
27+
default: LogBoxStyle.getTextColor(0.15),
28+
pressed: LogBoxStyle.getTextColor(0.3),
2929
}}
3030
hitSlop={{
3131
top: 12,
@@ -64,6 +64,6 @@ const styles = StyleSheet.create({
6464
image: {
6565
height: 8,
6666
width: 8,
67-
tintColor: LogBoxStyle.getBackgroundColor(1),
67+
tintColor: LogBoxStyle.getTextColor(0.8),
6868
},
6969
});

‎packages/react-native/Libraries/LogBox/__tests__/__snapshots__/LogBoxNotificationContainer-test.js.snap‎

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ exports[`LogBoxNotificationContainer should render both an error and warning not
44
<SafeAreaView
55
style={
66
Object {
7-
"bottom": 20,
7+
"alignItems": "center",
8+
"bottom": 16,
9+
"gap": 5,
810
"left": 10,
11+
"pointerEvents": "box-none",
912
"position": "absolute",
1013
"right": 10,
1114
}
@@ -14,9 +17,10 @@ exports[`LogBoxNotificationContainer should render both an error and warning not
1417
<View
1518
style={
1619
Object {
17-
"borderRadius": 8,
18-
"marginBottom": 5,
20+
"borderRadius": 12,
21+
"maxWidth": 600,
1922
"overflow": "hidden",
23+
"width": "100%",
2024
}
2125
}
2226
>
@@ -59,9 +63,10 @@ exports[`LogBoxNotificationContainer should render both an error and warning not
5963
<View
6064
style={
6165
Object {
62-
"borderRadius": 8,
63-
"marginBottom": 5,
66+
"borderRadius": 12,
67+
"maxWidth": 600,
6468
"overflow": "hidden",
69+
"width": "100%",
6570
}
6671
}
6772
>
@@ -116,8 +121,11 @@ exports[`LogBoxNotificationContainer should render the latest error notification
116121
<SafeAreaView
117122
style={
118123
Object {
119-
"bottom": 20,
124+
"alignItems": "center",
125+
"bottom": 16,
126+
"gap": 5,
120127
"left": 10,
128+
"pointerEvents": "box-none",
121129
"position": "absolute",
122130
"right": 10,
123131
}
@@ -126,9 +134,10 @@ exports[`LogBoxNotificationContainer should render the latest error notification
126134
<View
127135
style={
128136
Object {
129-
"borderRadius": 8,
130-
"marginBottom": 5,
137+
"borderRadius": 12,
138+
"maxWidth": 600,
131139
"overflow": "hidden",
140+
"width": "100%",
132141
}
133142
}
134143
>
@@ -175,8 +184,11 @@ exports[`LogBoxNotificationContainer should render the latest warning notificati
175184
<SafeAreaView
176185
style={
177186
Object {
178-
"bottom": 20,
187+
"alignItems": "center",
188+
"bottom": 16,
189+
"gap": 5,
179190
"left": 10,
191+
"pointerEvents": "box-none",
180192
"position": "absolute",
181193
"right": 10,
182194
}
@@ -185,9 +197,10 @@ exports[`LogBoxNotificationContainer should render the latest warning notificati
185197
<View
186198
style={
187199
Object {
188-
"borderRadius": 8,
189-
"marginBottom": 5,
200+
"borderRadius": 12,
201+
"maxWidth": 600,
190202
"overflow": "hidden",
203+
"width": "100%",
191204
}
192205
}
193206
>

0 commit comments

Comments
 (0)