MCPcopy Create free account
hub / github.com/OneBitCodeBlog/onebitlife / AppExplanation

Function AppExplanation

src/Pages/AppExplanation/index.jsx:15–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13import ChangeNavigationService from "../../Services/ChangeNavigationService";
14
15export default function AppExplanation() {
16 const navigation = useNavigation();
17 const [showHome, setShowHome] = useState("false");
18 const startDate = new Date();
19 const month = `${startDate.getMonth() + 1}`.padStart(2, "0");
20 const day = `${startDate.getDate()}`.padStart(2, "0");
21 const appStartData = `${startDate.getFullYear()}-${month}-${day}`;
22
23 function handleNavHome() {
24 navigation.navigate("Home");
25 }
26
27 function handleSetShowHome() {
28 if (showHome !== "true") {
29 ChangeNavigationService.setShowHome({ showHome: "true", appStartData })
30 .then(() => console.log(`Sucesso! ${showHome} ${appStartData}`))
31 .catch((err) => console.log(err));
32 setShowHome("true");
33 handleNavHome();
34 }
35 }
36
37 return (
38 <View style={styles.container}>
39 <ScrollView>
40 <View style={{ alignItems: "center" }}>
41 <Text style={styles.title}>
42 Antes, deixa {"\n"} eu te explicar...
43 </Text>
44 <ExplanationCard />
45 <Text style={styles.descriptionCta}>
46 Pronto(a) para subir de nível na vida?
47 </Text>
48 <Text style={styles.description}>
49 Na próxima tela você vai poder escolher {"\n"} seus 4 hábitos de
50 forma individual.
51 </Text>
52 <DefaultButton
53 buttonText={"Continuar"}
54 handlePress={handleSetShowHome}
55 width={250}
56 height={50}
57 />
58 </View>
59 </ScrollView>
60 </View>
61 );
62}
63
64const styles = StyleSheet.create({
65 container: {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected