Atualizacao

This commit is contained in:
2026-01-07 10:39:56 +00:00
parent 15355007de
commit 4ad55d6074
8 changed files with 368 additions and 116 deletions

122
app/AlunoHome.tsx Normal file
View File

@@ -0,0 +1,122 @@
import React, { useState } from 'react';
import { View, Text, TouchableOpacity, StyleSheet, SafeAreaView } from 'react-native';
import { Calendar, LocaleConfig } from 'react-native-calendars';
// Configurações de idioma do calendário (opcional)
LocaleConfig.locales['pt'] = {
monthNames: [
'Janeiro','Fevereiro','Março','Abril','Maio','Junho',
'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'
],
monthNamesShort: [
'Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez'
],
dayNames: [
'Domingo','Segunda','Terça','Quarta','Quinta','Sexta','Sábado'
],
dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'],
};
LocaleConfig.defaultLocale = 'pt';
export default function AlunoHome() {
const [presencaMarcada, setPresencaMarcada] = useState(true);
function marcarPresenca() {
setPresencaMarcada(true);
}
// Exemplo de datas marcadas no calendário
const diasMarcados = {
'2026-01-07': { marked: true, dotColor: 'green' }, // hoje presente marcada
'2026-01-06': { marked: true, dotColor: 'blue' }, // sumário enviado
};
return (
<SafeAreaView style={styles.safeArea}>
<View style={styles.container}>
{/* Header */}
<View style={styles.header}>
<Text style={styles.headerTitulo}>Estágio</Text>
<Text style={styles.headerSubtitulo}>Controlo diário do aluno</Text>
</View>
{/* Botão Presença */}
<TouchableOpacity
style={[
styles.botaoPresenca,
presencaMarcada && styles.botaoDesativado,
]}
onPress={marcarPresenca}
disabled={presencaMarcada}
>
<Text style={styles.textoBotao}>
{presencaMarcada ? 'Presença Marcada ✅' : 'Marcar Presença'}
</Text>
</TouchableOpacity>
{/* Calendário abaixo do botão */}
<View style={styles.calendarioContainer}>
<Calendar
markedDates={diasMarcados}
markingType={'dot'}
style={styles.calendario}
theme={{
todayTextColor: '#0d6efd',
arrowColor: '#0d6efd',
}}
/>
</View>
</View>
</SafeAreaView>
);
}
const styles = StyleSheet.create({
safeArea: {
flex: 1,
backgroundColor: '#f1f3f5',
},
container: {
flex: 1,
paddingHorizontal: 20,
},
header: {
marginTop: 20,
marginBottom: 25,
},
headerTitulo: {
fontSize: 30,
fontWeight: 'bold',
color: '#111',
},
headerSubtitulo: {
fontSize: 16,
color: '#6c757d',
marginTop: 4,
},
botaoPresenca: {
backgroundColor: '#0d6efd',
paddingVertical: 16,
borderRadius: 12,
alignItems: 'center',
marginBottom: 20,
},
botaoDesativado: {
backgroundColor: '#b6d4fe',
},
textoBotao: {
color: '#ffffff',
fontSize: 17,
fontWeight: '600',
},
calendarioContainer: {
marginBottom: 20,
},
calendario: {
borderRadius: 16,
backgroundColor: '#fff',
padding: 10,
},
});

View File

@@ -7,7 +7,7 @@ export default function RootLayout() {
<>
<StatusBar style="dark" />
<Stack screenOptions={{ headerShown: false }}>
<Stack.Screen name="index" />
<Stack.Screen name= "/index.tsx" />
</Stack>
</>
);

View File

@@ -1,106 +0,0 @@
// app/dashboard.tsx
import React from 'react';
import { View, Text, TouchableOpacity, StyleSheet, ScrollView, SafeAreaView } from 'react-native';
export default function Dashboard() {
return (
<SafeAreaView style={styles.safe}>
<ScrollView style={styles.container} contentContainerStyle={{ padding: 20 }}>
{/* Header */}
<View style={styles.header}>
<Text style={styles.title}>Bem-vindo, João!</Text>
<TouchableOpacity>
<Text style={styles.icon}>🔔</Text>
</TouchableOpacity>
</View>
{/* Sumários */}
<View style={styles.section}>
<Text style={styles.sectionTitle}>Sumários Recentes</Text>
<View style={styles.card}>
<Text>Sumário 1 - 10/12/2025</Text>
<Text>Sumário 2 - 09/12/2025</Text>
<TouchableOpacity style={styles.button}>
<Text style={styles.buttonText}>Criar Sumário</Text>
</TouchableOpacity>
</View>
</View>
{/* Presença */}
<View style={styles.section}>
<Text style={styles.sectionTitle}>Presença</Text>
<TouchableOpacity style={styles.button}>
<Text style={styles.buttonText}>📌 Marcar presença</Text>
</TouchableOpacity>
<Text style={styles.lastText}>Última presença: 10/12/2025</Text>
</View>
{/* Calendário */}
<View style={styles.section}>
<Text style={styles.sectionTitle}>Calendário</Text>
<View style={styles.card}>
<Text>[Calendário]</Text>
</View>
</View>
{/* Justificar faltas */}
<View style={styles.section}>
<Text style={styles.sectionTitle}>Justificar Faltas</Text>
<TouchableOpacity style={styles.button}>
<Text style={styles.buttonText}>Justificar falta</Text>
</TouchableOpacity>
</View>
{/* Chat */}
<View style={styles.section}>
<Text style={styles.sectionTitle}>Chat com o professor</Text>
<TouchableOpacity style={styles.button}>
<Text style={styles.buttonText}>💬 Abrir chat</Text>
</TouchableOpacity>
</View>
</ScrollView>
</SafeAreaView>
);
}
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 },
});

