Start
import React from "react";
import { View, Text, StyleSheet, Image, ScrollView } from "react-native";
import { useNavigation } from "@react-navigation/native";
import DefaultButton from "../../components/Common/DefaultButton";
import LifeStatus from "../../components/Common/LifeStatus";
export default function Start() {
const navigation = useNavigation();
const handleNavAppExplanation = () => {
console.log("Testando o clique");
};
return (
<View style={styles.container}>
<ScrollView style={styles.scroll} showsVerticalScrollIndicator={false}>
<View style={{ alignItems: "center" }}>
<Image
source={require("../../assets/icons/logo3.png")}
style={styles.logo}
/>
<LifeStatus />
<Text style={styles.description}>
Vamos transformar sua vida {"\\n"} em um jogo, buscando sempre {"\\n"}{" "}
o melhor nível.
</Text>
<DefaultButton
buttonText={"Continuar"}
handlePress={handleNavAppExplanation}
width={250}
height={50}
/>
</View>
</ScrollView>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "rgba(21, 21, 21, 0.98)",
},
logo: {
width: 300,
height: 60,
marginTop: 60,
marginBottom: 20,
},
description: {
color: "#FFFFFF",
fontSize: 20,
textAlign: "center",
marginVertical: 60,
},
});
Arquivo index - Navegação
import { useState } from "react";
import AllPages from "./AllPages";
export default function Routes() {
return <AllPages />;
}
Todas as páginas - Navegação
import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import Start from "../pages/Start";
const Stack = createNativeStackNavigator();
export default function AllPages() {
return (
<NavigationContainer>
<Stack.Navigator
screenOptions={{
headerShown: false,
}}
>
<Stack.Screen name="Start" component={Start} />
</Stack.Navigator>
</NavigationContainer>
);
}
Default Button - Componente
import React from "react";
import { StyleSheet, Text, TouchableOpacity } from "react-native";
export default function DefaultButton({ buttonText, handlePress }) {
return (
<TouchableOpacity
style={styles.button}
activeOpacity={0.7}
onPress={handlePress}
>
<Text style={styles.buttonText}>{buttonText}</Text>
</TouchableOpacity>
);
}
const styles = StyleSheet.create({
button: {
width: 200,
height: 60,
alignItems: "center",
justifyContent: "center",
borderWidth: 1,
borderColor: "#FFFFFF",
borderRadius: 10,
marginBottom: 20,
},
buttonText: {
color: "#FFFFFF",
fontWeight: "bold",
fontSize: 20,
},
});
Life status - Componente
import { View, StyleSheet } from "react-native";
import React from "react";
import LottieView from "lottie-react-native";
export default function LifeStatus() {
return (
<View style={styles.container}>
<LottieView
autoPlay={true}
Loop={true}
source={require("../../../assets/education/education-100.json")}
style={styles.educacaoAnimacao}
/>
<LottieView
autoPlay={true}
Loop={true}
source={require("../../../assets/money/money-100.json")}
style={styles.financasAnimacao}
/>
<LottieView
autoPlay={true}
Loop={true}
source={require("../../../assets/robot/robot-100.json")}
style={styles.roboAnimacao}
/>
</View>
);
}
const styles = StyleSheet.create({
container: {
width: 300,
height: 300,
},
roboAnimacao: {
width: 190,
marginTop: 30,
marginLeft: 25,
},
educacaoAnimacao: {
width: 100,
marginTop: 50,
marginLeft: 5,
position: "absolute",
},
financasAnimacao: {
width: 100,
position: "absolute",
marginTop: 50,
marginLeft: 95,
},
});