Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

React-Native How to implement dark mode?

$
0
0

Hi there, I want to implement dark mode to my app. I have a file named ColorSchemes.js where is defined base theme and dark theme. So how could i implement theming baset on this file. I want to make save switching between themes at global level!

ColorSchemes.js

const darkTheme = {  main: palette.black,  background: palette.dark_grey,  alternative: palette.white_grey,  trackCardGradient: palette.black,  reviewCardGradient: palette.white_grey,  reviewCardTitle: palette.white_grey,  placeholderColor: palette.grey,  main_font: palette.light_grey,  second_font: palette.light_grey,  empty_star_color: palette.white_grey,  copy_right: palette.white,  search_bar: searchBarDarkTheme,  status_bar: statusBarDarkTheme,};const baseTheme = {  main: palette.blue,  background: palette.light_blue,  alternative: palette.white_blue,  trackCardGradient: palette.gradient_blue,  reviewCardGradient: palette.white_blue,  reviewCardTitle: palette.dark_blue,  placeholderColor: palette.midd_blue,  main_font: palette.light_blue,  second_font: palette.blue,  empty_star_color: palette.blue,  copy_right: palette.black,  search_bar: searchBarBaseTheme,  status_bar: statusBarBaseTheme,};// export const colors = darkTheme;export const colors = baseTheme;

Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>