View File

@@ -1,4 +1,8 @@
// app/index.tsx - TELA DE LOGIN
import React, { useState } from 'react';
import {
View,
@@ -38,7 +42,7 @@ export default function LoginScreen() {
setLoading(false);
// Primeiro navega para a dashboard
router.replace('/dashboard'); // ⬅️ Certifica-te que o ficheiro é app/dashboard.tsx
router.replace('/AlunoHome'); // ⬅️ Certifica-te que o ficheiro é app/dashboard.tsx
// Depois mostra alert de boas-vindas (opcional)
setTimeout(() => {

148
app/mainmenu.tsx Normal file
View File

@@ -0,0 +1,148 @@
// app/screens/MainMenu.tsx
import React from 'react';
import {
SafeAreaView,
ScrollView,
View,
Text,
TouchableOpacity,
StyleSheet,
StatusBar,
} from 'react-native';
// Isto é o teu menu principal
const MainMenu = () => {
// Lista dos botões do menu
const menuItems = [
{ id: 1, title: 'Criar Novo Sumário', icon: '📝' },
{ id: 2, title: 'Meus Sumários', icon: '📚' },
{ id: 3, title: 'Calendário', icon: '📅' },
{ id: 4, title: 'Notas', icon: '📊' },
{ id: 5, title: 'Horário', icon: '⏰' },
{ id: 6, title: 'Perfil', icon: '👤' },
{ id: 7, title: 'Configurações', icon: '⚙️' },
{ id: 8, title: 'Ajuda', icon: '❓' },
];
// Quando carregas num botão
const handlePress = (title: string) => {
console.log(`Carregaste em: ${title}`);
// Aqui mais tarde mete-se a navegação
};
return (
<SafeAreaView style={styles.container}>
<StatusBar barStyle="dark-content" />
{/* Cabeçalho com o teu nome */}
<View style={styles.header}>
<Text style={styles.greeting}>Bem-vindo de volta, Ricardo!</Text>
<Text style={styles.subGreeting}>Desejamos-lhe um bom trabalho!</Text>
<Text style={styles.date}>06/01/2026, 14:41:52</Text>
</View>
{/* Os botões todos em grid */}
<ScrollView contentContainerStyle={styles.menuGrid}>
{menuItems.map((item) => (
<TouchableOpacity
key={item.id}
style={styles.menuItem}
onPress={() => handlePress(item.title)}
>
<View style={styles.iconBox}>
<Text style={styles.icon}>{item.icon}</Text>
</View>
<Text style={styles.menuText}>{item.title}</Text>
</TouchableOpacity>
))}
</ScrollView>
{/* Botão grande em baixo */}
<TouchableOpacity
style={styles.bigButton}
onPress={() => handlePress('Criar Novo Sumário')}
>
<Text style={styles.bigButtonText}>Criar Novo Sumário</Text>
</TouchableOpacity>
</SafeAreaView>
);
};
// Estilos (cores, tamanhos, etc.)
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#f5f5f5',
},
header: {
backgroundColor: 'white',
padding: 20,
borderBottomWidth: 1,
borderBottomColor: '#e0e0e0',
},
greeting: {
fontSize: 22,
fontWeight: 'bold',
color: 'black',
},
subGreeting: {
fontSize: 16,
color: 'gray',
marginTop: 5,
},
date: {
fontSize: 14,
color: 'lightgray',
marginTop: 10,
},
menuGrid: {
flexDirection: 'row',
flexWrap: 'wrap',
justifyContent: 'space-between',
padding: 10,
},
menuItem: {
width: '48%',
backgroundColor: 'white',
borderRadius: 10,
padding: 15,
marginBottom: 15,
alignItems: 'center',
shadowColor: '#000',
shadowOffset: { width: 0, height: 2 },
shadowOpacity: 0.1,
shadowRadius: 3,
elevation: 3,
},
iconBox: {
width: 50,
height: 50,
borderRadius: 25,
backgroundColor: '#f0f0f0',
justifyContent: 'center',
alignItems: 'center',
marginBottom: 10,
},
icon: {
fontSize: 24,
},
menuText: {
fontSize: 14,
fontWeight: '600',
textAlign: 'center',
},
bigButton: {
backgroundColor: '#2196F3',
margin: 20,
padding: 18,
borderRadius: 10,
alignItems: 'center',
},
bigButtonText: {
color: 'white',
fontSize: 18,
fontWeight: 'bold',
},
});
export default MainMenu;

View File

@@ -1,5 +1,8 @@
// app/register.tsx - TELA DE CRIAR CONTA (CORRIGIDA)
import React, { useState } from 'react';
import {
View,
@@ -17,7 +20,7 @@ import { Link } from 'expo-router';
import { StatusBar } from 'expo-status-bar';
import { SafeAreaView } from 'react-native-safe-area-context';
export default function RegisterScreen() {
export default function CriarContaScreen() {
const [form, setForm] = useState({
nome: '',
email: '',
@@ -86,7 +89,7 @@ export default function RegisterScreen() {
keyboardShouldPersistTaps="handled"
>
{/* BOTÃO VOLTAR ATRÁS */}
<Link href="/" asChild>
<Link href={"/"} asChild>
<TouchableOpacity style={styles.backHeaderButton} disabled={loading}>
<Text style={styles.backHeaderText}></Text>
</TouchableOpacity>