mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-20 20:01:56 +03:00
reading app theme on startup
This commit is contained in:
parent
562623da9e
commit
b215d91310
@ -1,5 +1,5 @@
|
||||
import { Component } from 'react';
|
||||
import { Platform, BackHandler, Alert, Linking, AppState } from 'react-native';
|
||||
import { Platform, BackHandler, Alert, Linking, AppState, Appearance } from 'react-native';
|
||||
import NetInfo from '@react-native-community/netinfo';
|
||||
import Config from 'react-native-config';
|
||||
import get from 'lodash/get';
|
||||
@ -787,7 +787,7 @@ class ApplicationContainer extends Component {
|
||||
const settings = await getSettings();
|
||||
|
||||
if (settings) {
|
||||
const isDarkMode = false; //useDarkMode();
|
||||
const isDarkMode = Appearance.getColorScheme() === 'dark';
|
||||
dispatch(isDarkTheme(settings.isDarkTheme !== null ? settings.isDarkTheme : isDarkMode));
|
||||
this.setState({
|
||||
isThemeReady: true,
|
||||
|
@ -1,11 +1,10 @@
|
||||
import React from 'react';
|
||||
import { View } from 'react-native';
|
||||
import { View, Appearance } from 'react-native';
|
||||
import LottieView from 'lottie-react-native';
|
||||
import { useDarkMode } from 'react-native-dynamic';
|
||||
import styles from './launchStyles';
|
||||
|
||||
const LaunchScreen = () => {
|
||||
const isDarkMode = useDarkMode();
|
||||
const isDarkMode = Appearance.getColorScheme() === 'dark';
|
||||
return (
|
||||
<View style={isDarkMode ? styles.darkContainer : styles.container}>
|
||||
<LottieView
|
||||
|
Loading…
Reference in New Issue
Block a user