This commit is contained in:
Ren Juan 2021-08-21 13:05:22 +00:00
parent 40f0b58bc3
commit 7397c33d50
7 changed files with 23 additions and 23 deletions

View File

@ -3,7 +3,7 @@
"name": "Green Travel Carbon Calculator", "name": "Green Travel Carbon Calculator",
"slug": "Ejectable", "slug": "Ejectable",
"version": "2.0.0", "version": "2.0.0",
"orientation": "portrait", "orientation": "default",
"icon": "./assets/images/icon.png", "icon": "./assets/images/icon.png",
"scheme": "myapp", "scheme": "myapp",
"userInterfaceStyle": "automatic", "userInterfaceStyle": "automatic",

View File

@ -38,7 +38,7 @@ export function ScreenInfo3() {
style={styles.titleText} style={styles.titleText}
lightColor="rgba(0,0,0,0.8)" lightColor="rgba(0,0,0,0.8)"
darkColor="rgba(255,255,255,0.8)"> darkColor="rgba(255,255,255,0.8)">
Green Travel Carbon Calculator v. 2 Green Travel Calculator v. 2.0.0
</Text> </Text>
<Text <Text
style={styles.versionText} style={styles.versionText}

View File

@ -1,6 +1,6 @@
import { Ionicons } from '@expo/vector-icons'; import { Ionicons } from '@expo/vector-icons';
import * as Font from 'expo-font'; import * as Font from 'expo-font';
import * as SplashScreen from 'expo-splash-screen'; import * as HomeScreen from 'expo-splash-screen';
import * as React from 'react'; import * as React from 'react';
export default function useCachedResources() { export default function useCachedResources() {
@ -10,7 +10,7 @@ export default function useCachedResources() {
React.useEffect(() => { React.useEffect(() => {
async function loadResourcesAndDataAsync() { async function loadResourcesAndDataAsync() {
try { try {
SplashScreen.preventAutoHideAsync(); HomeScreen.preventAutoHideAsync();
// Load fonts // Load fonts
await Font.loadAsync({ await Font.loadAsync({
@ -22,7 +22,7 @@ export default function useCachedResources() {
console.warn(e); console.warn(e);
} finally { } finally {
setLoadingComplete(true); setLoadingComplete(true);
SplashScreen.hideAsync(); HomeScreen.hideAsync();
} }
} }

View File

@ -9,10 +9,10 @@ import { createStackNavigator } from '@react-navigation/stack';
import * as React from 'react'; import * as React from 'react';
import Colors from '../constants/Colors'; import Colors from '../constants/Colors';
import useColorScheme from '../hooks/useColorScheme'; import useColorScheme from '../hooks/useColorScheme';
import SplashScreen from '../screens/SplashScreen'; import HomeScreen from '../screens/HomeScreen';
import SettingsScreen from '../screens/SettingsScreen'; import SettingsScreen from '../screens/SettingsScreen';
import TripScreen from '../screens/TripScreen'; import TripScreen from '../screens/TripScreen';
import { SplashParamList, BottomTabParamList, TripParamList, SettingsParamList } from '../types'; import { HomeParamList, BottomTabParamList, TripParamList, SettingsParamList } from '../types';
export const BottomTab = createBottomTabNavigator<BottomTabParamList>(); export const BottomTab = createBottomTabNavigator<BottomTabParamList>();
@ -21,11 +21,11 @@ export default function BottomTabNavigator() {
return ( return (
<BottomTab.Navigator <BottomTab.Navigator
initialRouteName="Splash" initialRouteName="Home"
tabBarOptions={{ activeTintColor: Colors[colorScheme].tint }}> tabBarOptions={{ activeTintColor: Colors[colorScheme].tint }}>
<BottomTab.Screen <BottomTab.Screen
name="Splash" name="Home"
component={SplashNavigator} component={HomeNavigator}
options={{ options={{
tabBarIcon: ({ color }) => <TabBarIcon name="ios-code" color={color} />, tabBarIcon: ({ color }) => <TabBarIcon name="ios-code" color={color} />,
}} }}
@ -56,17 +56,17 @@ function TabBarIcon(props: { name: React.ComponentProps<typeof Ionicons>['name']
// Each tab has its own navigation stack, you can read more about this pattern here: // Each tab has its own navigation stack, you can read more about this pattern here:
// https://reactnavigation.org/docs/tab-based-navigation#a-stack-navigator-for-each-tab // https://reactnavigation.org/docs/tab-based-navigation#a-stack-navigator-for-each-tab
const SplashStack = createStackNavigator<SplashParamList>(); const HomeStack = createStackNavigator<HomeParamList>();
function SplashNavigator() { function HomeNavigator() {
return ( return (
<SplashStack.Navigator> <HomeStack.Navigator>
<SplashStack.Screen <HomeStack.Screen
name="SplashScreen" name="HomeScreen"
component={SplashScreen} component={HomeScreen}
options={{ headerTitle: 'Green Travel' }} options={{ headerTitle: 'Green Travel' }}
/> />
</SplashStack.Navigator> </HomeStack.Navigator>
); );
} }

View File

@ -12,9 +12,9 @@ export default {
screens: { screens: {
Root: { Root: {
screens: { screens: {
Splash: { Home: {
screens: { screens: {
SplashScreen: 'home', HomeScreen: 'home',
}, },
}, },
Trip: { Trip: {

View File

@ -5,7 +5,7 @@ import { ScreenInfo3 } from '../components/ScreenInfo';
const image = { uri: "https://meansofproduction.biz/images/GREENT.jpg" }; const image = { uri: "https://meansofproduction.biz/images/GREENT.jpg" };
export default function SplashScreen() { export default function HomeScreen() {
return ( return (
<View style={styles.container}> <View style={styles.container}>
<ImageBackground source={image} resizeMode="cover" style={styles.image}> <ImageBackground source={image} resizeMode="cover" style={styles.image}>

View File

@ -9,7 +9,7 @@ export type RootStackParamList = {
}; };
export type BottomTabParamList = { export type BottomTabParamList = {
Splash: undefined; Home: undefined;
Trip: undefined; Trip: undefined;
Settings: undefined; Settings: undefined;
}; };
@ -22,6 +22,6 @@ export type SettingsParamList = {
SettingsScreen: undefined; SettingsScreen: undefined;
}; };
export type SplashParamList = { export type HomeParamList = {
SplashScreen: undefined; HomeScreen: undefined;
}; };