Fix BorderExample Crash on Out of Tree Platforms (#32120)

Summary:
9b4f8e0144 (diff-ee44452e2deeb3a607e863852bb720518875b88c4e78ea7dc76805488bfb1818) added examples to the border test page using PlatformColor. An iOS specific instance was later conditioned to only iOS in f6d0f9deac (diff-ee44452e2deeb3a607e863852bb720518875b88c4e78ea7dc76805488bfb1818) but one example remains that has values for Android, and iOS only. This causes a crash on at least RNW, since none of the PlatformColors are valid.

This change addsa a fallback to black for unsupported platforms, and also adds a Windows PlatformColor for kicks (and marginal extra usefuleness).

## Changelog

[Internal] [Fixed] - Fix BorderExample Crash on Out of Tree Platforms

Pull Request resolved: https://github.com/facebook/react-native/pull/32120

Test Plan: Validated on RNTester on Windows.

Reviewed By: yungsters

Differential Revision: D30822765

Pulled By: lunaleaps

fbshipit-source-id: 6b3e65204259205bb2f3c9153a2361d1decebe98
This commit is contained in:
Nick Gerleman 2021-09-10 00:56:18 -07:00 коммит произвёл Facebook GitHub Bot
Родитель fc553ed8e6
Коммит ffcaef64e4
1 изменённых файлов: 6 добавлений и 4 удалений

Просмотреть файл

@ -183,10 +183,12 @@ const styles = StyleSheet.create({
},
border15: {
borderWidth: 10,
borderColor: PlatformColor(
'systemGray4',
'@android:color/holo_orange_dark',
),
borderColor: Platform.select({
ios: PlatformColor('systemGray4'),
android: PlatformColor('@android:color/holo_orange_dark'),
windows: PlatformColor('SystemAccentColorDark1'),
default: 'black',
}),
},
border16: {
borderWidth: 10,