Browse Source

Enviar arquivos para 'app'

lucas.trindade 2 weeks ago
parent
commit
8598c884e1
2 changed files with 123 additions and 0 deletions
  1. 66 0
      app/contato.jsx
  2. 57 0
      app/galeria.jsx

+ 66 - 0
app/contato.jsx

@@ -0,0 +1,66 @@
+import { Link, router } from "expo-router";
+import { useState } from "react";
+import {
+  Text,
+  TextInput,
+  View,
+  TouchableOpacity,
+  StyleSheet,
+  Button,
+} from "react-native";
+
+function irParaHome() {
+  if (router.canDismiss) {
+    router.dismissAll();
+  } else {
+    router.push("/index");
+  }
+}
+
+export default function Contato() {
+  const [mensagem, SetMensagem] = useState("");
+  const [enviado, setEnviado] = useState(false);
+
+  return (
+    <View style={{ flex: 1, padding: 20 }}>
+      <View style={{ flex: 1 }}>
+        <TextInput
+          style={styles.input}
+          placeholder="Digite a sua mensagem aqui"
+          value={mensagem}
+          onChangeText={SetMensagem}
+        />
+        <TouchableOpacity style={styles.button} onPress={setEnviado}>
+          <Text style={styles.botao}>Enviar Mensagem</Text>
+        </TouchableOpacity>
+        {enviado && <Text style={styles.mensagem}>A mensagem foi enviada</Text>}
+      </View>
+      <Button title="Ir para Home" onPress={irParaHome} />
+    </View>
+  );
+}
+
+const styles = StyleSheet.create({
+  botao: {
+    backgroundColor: "purple",
+    padding: 10,
+    borderRadius: 5,
+    alignItems: "center",
+    justifyContent: "center",
+    width: "50%",
+    alignSelf: "center",
+    marginTop: 10,
+  },
+  input: {
+    borderWidth: 1,
+    borderColor: "#999",
+    borderRadius: 5,
+    padding: 10,
+    marginBottom: 10,
+  },
+  mensagem: {
+    marginTop: 10,
+    fontSize: 16,
+    color: "green",
+  },
+});

+ 57 - 0
app/galeria.jsx

@@ -0,0 +1,57 @@
+import { Text, View, Image, TouchableOpacity, StyleSheet } from "react-native";
+import { useState } from "react";
+import { Link } from "expo-router";
+
+const imagem =
+  "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTEOEjPdrrrffHFF7B9Ip8c3r4T66AoZJneeQ&s.jpg";
+
+export default function Galeria() {
+  const [imageSize, setImageSize] = useState(200);
+
+  return (
+    <View style={[styles.container]}>
+      <View style={[styles.card]}>
+        <Image
+          source={{ uri: imagem }}
+          style={{ width: imageSize, height: imageSize }}
+        ></Image>
+        <TouchableOpacity
+          style={[styles.botao]}
+          onPress={() => setImageSize(imageSize === 200 ? 300 : 200)}
+        >
+            <Text>{imageSize === 200 ? "Aumentar" : "Diminuir"}</Text>
+
+        </TouchableOpacity>
+
+        <Link href="/contato"
+                        style={{
+                            padding: 10,
+                            backgroundColor: "#add",
+                            borderRadius: 5,
+                            alignItems: 'center',
+                            textAlign: 'center'
+                        }}>
+                            <Text>Ir para contato</Text>
+                        </Link>
+        
+        
+      </View>
+    </View>
+  );
+}
+
+const styles = StyleSheet.create({
+  container: {
+    flex: 1,
+    padding: 20,
+  },
+  card: {
+    flex: 1,
+    alignItems: "center",
+  },
+  botao: {
+    backgroundColor: "#f4511e",
+    padding: 10,
+    marginTop: 10,
+  },
+});