From 07476cd69a3af1d9342184a09e5b8d206b500350 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Gra=C3=A7a?= Date: Tue, 31 Dec 2024 13:21:38 +0000 Subject: [PATCH 1/4] trophy page almost complete --- assets/chest.png | Bin 0 -> 2262 bytes assets/trofeu-azul.png | Bin 0 -> 1197 bytes assets/trofeu-vermelho.png | Bin 0 -> 1095 bytes src/components/Task.js | 2 +- src/components/TrophyProgress.js | 31 ++++++ src/pages/HomePage.js | 4 +- src/pages/TrophiesPage.js | 71 +++++++++----- src/pages/WelcomePage.js | 159 +++++++++++++++---------------- tailwind.config.js | 2 +- 9 files changed, 162 insertions(+), 107 deletions(-) create mode 100644 assets/chest.png create mode 100644 assets/trofeu-azul.png create mode 100644 assets/trofeu-vermelho.png create mode 100644 src/components/TrophyProgress.js diff --git a/assets/chest.png b/assets/chest.png new file mode 100644 index 0000000000000000000000000000000000000000..1631decbaf8e4f9b0c8db04bebf5e0a255ec99f4 GIT binary patch literal 2262 zcmV;{2r2i8P)_L(`8nK_e5=%h7`ZE4zs=Bdexkt!+#^sNCAtoSIX=#wD6_@ZE5L_S$Q&%lCi( zbrT)5gLcpk+W)ty{SU8w{p`7V)Vpl0=^Z(H;lj^;@XPL8Yidbl`gyyvacn-%AIoWA zk|fP2O&6VaNwAKbb7ZkT;Lin3nBYB?8T6%EiB{RouE*QI z@x2RYXIjHkv$F|J&t#-+MbkOabQY-7QZ!W%6@{l1&me$|!9f5!{uvEs3}4(=0AWZ0 zh+-gMO^^eOVnEK*%Dn-AgWXV5;s+CkCV<-Iz0b_dW;DN$f%1&nc|ud5X1bNoOb$S~ zrXo?4;;_^hVJ^`Crvd4Pm+3eQtb z#|bG=n8KtJsMp)3vaD%1tf{IkjfNGK72W~Wd)MyLk@Lr}W}R@- zi3y<8u6`&1rEEVA!K6D^fEiCk%Ai;knvWn?R*+gzHF12^xVKmknDAKd#b(&dyw|Xu zAYnmaFlD35qQe;n;X$AnHayYRR z9e}+G?q8K2U>ptl3^b#d1#J(MO>meV$ zeDTBIe{gT>D=|fAOm2KS#KXmdRm@qwS@VT2o~HS3Mg!Q5EiH9s3L4fq{p3e)QLkUd zHRJdoaz$_SP3aONyQ5N>wfVW}XTJN#+nWO0N+f2a#ydCR zP%$yIh{|B`NG7qyG!D?~2fB3&Y-txu51K@+=-w*g%CRhOX<6Iqbbftl`TdtCD&uzY z^oiw_t9PWtVAcHVT_-NfHq@l5vGU@kJOWl$Z^NT>h;%V&C$s6sYe8kB)w1VlV=v}X5b+nS$AXcH!E+pUeyUwZYy2Qrj(yMIc68u^;Kk1tSWHpDAbn53#b z4XR0P7?W<3Wkd7QFm9$p$5fL_TER5fTi$8WRCkuPx3@VqUD=P}AwcC0{VjperWjId z=BVT+O-*$;o}?baMPp6Izb5g@vyUNTAG4Bd!Or6GB?QAQirFx``ba=$mcDdn`5)gL zW$g;3{e9{lOChO=`9?+KWV&?{i*qeWF-BqrB>7Atpc7R)qyt-3=t5PNKb7#chEJ?C z>{8j^k;+jQ(|>*>Aa(Jgd;P1&-zYNwiNf~i*%wp!tcf0_<0lLsZj1mM8@cE&L{ADe zAMWL{s0mp+^IxkM$ix4~%;Ek$|{ezpr1bRqNdRLgI?Hb|$D= zX$~p@^;U42iL!g@QEHzK*=U^Mk4A-$MqS&C3q^i5z^R6{*F(g|{y>@SGB@{jcHjE; koA3OU4%$IGX#d0ZA5QRwgDP}!UjP6A07*qoM6N<$g75r4QUCw| literal 0 HcmV?d00001 diff --git a/assets/trofeu-azul.png b/assets/trofeu-azul.png new file mode 100644 index 0000000000000000000000000000000000000000..20ba3b7f11d18a9f6e1fba6609328042e5f31e77 GIT binary patch literal 1197 zcmV;e1XBBnP)GrL|)AaoP{*HkR1Qd3HWb7)$rhb%p%Hy?Wo$EqT&^9hVUL21RIH}Va_H()t6 zO%GTql_EtVMkEOAsF*l7#P-hgy)gz%Z0{dC`CZmKJ2UV1{>{8+1|eY2F4_$EuTsDU zi1M=Y*)g9N}5x#TY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SF$g?a|UhIev;fBrruE_yjfUhM&MOqf6#h~N>XPB><3X)-vcTkh; zhnjA+689J)IbyydjWLy^gJG3_KRg@?xiF?Wv9?y0Mu@Ge%gfjfAjizJ?hXGd5M?xy zM=Zmv{n9Nm+fd0t%w@da`o*I$WfYT9% zr=vtiGZtdEENhZu5x)z}g$~5CWwA?nt-V5mBUvf|0d{9*T-j=EM+m6A+1MyjN~GHj zo6X4cKc{q;3r&|&qOS#TR^W2|182&1QP{3 ( - {taskText} + {taskText} { + const progressWidth = `${(progress / total) * 100}%`; + + return ( + + {/* Ícone */} + + + + + {/* Conteúdo de progresso */} + + {/* Texto */} + {text} + + {/* Barra de progresso */} + + + + + {/* Contador */} + {`${progress}/${total}`} + + + ); +}; + +export default TrophyProgress; diff --git a/src/pages/HomePage.js b/src/pages/HomePage.js index b1808d5..4d92d61 100644 --- a/src/pages/HomePage.js +++ b/src/pages/HomePage.js @@ -68,10 +68,10 @@ export default function HomePage() { {/* Literacia */} - Sabias que + Sabias que Ter uma adição pode prejudicar seriamente o nosso trabalho e as nossas relações. - Aprender mais em + Aprender mais em {/* Ver todas */} + console.log("Ver todas as tarefas clicado")}> + + VER TODAS + + + + + {/* Secção de Trofeus */} + + {/* Cabeçalho */} - VER TODAS + Icon Exclusivo - - {/* Literacia */} - - Sabias que - Ter uma adição pode prejudicar seriamente o nosso trabalho e as nossas relações. - - Aprender mais em - + - - {/* Informação de contactos */} - - - Existem 96 profissionais de saúde à tua disposição. Não hesites em contacta-los. - + + + + Outros Prémios + + + + + + + + + + + diff --git a/src/pages/WelcomePage.js b/src/pages/WelcomePage.js index 725d97e..79499c7 100644 --- a/src/pages/WelcomePage.js +++ b/src/pages/WelcomePage.js @@ -1,96 +1,93 @@ import React, { useState, useRef } from "react"; import { - View, - Text, - Image, - Animated, - FlatList, - Dimensions, + View, + Text, + Image, + Animated, + FlatList, + Dimensions, } from "react-native"; const { width: SCREEN_WIDTH } = Dimensions.get("window"); export default function WelcomePage({ navigation }) { - const [currentStep, setCurrentStep] = useState(0); + const [currentStep, setCurrentStep] = useState(0); - const steps = [ - { id: 0, text: "Olá! Bem-vindo ao LUMICHECK!" }, - { id: 1, text: "Eu sou a Lumi. É um prazer poder conhecer-te!" }, - { id: 2, text: "Vamos começar?" }, - { id: 3, text: " " }, - ]; + const steps = [ + { id: 0, text: "Olá! Bem-vindo ao LUMICHECK!" }, + { id: 1, text: "Eu sou a Lumi. É um prazer poder conhecer-te!" }, + { id: 2, text: "Vamos começar?" }, + { id: 3, text: " " }, + ]; - const flatListRef = useRef(null); + const flatListRef = useRef(null); - const handleScroll = (event) => { - const offsetX = event.nativeEvent.contentOffset.x; - const currentIndex = Math.round(offsetX / SCREEN_WIDTH); - setCurrentStep(currentIndex); - if (currentStep === steps.length - 1) { - navigation.replace("Login"); - } - }; + const handleScroll = (event) => { + const offsetX = event.nativeEvent.contentOffset.x; + const currentIndex = Math.round(offsetX / SCREEN_WIDTH); + setCurrentStep(currentIndex); + if (currentStep === steps.length - 1) { + navigation.replace("HomeTabs"); + } + }; - return ( - - {/* Texto principal */} - - ( - - - - {item.text} - - - {/* Imagem */} - - - + return ( + + {/* Texto principal */} + + ( + + + + {item.text} + + + {/* Imagem */} + + + + + )} + horizontal + showsHorizontalScrollIndicator={false} + pagingEnabled + onScroll={handleScroll} + keyExtractor={(item) => item.id.toString()} + scrollEventThrottle={16} // Optimize scroll updates + /> - )} - horizontal - showsHorizontalScrollIndicator={false} - pagingEnabled - onScroll={handleScroll} - keyExtractor={(item) => item.id.toString()} - scrollEventThrottle={16} // Optimize scroll updates - /> - - {/* Barra de progresso */} - - - {steps.map((_, index) => ( - - ))} - + {/* Barra de progresso */} + + + {steps.map((_, index) => ( + + ))} + - {/* Texto fixo indicando para deslizar */} - - - Desliza - - - - ); + {/* Texto fixo indicando para deslizar */} + + + Desliza + + + + ); } diff --git a/tailwind.config.js b/tailwind.config.js index 0c2203c..71ba61d 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -14,7 +14,7 @@ module.exports = { "light-gray": "#d0d0d0", }, fontFamily: { - sans: ["Quicksand_Regular"], + regular: ["Quicksand_Regular"], bold: ["Quicksand_Bold"], }, }, From 6685b23263cd87181c7cdf06cc6303d92ed2eb6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Gra=C3=A7a?= Date: Thu, 2 Jan 2025 16:39:37 +0000 Subject: [PATCH 2/4] achievements done --- src/components/Achievements.js | 27 ++++++++++++++++++++++++ src/pages/TrophiesPage.js | 38 ++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 src/components/Achievements.js diff --git a/src/components/Achievements.js b/src/components/Achievements.js new file mode 100644 index 0000000..0b33350 --- /dev/null +++ b/src/components/Achievements.js @@ -0,0 +1,27 @@ +import React from 'react'; +import { View, Text, Image } from 'react-native'; +import { MaterialIcons } from '@expo/vector-icons'; // Pacote de ícones do Expo + +const Achievements = ({ text, description, icon }) => { + return ( + + {/* Ícone */} + + + + + {/* Conteúdo de progresso */} + + {/* Texto */} + {text} + {description} + + + + {/* Ícone substituído */} + + + ); +}; + +export default Achievements; diff --git a/src/pages/TrophiesPage.js b/src/pages/TrophiesPage.js index 091fd6a..cf05a3b 100644 --- a/src/pages/TrophiesPage.js +++ b/src/pages/TrophiesPage.js @@ -3,6 +3,7 @@ import { Text, View, Image, TouchableOpacity, ScrollView } from "react-native"; import { LinearGradient } from "expo-linear-gradient"; import Task from "../components/Task"; import TrophyProgress from "../components/TrophyProgress"; +import Achievements from "../components/Achievements"; // Importar os ícones diretamente import TrophyRed from "../../assets/trofeu-vermelho.png"; @@ -81,7 +82,44 @@ export default function TrophiesPage() { + + {/* Cabeçalho */} + + As Minhas Conquistas + + + {/* Icon exclusivo */} + + + + + + + + + + + + {/* Ver todas */} + console.log("Ver todas as conquistas clicado")}> + + VER TODAS + + + From 33ab9e8ef62cadefd87c4d1d76a249aac3beee6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Gra=C3=A7a?= Date: Thu, 2 Jan 2025 17:30:17 +0000 Subject: [PATCH 3/4] alltaskspage done --- src/App.js | 9 +++- src/components/TaskFinished.js | 10 +++++ src/pages/AllTasksPage.js | 81 ++++++++++++++++++++++++++++++++++ src/pages/TrophiesPage.js | 7 ++- 4 files changed, 103 insertions(+), 4 deletions(-) create mode 100644 src/components/TaskFinished.js create mode 100644 src/pages/AllTasksPage.js diff --git a/src/App.js b/src/App.js index 902a8e7..801bcd3 100644 --- a/src/App.js +++ b/src/App.js @@ -1,5 +1,5 @@ import React from "react"; -import { Text, View, StatusBar } from "react-native"; +import { Text, View } from "react-native"; import { NavigationContainer } from "@react-navigation/native"; import { createNativeStackNavigator } from "@react-navigation/native-stack"; import { createBottomTabNavigator } from "@react-navigation/bottom-tabs"; @@ -17,6 +17,7 @@ import HelpIcon from "../assets/icons/help.svg"; import WelcomePage from "./pages/WelcomePage"; import HomePage from "./pages/HomePage"; import TrophiesPage from "./pages/TrophiesPage"; +import AllTasksPage from "./pages/AllTasksPage"; import DataPage from "./pages/DataPage"; import ProfilePage from "./pages/ProfilePage"; import HelpPage from "./pages/HelpPage"; @@ -93,7 +94,6 @@ export default function App() { // Stack Navigator (para gerenciar Welcome e HomeTabs) return ( <> - {/* Tela de boas-vindas sem navbar */} @@ -113,6 +113,11 @@ export default function App() { component={HomeTabs} options={{ headerShown: false }} /> + diff --git a/src/components/TaskFinished.js b/src/components/TaskFinished.js new file mode 100644 index 0000000..b9e18eb --- /dev/null +++ b/src/components/TaskFinished.js @@ -0,0 +1,10 @@ +import React from "react"; +import { Text, View } from "react-native"; + +const Task = ({ taskText }) => ( + + {taskText} + +); + +export default Task; \ No newline at end of file diff --git a/src/pages/AllTasksPage.js b/src/pages/AllTasksPage.js new file mode 100644 index 0000000..92336ca --- /dev/null +++ b/src/pages/AllTasksPage.js @@ -0,0 +1,81 @@ +import React from "react"; +import { View, Text, TouchableOpacity, ScrollView } from "react-native"; +import { LinearGradient } from "expo-linear-gradient"; +import Task from "../components/Task"; +import TaskFinished from "../components/TaskFinished"; +import { Ionicons } from "@expo/vector-icons"; + +export default function AllTasksPage({ navigation }) { + // Lista de tarefas + const tasksdiarias = [ + "Estar apenas 2 horas no Insta hoje", + "Falar com os amigos" + ]; + + const tasksconcluidas = [ + "Ler um livro", + "Fazer exercício físico", + "Aprender algo novo", + "Meditar por 10 minutos", + "Desconectar do celular por 1 hora", + "Passar tempo com a família", + "Planejar a próxima semana", + "Escrever um diário sobre o dia" + ]; + + return ( + + + + + + {/* Botão de voltar */} + + navigation.goBack()} + > + + + {/* Espaço para manter alinhamento se necessário */} + + + {/* Secção de Tarefas Diárias */} + + {/* Cabeçalho */} + + Tarefas Diárias + 7 HORAS + + + {/* Lista de tarefas */} + {tasksdiarias.map((task, index) => ( + + ))} + + + + {/* Secção de Tarefas Concluidas */} + + {/* Cabeçalho */} + + Tarefas Concluidas + + + {/* Lista de tarefas */} + {tasksconcluidas.map((task, index) => ( + + ))} + + + + + + + + + ); +} diff --git a/src/pages/TrophiesPage.js b/src/pages/TrophiesPage.js index cf05a3b..d32c31c 100644 --- a/src/pages/TrophiesPage.js +++ b/src/pages/TrophiesPage.js @@ -1,6 +1,7 @@ import React from "react"; -import { Text, View, Image, TouchableOpacity, ScrollView } from "react-native"; +import { Text, View, TouchableOpacity, ScrollView } from "react-native"; import { LinearGradient } from "expo-linear-gradient"; +import { useNavigation } from "@react-navigation/native"; import Task from "../components/Task"; import TrophyProgress from "../components/TrophyProgress"; import Achievements from "../components/Achievements"; @@ -11,6 +12,8 @@ import TrophyBlue from "../../assets/trofeu-azul.png"; import ChestIcon from "../../assets/chest.png"; export default function TrophiesPage() { + const navigation = useNavigation(); + return ( {/* Ver todas */} - console.log("Ver todas as tarefas clicado")}> + navigation.navigate("AllTasks")}> VER TODAS From 75c4bc494eba48d8b414dce9611a652ab869a84e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Gra=C3=A7a?= Date: Thu, 2 Jan 2025 17:44:06 +0000 Subject: [PATCH 4/4] fix text error --- src/components/Achievements.js | 2 +- src/pages/AllTasksPage.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Achievements.js b/src/components/Achievements.js index 0b33350..6318f8a 100644 --- a/src/components/Achievements.js +++ b/src/components/Achievements.js @@ -18,7 +18,7 @@ const Achievements = ({ text, description, icon }) => { - {/* Ícone substituído */} + ); diff --git a/src/pages/AllTasksPage.js b/src/pages/AllTasksPage.js index 92336ca..218f7bf 100644 --- a/src/pages/AllTasksPage.js +++ b/src/pages/AllTasksPage.js @@ -40,7 +40,7 @@ export default function AllTasksPage({ navigation }) { > - {/* Espaço para manter alinhamento se necessário */} + {/* Secção de Tarefas Diárias */}