Skip to content

Instantly share code, notes, and snippets.

@popeating
Last active August 4, 2020 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save popeating/1efcc9aa0e79d9195bec6e0681318819 to your computer and use it in GitHub Desktop.
Save popeating/1efcc9aa0e79d9195bec6e0681318819 to your computer and use it in GitHub Desktop.
import { StatusBar } from 'expo-status-bar';
import React, { useState, useMemo, useEffect } from 'react';
import { Appearance, View } from 'react-native';
//React navigation
import {
NavigationContainer,
DarkTheme,
DefaultTheme,
} from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
//React Paper
import {
DefaultTheme as PaperDefaultTheme,
DarkTheme as PaperDarkTheme,
Provider as PaperProvider,
ActivityIndicator,
} from 'react-native-paper';
//Our context
import mainContext from './context/mainContext';
//Localization include and utils
import loc from './utils/localization';
//Our (alreay initialized) firebase
import Firebase from './Firebase';
//Define Colors Theme merging Paper and Navigation theme (+ a single override)
const CombinedDefaultTheme = {
...PaperDefaultTheme,
...DefaultTheme,
colors: {
...PaperDefaultTheme.colors,
...DefaultTheme.colors,
primary: '#718E57',
},
};
const CombinedDarkTheme = {
...PaperDarkTheme,
...DarkTheme,
dark: true,
colors: { ...PaperDarkTheme.colors, ...DarkTheme.colors, primary: '#718E57' },
};
//Main Screen used in apps
import LoginScreen from './screens/LoginScreen';
import HomeScreen from './screens/HomeScreen';
import SignUpScreen from './screens/SignUpScreen';
//get the colorschem of the device and set a status for the status bar
if (Appearance.getColorScheme() === 'dark') {
status = true;
} else {
status = false;
}
//Define the appstack
const AppStack = createStackNavigator();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment