mmazzarolo / react-native-dialog

Pure JavaScript React-Native dialog
MIT License
682 stars 111 forks source link

Is there a way to disable Light/Dark Mode Support? #107

Closed gilhsu closed 3 years ago

gilhsu commented 3 years ago

Ask your Question

I'm using Dark Mode on my iPhone but don't want the Dialog container to be dark. Is there a way to disable this?

carissacks commented 3 years ago

For the time being, maybe you can set the Dialog styling to match the light mode. Hope it helps

ikkyu-3 commented 3 years ago

I solved it by adding UIUserInterfaceStyle to info.plist.

<key>UIUserInterfaceStyle</key>
<string>Light</string>

https://stackoverflow.com/questions/56537855/is-it-possible-to-opt-out-of-dark-mode-on-ios-13

mmazzarolo commented 3 years ago

Yep, @ikkyu-3's solution is the correct one IMHO (because we're following the native UI guidelines in the component)

Nantris commented 2 years ago

@mmazzarolo is there any plan to allow overriding dark/light modes?

For example, if a user uses an app with dark mode, but at the system level uses light mode, then the dialogs that appear are not themed as the user would prefer/to match the app - and then you have light dialogs over dark screens.

Edit: It seems like this would be reasonable for users to implement it themselves via the styling props if any of them provided a way to re-color the dialog text color. Thoughts @mmazzarolo?

Edit 2: Derp. Description supports the style prop. I think it would be good to mention this in the README, as I only realized because I examined the actual code. Still, it would be great to be able to support light and dark mode with a simple boolean rather than extensive styling and importing/re-exporting our own customized versions.