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",
"slug": "Ejectable",
"version": "2.0.0",
"orientation": "portrait",
"orientation": "default",
"icon": "./assets/images/icon.png",
"scheme": "myapp",
"userInterfaceStyle": "automatic",

View File

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

View File

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

View File

@ -9,10 +9,10 @@ import { createStackNavigator } from '@react-navigation/stack';
import * as React from 'react';
import Colors from '../constants/Colors';
import useColorScheme from '../hooks/useColorScheme';
import SplashScreen from '../screens/SplashScreen';
import HomeScreen from '../screens/HomeScreen';
import SettingsScreen from '../screens/SettingsScreen';
import TripScreen from '../screens/TripScreen';
import { SplashParamList, BottomTabParamList, TripParamList, SettingsParamList } from '../types';
import { HomeParamList, BottomTabParamList, TripParamList, SettingsParamList } from '../types';
export const BottomTab = createBottomTabNavigator<BottomTabParamList>();
@ -21,11 +21,11 @@ export default function BottomTabNavigator() {
return (
<BottomTab.Navigator
initialRouteName="Splash"
initialRouteName="Home"
tabBarOptions={{ activeTintColor: Colors[colorScheme].tint }}>
<BottomTab.Screen
name="Splash"
component={SplashNavigator}
name="Home"
component={HomeNavigator}
options={{
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:
// 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 (
<SplashStack.Navigator>
<SplashStack.Screen
name="SplashScreen"
component={SplashScreen}
<HomeStack.Navigator>
<HomeStack.Screen
name="HomeScreen"
component={HomeScreen}
options={{ headerTitle: 'Green Travel' }}
/>
</SplashStack.Navigator>
</HomeStack.Navigator>
);
}

View File

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

View File

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

View File

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