Kantongku: splash screen (logo teal + background gradient)
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { StatusBar } from 'expo-status-bar';
|
import { StatusBar } from 'expo-status-bar';
|
||||||
|
import * as SplashScreen from 'expo-splash-screen';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { ActivityIndicator, StyleSheet, Text, View } from 'react-native';
|
import { ActivityIndicator, StyleSheet, Text, View } from 'react-native';
|
||||||
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
||||||
@@ -8,6 +9,8 @@ import { checkRecurringDue, getSetting } from './src/db/repositories';
|
|||||||
import { RootNavigator } from './src/navigation';
|
import { RootNavigator } from './src/navigation';
|
||||||
import { colors } from './src/theme/colors';
|
import { colors } from './src/theme/colors';
|
||||||
|
|
||||||
|
SplashScreen.preventAutoHideAsync().catch(() => {});
|
||||||
|
|
||||||
export default function App() {
|
export default function App() {
|
||||||
const [ready, setReady] = useState(false);
|
const [ready, setReady] = useState(false);
|
||||||
const [error, setError] = useState<string | null>(null);
|
const [error, setError] = useState<string | null>(null);
|
||||||
@@ -25,6 +28,7 @@ export default function App() {
|
|||||||
const onboarded = await getSetting('onboarded');
|
const onboarded = await getSetting('onboarded');
|
||||||
setInitialRoute(onboarded === '1' ? 'Main' : 'Onboarding');
|
setInitialRoute(onboarded === '1' ? 'Main' : 'Onboarding');
|
||||||
setReady(true);
|
setReady(true);
|
||||||
|
SplashScreen.hideAsync().catch(() => {});
|
||||||
})
|
})
|
||||||
.catch((e) => setError(String(e)));
|
.catch((e) => setError(String(e)));
|
||||||
}, []);
|
}, []);
|
||||||
|
|||||||
@@ -22,6 +22,18 @@
|
|||||||
"web": {
|
"web": {
|
||||||
"favicon": "./assets/favicon.png"
|
"favicon": "./assets/favicon.png"
|
||||||
},
|
},
|
||||||
"plugins": ["expo-sqlite", "expo-sharing"]
|
"plugins": [
|
||||||
|
"expo-sqlite",
|
||||||
|
"expo-sharing",
|
||||||
|
[
|
||||||
|
"expo-splash-screen",
|
||||||
|
{
|
||||||
|
"backgroundColor": "#0D9488",
|
||||||
|
"image": "./assets/splash-logo.png",
|
||||||
|
"imageWidth": 220,
|
||||||
|
"resizeMode": "contain"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 112 KiB |
Generated
+15
@@ -18,6 +18,7 @@
|
|||||||
"expo-file-system": "~57.0.4",
|
"expo-file-system": "~57.0.4",
|
||||||
"expo-linear-gradient": "~57.0.1",
|
"expo-linear-gradient": "~57.0.1",
|
||||||
"expo-sharing": "~57.0.12",
|
"expo-sharing": "~57.0.12",
|
||||||
|
"expo-splash-screen": "~57.0.6",
|
||||||
"expo-sqlite": "~57.0.1",
|
"expo-sqlite": "~57.0.1",
|
||||||
"expo-status-bar": "~57.0.1",
|
"expo-status-bar": "~57.0.1",
|
||||||
"react": "19.2.3",
|
"react": "19.2.3",
|
||||||
@@ -3064,6 +3065,20 @@
|
|||||||
"react-native": "*"
|
"react-native": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/expo-splash-screen": {
|
||||||
|
"version": "57.0.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/expo-splash-screen/-/expo-splash-screen-57.0.6.tgz",
|
||||||
|
"integrity": "sha512-FY0E7hMyXVAsNh18yGzIjdooPXdjafalEb6mk2EcqNPjXspHuu+pVEhUscEunw4wF8F/w6MOpT7UfOwHVWez9g==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@expo/config-plugins": "~57.0.7",
|
||||||
|
"@expo/image-utils": "^0.11.4",
|
||||||
|
"xml2js": "0.6.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"expo": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/expo-sqlite": {
|
"node_modules/expo-sqlite": {
|
||||||
"version": "57.0.1",
|
"version": "57.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/expo-sqlite/-/expo-sqlite-57.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/expo-sqlite/-/expo-sqlite-57.0.1.tgz",
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
"expo-file-system": "~57.0.4",
|
"expo-file-system": "~57.0.4",
|
||||||
"expo-linear-gradient": "~57.0.1",
|
"expo-linear-gradient": "~57.0.1",
|
||||||
"expo-sharing": "~57.0.12",
|
"expo-sharing": "~57.0.12",
|
||||||
|
"expo-splash-screen": "~57.0.6",
|
||||||
"expo-sqlite": "~57.0.1",
|
"expo-sqlite": "~57.0.1",
|
||||||
"expo-status-bar": "~57.0.1",
|
"expo-status-bar": "~57.0.1",
|
||||||
"react": "19.2.3",
|
"react": "19.2.3",
|
||||||
|
|||||||
Reference in New Issue
Block a user