33 lines
871 B
JavaScript
33 lines
871 B
JavaScript
import React, { useEffect } from "react";
|
|
import { View, Image } from "react-native";
|
|
|
|
const SplashScreen = ({ navigation }) => {
|
|
useEffect(() => {
|
|
const interval = setTimeout(() => {
|
|
// Navigasi ke Onboarding setelah 3 detik
|
|
navigation.navigate("Onboarding"); // Nama yang disesuaikan dengan navigator di App.js
|
|
}, 1000);
|
|
|
|
return () => clearTimeout(interval); // Clear timeout saat komponen unmount
|
|
}, [navigation]);
|
|
|
|
return (
|
|
<View
|
|
style={{
|
|
flex: 1,
|
|
backgroundColor: "#435739",
|
|
alignItems: "center",
|
|
justifyContent: "center",
|
|
}}
|
|
>
|
|
<Image
|
|
style={{ width: 130, height: 130 }}
|
|
source={require("../assets/images/logoecomap.png")} // Pastikan path ini sesuai dengan gambar yang ada
|
|
resizeMode="contain"
|
|
/>
|
|
</View>
|
|
);
|
|
};
|
|
|
|
export default SplashScreen;
|