From 7397c33d5052fb46671b628979ce3e81870301be Mon Sep 17 00:00:00 2001 From: Ren Juan Date: Sat, 21 Aug 2021 13:05:22 +0000 Subject: [PATCH] * --- Ejectable/app.json | 2 +- Ejectable/components/ScreenInfo.tsx | 2 +- Ejectable/hooks/useCachedResources.ts | 6 ++--- Ejectable/navigation/BottomTabNavigator.tsx | 24 +++++++++---------- Ejectable/navigation/LinkingConfiguration.ts | 4 ++-- .../{SplashScreen.tsx => HomeScreen.tsx} | 2 +- Ejectable/types.tsx | 6 ++--- 7 files changed, 23 insertions(+), 23 deletions(-) rename Ejectable/screens/{SplashScreen.tsx => HomeScreen.tsx} (95%) diff --git a/Ejectable/app.json b/Ejectable/app.json index 0a5a8433..5cab0e1d 100644 --- a/Ejectable/app.json +++ b/Ejectable/app.json @@ -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", diff --git a/Ejectable/components/ScreenInfo.tsx b/Ejectable/components/ScreenInfo.tsx index 697923f5..f8b2bf9f 100644 --- a/Ejectable/components/ScreenInfo.tsx +++ b/Ejectable/components/ScreenInfo.tsx @@ -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 { 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(); } } diff --git a/Ejectable/navigation/BottomTabNavigator.tsx b/Ejectable/navigation/BottomTabNavigator.tsx index 2ab4bf9d..5bd96c43 100644 --- a/Ejectable/navigation/BottomTabNavigator.tsx +++ b/Ejectable/navigation/BottomTabNavigator.tsx @@ -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(); @@ -21,11 +21,11 @@ export default function BottomTabNavigator() { return ( , }} @@ -56,17 +56,17 @@ function TabBarIcon(props: { name: React.ComponentProps['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(); +const HomeStack = createStackNavigator(); -function SplashNavigator() { +function HomeNavigator() { return ( - - + - + ); } diff --git a/Ejectable/navigation/LinkingConfiguration.ts b/Ejectable/navigation/LinkingConfiguration.ts index 581a148d..22b649bf 100644 --- a/Ejectable/navigation/LinkingConfiguration.ts +++ b/Ejectable/navigation/LinkingConfiguration.ts @@ -12,9 +12,9 @@ export default { screens: { Root: { screens: { - Splash: { + Home: { screens: { - SplashScreen: 'home', + HomeScreen: 'home', }, }, Trip: { diff --git a/Ejectable/screens/SplashScreen.tsx b/Ejectable/screens/HomeScreen.tsx similarity index 95% rename from Ejectable/screens/SplashScreen.tsx rename to Ejectable/screens/HomeScreen.tsx index 9ac5c938..90c5662f 100644 --- a/Ejectable/screens/SplashScreen.tsx +++ b/Ejectable/screens/HomeScreen.tsx @@ -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 ( diff --git a/Ejectable/types.tsx b/Ejectable/types.tsx index 8628aae1..7aab0f62 100644 --- a/Ejectable/types.tsx +++ b/Ejectable/types.tsx @@ -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; };