Browse Source

0204mensagem

ThiagoFaletti 2 weeks ago
parent
commit
9dd9fb302d
4 changed files with 57 additions and 2 deletions
  1. 2 0
      README.md
  2. 51 0
      app/contato.jsx
  3. 2 2
      app/galeria.jsx
  4. 2 0
      app/index.js

+ 2 - 0
README.md

@@ -20,7 +20,9 @@ Este projeto usar react native e expo para criar um aplicativo.
 Comandos para rodar no app
 
 ```bash
+npm i
 npx expo start
+
 ``` 
 
 para instaalr a biblioteca 

+ 51 - 0
app/contato.jsx

@@ -0,0 +1,51 @@
+import { Button, Text, TextInput, TouchableOpacity, View } from "react-native";
+import { useState } from "react";
+import { useRouter } from 'expo-router';
+
+
+export default function Contato() {
+    const router = useRouter();
+    const [mensagem, setMensagem] = useState("")
+    const [final, setFinal] = useState("Enviada")
+
+
+    function irParaHome() {
+        if(router.canDismiss) {
+            router.dismissAll();
+        }
+        router.push("/");
+    }
+    function enviarMensagem() {
+        setFinal(`
+            Mensagem Enviada com Sucesso!\n
+            ${mensagem}
+        `)
+    }
+
+    return (
+        <View style={{flex: 1, padding: 20}}>
+            <View style={{flex: 1}} >
+                <Text style={{fontSize: 24}}>
+                    Contato
+                </Text>
+                <TextInput placeholder="Digite a mensagem" value={mensagem} onChangeText={setMensagem}/>
+                
+                <Button title="Enviar Mensagem" onPress={enviarMensagem}></Button>
+                <Text>{final}</Text>
+                
+
+                <View style={{flex: 1, justifyContent: "flex-end", gap: 10}}>
+                    <TouchableOpacity style={{backgroundColor: "#f4511e", padding: 10, marginTop: 10}} onPress={irParaHome}>
+                    <Text style={{ padding: 10, textAlign: "center"}}>Voltar para Home</Text>
+                    </TouchableOpacity>
+                </View>
+                
+            </View> 
+        </View>
+        
+    )
+            
+        
+}
+
+

+ 2 - 2
app/galeria.jsx

@@ -46,8 +46,8 @@ export default function Galeria() {
       </View>
 
       <View style={{ flex: 1, justifyContent: "flex-end" }}>
-        <Link href="/configuracoes" style={styles.links}>
-          <Text> Ir para as configurações</Text>
+        <Link href="/contato" style={styles.links}>
+          <Text> Ir para as contato</Text>
         </Link>
       </View>
     </View>

+ 2 - 0
app/index.js

@@ -2,6 +2,8 @@ import { Link } from "expo-router";
 import { useState } from "react";
 import { Button, Text, TouchableOpacity, View} from "react-native";
 
+
+
 export default function Index() {
     const [contador, setContador] = useState(0)