Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/chest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/trofeu-azul.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/trofeu-vermelho.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 7 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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";
Expand Down Expand Up @@ -93,7 +94,6 @@ export default function App() {
// Stack Navigator (para gerenciar Welcome e HomeTabs)
return (
<>
<StatusBar barStyle="dark-content" />
<NavigationContainer>
<Stack.Navigator>
{/* Tela de boas-vindas sem navbar */}
Expand All @@ -113,6 +113,11 @@ export default function App() {
component={HomeTabs}
options={{ headerShown: false }}
/>
<Stack.Screen
name="AllTasks"
component={AllTasksPage}
options={{ headerShown: false }}
/>
</Stack.Navigator>
</NavigationContainer>
</>
Expand Down
27 changes: 27 additions & 0 deletions src/components/Achievements.js
Original file line number Diff line number Diff line change
@@ -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 (
<View className="flex-row items-center w-full">
{/* Ícone */}
<View className="mr-4">
<Image source={icon} className="w-12 h-12 mr-3" resizeMode="contain" />
</View>

{/* Conteúdo de progresso */}
<View className="flex-1">
{/* Texto */}
<Text className="text-lg font-bold">{text}</Text>
<Text className="text-lg font-bold text-light-gray">{description}</Text>
</View>

<View className="ml-auto">
<MaterialIcons name="chevron-right" size={35} color="#aa82da" />
</View>
</View>
);
};

export default Achievements;
2 changes: 1 addition & 1 deletion src/components/Task.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import CheckIcon from "../../assets/icons/check.svg";

const Task = ({ taskText, isCompleted }) => (
<View className="flex-row items-center justify-between bg-white rounded-lg px-4 mb-2 border border-light-gray">
<Text className="text-lg text-gray-600 flex-1 py-3">{taskText}</Text>
<Text className="text-lg font-regular flex-1 py-3">{taskText}</Text>
<View className="h-full w-[1px] bg-light-gray mr-4" />
<CheckIcon
width={24}
Expand Down
10 changes: 10 additions & 0 deletions src/components/TaskFinished.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from "react";
import { Text, View } from "react-native";

const Task = ({ taskText }) => (
<View className="flex-row items-center justify-between bg-white rounded-lg px-4 mb-2 border border-light-gray">
<Text className="text-lg line-through text-dark-gray font-regular flex-1 py-3">{taskText}</Text>
</View>
);

export default Task;
31 changes: 31 additions & 0 deletions src/components/TrophyProgress.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React from 'react';
import { View, Text, Image } from 'react-native';

const TrophyProgress = ({ text, progress, total, icon }) => {
const progressWidth = `${(progress / total) * 100}%`;

return (
<View className="flex-row items-center w-full">
{/* Ícone */}
<View className="mr-4">
<Image source={icon} className="w-12 h-12 mr-3" resizeMode="contain" />
</View>

{/* Conteúdo de progresso */}
<View className="flex-1">
{/* Texto */}
<Text className="text-lg font-regular mb-2">{text}</Text>

{/* Barra de progresso */}
<View className="h-3 bg-white rounded-full overflow-hidden border border-light-gray">
<View style={{ width: progressWidth }} className="h-full bg-violet rounded-full" />
</View>

{/* Contador */}
<Text className="text-sm text-dark-gray text-right mt-1">{`${progress}/${total}`}</Text>
</View>
</View>
);
};

export default TrophyProgress;
81 changes: 81 additions & 0 deletions src/pages/AllTasksPage.js
Original file line number Diff line number Diff line change
@@ -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 (
<LinearGradient
colors={["#ffe5b4", "#fff9ef", "#fff9ef"]}
locations={[0, 0.5, 1]}
style={{ flex: 1 }}
>
<ScrollView>
<View className="flex-1 py-8 px-4">
<View className="flex-1">
<View className="flex-1 items-center pt-12">
{/* Botão de voltar */}
<View className="w-11/12 flex-row items-center">
<TouchableOpacity
onPress={() => navigation.goBack()}
>
<Ionicons name="arrow-back" size={24} color="black" />
</TouchableOpacity>
<View className="flex-1"></View>
</View>

{/* Secção de Tarefas Diárias */}
<View className="w-11/12 mt-8">
{/* Cabeçalho */}
<View className="flex-row items-center justify-between mb-4">
<Text className="text-xl font-bold text-black">Tarefas Diárias</Text>
<Text className="text-md font-bold text-orange self-end">7 HORAS</Text>
</View>

{/* Lista de tarefas */}
{tasksdiarias.map((task, index) => (
<Task key={index} taskText={task} isCompleted={index % 2 === 0} />
))}

</View>

{/* Secção de Tarefas Concluidas */}
<View className="w-11/12 mt-8">
{/* Cabeçalho */}
<View className="mb-4">
<Text className="text-xl font-bold text-black">Tarefas Concluidas</Text>
</View>

{/* Lista de tarefas */}
{tasksconcluidas.map((task, index) => (
<TaskFinished key={index} taskText={task} />
))}

</View>

</View>
</View>
</View>
</ScrollView>
</LinearGradient>
);
}
4 changes: 2 additions & 2 deletions src/pages/HomePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ export default function HomePage() {

{/* Literacia */}
<TouchableOpacity className="bg-white rounded-lg w-11/12 mt-8 border-2 border-violet p-4">
<Text className="text-xl text-dark-gray">Sabias que</Text>
<Text className="text-xl font-regular text-dark-gray">Sabias que</Text>
<Text className="text-md font-bold my-2">Ter uma adição pode prejudicar seriamente o nosso trabalho e as nossas relações.</Text>
<View className="flex-row items-center justify-end">
<Text className="text-sm text-light-gray">Aprender mais em</Text>
<Text className="text-sm font-regular text-light-gray">Aprender mais em</Text>
<Image
source={require("../../assets/sintome.png")}
className="w-16 ml-2"
Expand Down
112 changes: 90 additions & 22 deletions src/pages/TrophiesPage.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
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";

// Importar os ícones diretamente
import TrophyRed from "../../assets/trofeu-vermelho.png";
import TrophyBlue from "../../assets/trofeu-azul.png";
import ChestIcon from "../../assets/chest.png";

// Importar os ícones SVG diretamente
import TrophyGoldIcon from "../../assets/icons/trophygold.svg";
import QuestionIcon from "../../assets/icons/question.svg";
import HelpContactsIcon from "../../assets/icons/helpcontacts.svg";
export default function TrophiesPage() {
const navigation = useNavigation();

return (
<LinearGradient
colors={["#ffe5b4", "#fff9ef", "#fff9ef"]}
Expand All @@ -31,30 +37,92 @@ export default function TrophiesPage() {
<Task taskText="Falar com os amigos" isCompleted={false} />

{/* Ver todas */}
<TouchableOpacity onPress={() => navigation.navigate("AllTasks")}>
<View className="mb-4 flex-row justify-end">
<Text className="text-md font-bold text-orange">VER TODAS</Text>
</View>
</TouchableOpacity>
</View>

{/* Secção de Trofeus */}
<View className="w-11/12 mt-8">
{/* Cabeçalho */}
<View className="mb-4">
<Text className="text-md font-bold text-orange">VER TODAS</Text>
<Text className="text-xl font-bold text-black">Icon Exclusivo</Text>
</View>

{/* Icon exclusivo */}
<View className="bg-white rounded-lg border border-light-gray p-4 items-center">
<TrophyProgress
text="Complete 30 tarefas diárias"
progress={7}
total={30}
icon={ChestIcon}
/>
</View>


<View className="bg-white rounded-lg border border-light-gray p-4 mt-8">
<View className="mb-4">
<Text className="text-xl font-bold text-black">Outros Prémios</Text>
</View>
<View className="mb-4">
<TrophyProgress
text="Responda a 3 perguntas num dia"
progress={1}
total={3}
icon={TrophyRed}
/>
</View>
<View className="mb-4">
<TrophyProgress
text="Aprenda mais em Eu Sinto-Me"
progress={0}
total={1}
icon={TrophyBlue}
/>
</View>
</View>
</View>

{/* Literacia */}
<TouchableOpacity className="bg-white rounded-lg w-11/12 mt-8 border-2 border-violet p-4">
<Text className="text-xl text-dark-gray">Sabias que</Text>
<Text className="text-md font-bold my-2">Ter uma adição pode prejudicar seriamente o nosso trabalho e as nossas relações.</Text>
<View className="flex-row items-center justify-end">
<Text className="text-sm text-light-gray">Aprender mais em</Text>
<Image
source={require("../../assets/sintome.png")}
className="w-16 ml-2"
resizeMode="contain"
<View className="w-11/12 mt-8">
{/* Cabeçalho */}
<View className="mb-4">
<Text className="text-xl font-bold text-black">As Minhas Conquistas</Text>
</View>

{/* Icon exclusivo */}
<View className="bg-white rounded-lg border border-light-gray p-4 items-center mb-4">
<Achievements
text="Adeus Instagram"
description="Desinstalar o Instagram"
icon={TrophyRed}
/>
</View>

<View className="bg-white rounded-lg border border-light-gray p-4 items-center mb-4">
<Achievements
text="Adeus Instagram"
description="Desinstalar o Instagram"
icon={TrophyRed}
/>
</View>

<View className="bg-white rounded-lg border border-light-gray p-4 items-center mb-4">
<Achievements
text="Adeus Instagram"
description="Desinstalar o Instagram"
icon={TrophyRed}
/>
</View>
</TouchableOpacity>

{/* Informação de contactos */}
<TouchableOpacity className="bg-white rounded-lg w-11/12 mt-8 border border-light-gray p-4 items-center">
<HelpContactsIcon width={100} height={100} />
<Text className="text-md font-bold my-2">Existem 96 profissionais de saúde à tua disposição. Não hesites em contacta-los.</Text>
</TouchableOpacity>
{/* Ver todas */}
<TouchableOpacity onPress={() => console.log("Ver todas as conquistas clicado")}>
<View className="mb-4 flex-row justify-end">
<Text className="text-md font-bold text-orange">VER TODAS</Text>
</View>
</TouchableOpacity>
</View>

</View>
</View>
Expand Down
Loading