From 15355007de7bb0e3cc1fb33fe0c30826089192b6 Mon Sep 17 00:00:00 2001 From: Ricardo Gomes <230413@epvc.pt> Date: Fri, 12 Dec 2025 10:43:24 +0000 Subject: [PATCH] teste --- app/dashboard.tsx | 106 +++++++++++++++++++++++++++++++++ app/index.tsx | 146 ++++++++++++---------------------------------- app/register.tsx | 26 ++++----- 3 files changed, 155 insertions(+), 123 deletions(-) create mode 100644 app/dashboard.tsx diff --git a/app/dashboard.tsx b/app/dashboard.tsx new file mode 100644 index 0000000..61f7d6f --- /dev/null +++ b/app/dashboard.tsx @@ -0,0 +1,106 @@ +// app/dashboard.tsx +import React from 'react'; +import { View, Text, TouchableOpacity, StyleSheet, ScrollView, SafeAreaView } from 'react-native'; + +export default function Dashboard() { + return ( + + + + {/* Header */} + + Bem-vindo, João! + + 🔔 + + + + {/* Sumários */} + + Sumários Recentes + + Sumário 1 - 10/12/2025 + Sumário 2 - 09/12/2025 + + Criar Sumário + + + + + {/* Presença */} + + Presença + + 📌 Marcar presença + + Última presença: 10/12/2025 + + + {/* Calendário */} + + Calendário + + [Calendário] + + + + {/* Justificar faltas */} + + Justificar Faltas + + Justificar falta + + + + {/* Chat */} + + Chat com o professor + + 💬 Abrir chat + + + + + + ); +} + +const styles = StyleSheet.create({ + safe: { + flex: 1, + backgroundColor: '#f8f9fa', + }, + container: { + flex: 1, + }, + header: { + flexDirection: 'row', + justifyContent: 'space-between', + alignItems: 'center', + marginBottom: 20, + paddingHorizontal: 5, + }, + title: { fontSize: 24, fontWeight: '700' }, + icon: { fontSize: 24 }, + section: { marginBottom: 20 }, + sectionTitle: { fontSize: 18, fontWeight: '600', marginBottom: 8 }, + card: { + backgroundColor: '#fff', + padding: 16, + borderRadius: 12, + shadowColor: '#000', + shadowOpacity: 0.1, + shadowOffset: { width: 0, height: 2 }, + shadowRadius: 4, + elevation: 3, + }, + button: { + marginTop: 10, + backgroundColor: '#0984e3', + paddingVertical: 12, + borderRadius: 10, + alignItems: 'center', + }, + buttonText: { color: '#fff', fontWeight: '700' }, + lastText: { marginTop: 8 }, +}); diff --git a/app/index.tsx b/app/index.tsx index 46572bf..ec509c5 100644 --- a/app/index.tsx +++ b/app/index.tsx @@ -1,6 +1,4 @@ -// app/index.tsx - SUA TELA DE LOGIN -// Adicione esta linha com os outros imports: -import { Link } from 'expo-router'; +// app/index.tsx - TELA DE LOGIN import React, { useState } from 'react'; import { View, @@ -11,37 +9,42 @@ import { KeyboardAvoidingView, Platform, Alert, - Image, ActivityIndicator } from 'react-native'; +import { useRouter, Link } from 'expo-router'; export default function LoginScreen() { const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [loading, setLoading] = useState(false); + const router = useRouter(); // Inicializa o router + const handleLogin = () => { if (!email || !password) { Alert.alert('Atenção', 'Por favor, preencha todos os campos'); return; } - + if (!email.includes('@')) { Alert.alert('Email inválido', 'Por favor, insira um email válido'); return; } - + setLoading(true); - - // SIMULAÇÃO DE LOGIN (depois troca por API real) + + // SIMULAÇÃO DE LOGIN setTimeout(() => { setLoading(false); - Alert.alert( - 'Login realizado!', - `Bem-vindo(a), ${email.split('@')[0]}!`, - [{ text: 'OK', onPress: () => console.log('Login OK') }] - ); - // Aqui você navegaria para o app principal: router.replace('/(tabs)'); + + // Primeiro navega para a dashboard + router.replace('/dashboard'); // ⬅️ Certifica-te que o ficheiro é app/dashboard.tsx + + // Depois mostra alert de boas-vindas (opcional) + setTimeout(() => { + Alert.alert('Login realizado!', `Bem-vindo(a), ${email.split('@')[0]}!`); + }, 300); // delay pequeno para garantir que a navegação ocorreu + }, 1500); }; @@ -106,9 +109,9 @@ export default function LoginScreen() { Não tem uma conta? - - Crie uma conta agora - + + Crie uma conta agora + @@ -119,97 +122,20 @@ export default function LoginScreen() { // ESTILOS const styles = StyleSheet.create({ - container: { - flex: 1, - backgroundColor: '#f8f9fa', - }, - content: { - flex: 1, - justifyContent: 'center', - paddingHorizontal: 24, - }, - header: { - alignItems: 'center', - marginBottom: 48, - }, - title: { - fontSize: 32, - fontWeight: '800', - color: '#2d3436', - marginBottom: 8, - }, - subtitle: { - fontSize: 16, - color: '#636e72', - textAlign: 'center', - }, - form: { - backgroundColor: '#fff', - borderRadius: 20, - padding: 24, - shadowColor: '#000', - shadowOffset: { width: 0, height: 4 }, - shadowOpacity: 0.1, - shadowRadius: 12, - elevation: 5, - }, - label: { - fontSize: 14, - fontWeight: '600', - color: '#2d3436', - marginBottom: 8, - marginLeft: 4, - }, - input: { - backgroundColor: '#f8f9fa', - borderRadius: 12, - paddingHorizontal: 16, - paddingVertical: 14, - fontSize: 16, - marginBottom: 20, - borderWidth: 1, - borderColor: '#dfe6e9', - color: '#2d3436', - }, - button: { - backgroundColor: '#0984e3', - borderRadius: 12, - paddingVertical: 16, - alignItems: 'center', - marginTop: 8, - marginBottom: 24, - }, - buttonDisabled: { - backgroundColor: '#74b9ff', - }, - buttonText: { - color: '#fff', - fontSize: 16, - fontWeight: '700', - }, - forgotLink: { - alignItems: 'center', - }, - forgotText: { - color: '#0984e3', - fontSize: 15, - fontWeight: '500', - }, - footer: { - flexDirection: 'row', - justifyContent: 'center', - marginTop: 40, - paddingTop: 24, - borderTopWidth: 1, - borderTopColor: '#dfe6e9', - }, - footerText: { - color: '#636e72', - fontSize: 15, - }, - registerText: { - color: '#0984e3', - fontSize: 15, - fontWeight: '700', - }, + container: { flex: 1, backgroundColor: '#f8f9fa' }, + content: { flex: 1, justifyContent: 'center', paddingHorizontal: 24 }, + header: { alignItems: 'center', marginBottom: 48 }, + title: { fontSize: 32, fontWeight: '800', color: '#2d3436', marginBottom: 8 }, + subtitle: { fontSize: 16, color: '#636e72', textAlign: 'center' }, + form: { backgroundColor: '#fff', borderRadius: 20, padding: 24, shadowColor: '#000', shadowOffset: { width: 0, height: 4 }, shadowOpacity: 0.1, shadowRadius: 12, elevation: 5 }, + label: { fontSize: 14, fontWeight: '600', color: '#2d3436', marginBottom: 8, marginLeft: 4 }, + input: { backgroundColor: '#f8f9fa', borderRadius: 12, paddingHorizontal: 16, paddingVertical: 14, fontSize: 16, marginBottom: 20, borderWidth: 1, borderColor: '#dfe6e9', color: '#2d3436' }, + button: { backgroundColor: '#0984e3', borderRadius: 12, paddingVertical: 16, alignItems: 'center', marginTop: 8, marginBottom: 24 }, + buttonDisabled: { backgroundColor: '#74b9ff' }, + buttonText: { color: '#fff', fontSize: 16, fontWeight: '700' }, + forgotLink: { alignItems: 'center' }, + forgotText: { color: '#0984e3', fontSize: 15, fontWeight: '500' }, + footer: { flexDirection: 'row', justifyContent: 'center', marginTop: 40, paddingTop: 24, borderTopWidth: 1, borderTopColor: '#dfe6e9' }, + footerText: { color: '#636e72', fontSize: 15 }, + registerText: { color: '#0984e3', fontSize: 15, fontWeight: '700' }, }); diff --git a/app/register.tsx b/app/register.tsx index a4f41f5..5af0fff 100644 --- a/app/register.tsx +++ b/app/register.tsx @@ -33,7 +33,7 @@ export default function RegisterScreen() { const handleRegister = () => { if (!form.nome.trim()) { - Alert.alert('Erro', 'Por favor, insira seu nome'); + Alert.alert('Erro', 'Por favor, insira o seu nome'); return; } @@ -85,7 +85,7 @@ export default function RegisterScreen() { showsVerticalScrollIndicator={false} keyboardShouldPersistTaps="handled" > - {/* BOTÃO VOLTAR NO TOPO (AGORA SEM BUG DO NOTCH) */} + {/* BOTÃO VOLTAR ATRÁS */} @@ -102,12 +102,12 @@ export default function RegisterScreen() { {/* FORMULÁRIO */} - {/* NOME */} + {/* NOME COMPLETO */} Nome Completo handleChange('nome', text)} editable={!loading} @@ -119,7 +119,7 @@ export default function RegisterScreen() { Email handleChange('email', text)} keyboardType="email-address" @@ -128,12 +128,12 @@ export default function RegisterScreen() { /> - {/* TELEFONE */} + {/* Nº TELEMÓVEL */} Telefone handleChange('telefone', text)} keyboardType="phone-pad" @@ -141,12 +141,12 @@ export default function RegisterScreen() { /> - {/* SENHA */} + {/* PALAVRA-PASSE */} Senha handleChange('password', text)} secureTextEntry @@ -154,12 +154,12 @@ export default function RegisterScreen() { /> - {/* CONFIRMAR SENHA */} + {/* CONFIRMAR PALAVRA-PASSE */} Confirmar Senha handleChange('confirmarPassword', text)} secureTextEntry @@ -167,7 +167,7 @@ export default function RegisterScreen() { /> - {/* BOTÃO REGISTRAR */} + {/* BOTÃO CRIAR CONTA */}