From 1ec1cd167df492dea4e2020405e02f1ebde98eb1 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 13 Jan 2022 09:59:14 -0300 Subject: [PATCH] =?UTF-8?q?Preparando=20revis=C3=A3o=20de=20c=C3=B3digo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 46 ------ public/index.html | 12 -- src/Providers/auth.js | 25 ---- src/assets/logo.png | Bin 8123 -> 0 bytes src/assets/logoHeader.png | Bin 1607 -> 0 bytes src/components/BildHabit/index.js | 82 ----------- src/components/BildHabit/style.js | 62 -------- src/components/Button/index.js | 17 --- src/components/Confirm/index.js | 97 ------------- src/components/DayHistoric/index.js | 27 ---- src/components/Habit/index.js | 45 ------ src/components/Habit/style.js | 32 ----- src/components/Header/index.js | 19 --- src/components/Header/style.js | 42 ------ src/components/Menu/index.js | 35 ----- src/components/Menu/style.js | 48 ------- src/components/Message-PageEmpty/index.js | 13 -- src/components/Navbar/index.js | 33 ----- src/components/Navbar/style.js | 83 ----------- src/components/PageHabits/index.js | 61 -------- src/components/PageHabits/style.js | 31 ---- src/components/PageHistory/index.js | 132 ----------------- src/components/PageHistory/style.js | 165 ---------------------- src/components/PageLogin/index.js | 79 ----------- src/components/PageLogin/style.js | 59 -------- src/components/PageRegister/index.js | 64 --------- src/components/PageRegister/style.js | 59 -------- src/components/PageToday/index.js | 73 ---------- src/components/PageToday/style.js | 31 ---- src/components/Task/index.js | 46 ------ src/components/Task/style.js | 57 -------- src/components/Title/index.js | 34 ----- src/components/WeekDay/index.js | 33 ----- src/index.js | 37 ----- src/reset.css | 47 ------ src/style.css | 22 --- 36 files changed, 1748 deletions(-) delete mode 100644 package.json delete mode 100644 public/index.html delete mode 100644 src/Providers/auth.js delete mode 100644 src/assets/logo.png delete mode 100644 src/assets/logoHeader.png delete mode 100644 src/components/BildHabit/index.js delete mode 100644 src/components/BildHabit/style.js delete mode 100644 src/components/Button/index.js delete mode 100644 src/components/Confirm/index.js delete mode 100644 src/components/DayHistoric/index.js delete mode 100644 src/components/Habit/index.js delete mode 100644 src/components/Habit/style.js delete mode 100644 src/components/Header/index.js delete mode 100644 src/components/Header/style.js delete mode 100644 src/components/Menu/index.js delete mode 100644 src/components/Menu/style.js delete mode 100644 src/components/Message-PageEmpty/index.js delete mode 100644 src/components/Navbar/index.js delete mode 100644 src/components/Navbar/style.js delete mode 100644 src/components/PageHabits/index.js delete mode 100644 src/components/PageHabits/style.js delete mode 100644 src/components/PageHistory/index.js delete mode 100644 src/components/PageHistory/style.js delete mode 100644 src/components/PageLogin/index.js delete mode 100644 src/components/PageLogin/style.js delete mode 100644 src/components/PageRegister/index.js delete mode 100644 src/components/PageRegister/style.js delete mode 100644 src/components/PageToday/index.js delete mode 100644 src/components/PageToday/style.js delete mode 100644 src/components/Task/index.js delete mode 100644 src/components/Task/style.js delete mode 100644 src/components/Title/index.js delete mode 100644 src/components/WeekDay/index.js delete mode 100644 src/index.js delete mode 100644 src/reset.css delete mode 100644 src/style.css diff --git a/package.json b/package.json deleted file mode 100644 index cb8a7ae..0000000 --- a/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "projeto_10_tracklt", - "version": "0.1.0", - "private": true, - "dependencies": { - "add": "^2.0.6", - "axios": "^0.24.0", - "dayjs": "^1.10.7", - "or": "^0.2.0", - "react": "^17.0.2", - "react-calendar": "^3.5.0", - "react-circular-progressbar": "^2.0.4", - "react-confirm-alert": "^2.7.0", - "react-dom": "^17.0.2", - "react-ionicons": "^4.2.0", - "react-loader-spinner": "^4.0.0", - "react-router-dom": "^6.2.1", - "react-scripts": "^4.0.3", - "react-toastify": "^8.1.0", - "styled-components": "^5.3.3", - "yarn": "^1.22.17" - }, - "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject" - }, - "eslintConfig": { - "extends": [ - "react-app" - ] - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - } -} diff --git a/public/index.html b/public/index.html deleted file mode 100644 index 664bd71..0000000 --- a/public/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - Track-it - - - -
- - diff --git a/src/Providers/auth.js b/src/Providers/auth.js deleted file mode 100644 index b6f0d47..0000000 --- a/src/Providers/auth.js +++ /dev/null @@ -1,25 +0,0 @@ -import React, { useEffect, useState } from 'react'; - -export const AuthContext = React.createContext({}); - -export const AuthProvider = (props) => { - const [user, setUser] = useState(null); - const [progress, setProgress] = useState(null); - const [navbar, setNavbar] = useState(false); - - useEffect(() => { - if (localStorage.getItem('userLogged')) { - let person = localStorage.getItem('userLogged'); - person = JSON.parse(person); - setUser(person); - } - }, []) - - return ( - - {props.children} - - ) -} - -export const useAuth = () => React.useContext(AuthContext); \ No newline at end of file diff --git a/src/assets/logo.png b/src/assets/logo.png deleted file mode 100644 index 791c6fb26807858759eb0546f68e1f4c51f62779..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8123 zcma)BRZtv2kj33Ya7}QB#oaBqyE`ldm&Jm++v2)da0#$zZ~_|=Y=Phq+%-XR+aL!y={Ga+S{h2YSQJhN`f;wYmogMiSIiv47bihw|?r6Mn*7l3$Lq@F}I z?i+5Ye~uTZyiMqfLH2F-A_D=_s)0aQ#)_H30%=wH>slnTQss;>ohm~kLWaoRnE9Z{ z`Oi(Agy2mM2Axhq>D@^zf^ha>MLga?efRFX_so2R$lED+8Z||yb-jk>5_5C93+8~e zJ~6;&d^&&szy3XzeL=UObz}jMgqf1yQ%N2tS?wrs(5>diMszhX9?f^EZPZmjZotsp zG^0hcgm*lt+jq174dMtN2dDl!@>mjybk!oDx8Avy3U;Ly&)yQ~bmY2>I0b*`wF3Pn z;)WM@k6{0ID5Lwz*5l>oc-PilTDuG0^_ThFe-O|%Z5XaN<-mFy5!)R3?>~V6-I4!q zEdN8q)45iFgNSitZzj0mz*EIrlX6+rZsg+X{B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on&(@AwESM*=QbW-LSA~y|A(bbsrc*10ni*QZt zG9azee+UkR@@w`*!jEexy)}pP85sU;VS_`IK5~&=!gSIeKtFXaVSY^!^l;oDbffd+ zmCeeegW*z6g!5DT$9V##>zFp@A4Rt;{g(W&0dZ!^1w^ATyS9-&4a6xp`XzyBnXEp7 z*+wvZ#HL3Ycnj$}IjiV$Fgbpk!B&L<;Z(FP2SG79T&R5Z6EU2ZhCp(+wpB2@jJ}TE zA>)kixons(!mVPzi`XXhb`oIXeykLE=#$1=LZHvkvjdXSkJo6FQ7Z;Yj8)`>njHqP zis)M<9Eq|+&F9$>%O { - setCreatingHabit(false); - setDaysSelected([]); - setLoading(false); - window.location.reload(); - }) - promise.catch(err => setLoading(false)) - } - - return ( - -
- setHabit(e.target.value)} value={habit} /> - - - {daysOfWeek.map((day, index) => { - const number = daysOfWeekNumber[index]; - daysSelected.includes(number) ? selected = true : selected = false; - - return - })} - -
- - - Cancelar - - - {loading ? : 'Salvar'} - - - -
- ) -} \ No newline at end of file diff --git a/src/components/BildHabit/style.js b/src/components/BildHabit/style.js deleted file mode 100644 index 40369a4..0000000 --- a/src/components/BildHabit/style.js +++ /dev/null @@ -1,62 +0,0 @@ -import styled from "styled-components"; - -export const Container = styled.div` -height: 180px; -padding: 18px; -margin: 0 18px 30px; - -background-color: #fff; -border-radius: 5px; - -display: flex; -flex-direction: column; -justify-content: space-between; - -input{ - width: 100%; - height: 45px; - border-radius: 5px; -} -` - -export const Days = styled.div` -display: flex; -gap: 8px; -` - -export const Botoes = styled.div` -display: flex; -justify-content: end; -align-items: center; -gap: 20px; -` - -export const Cancel = styled.div` -font-size: 15.976px; -line-height: 20px; -color: #52B6FF; -text-align: center; -${props => props.loading && 'opacity: 0.5;'} - -&:hover{ - cursor: pointer; -} -` - -export const Save = styled.div` -width: 84px; -height: 35px; - -background: #52B6FF; -color: #fff; -border-radius: 4.63636px; -${props => props.loading && 'opacity: 0.5;'} - -display: flex; -justify-content: center; -align-items: center; - -&:hover{ - cursor: pointer; -} -` \ No newline at end of file diff --git a/src/components/Button/index.js b/src/components/Button/index.js deleted file mode 100644 index 894a480..0000000 --- a/src/components/Button/index.js +++ /dev/null @@ -1,17 +0,0 @@ -import { Link } from 'react-router-dom'; -import styled from 'styled-components'; - -export default function Button({ text, type, destiny, action, loading }) { - - return ( - - - {text} - - - ) -} - -const Container = styled.button` - text-align: center; -` \ No newline at end of file diff --git a/src/components/Confirm/index.js b/src/components/Confirm/index.js deleted file mode 100644 index 5c658bb..0000000 --- a/src/components/Confirm/index.js +++ /dev/null @@ -1,97 +0,0 @@ -import styled from "styled-components"; - - -export default function Confirm({ setConfirmShow, id, removeHabit }) { - - return ( - <> - - -

Deseja realmente excluir este hábito?

- - setConfirmShow(false)} >Cancelar - removeHabit(id)} >Excluir - -
- - ); -} - -const Background = styled.div` -width: 100vw; -height: 100vh; - -background: #fff; -opacity: 0.5; - -display: flex; -flex-direction: column; -justify-content: center; -align-items: center; - -position: fixed; -top: 0; -left: 0; -z-index: 500; -` - -const Box = styled.div` -max-width: 350px; -width: 100vw; -height: 200px; -background-color: #52B6FF; -border-radius: 10px; - -display: flex; -gap: 50px; -flex-direction: column; -justify-content: center; -align-items: center; - -position: fixed; -z-index: 501; -top: 0; -bottom: 0; -left: 0; -right: 0; -margin: auto; - -h1 { -font-size: 20px; -color: #fff; -text-align: center; -} -` - -const Buttons = styled.div` -font-weight: 700; -font-size: 16px; -display: flex; -align-items: center; -gap: 35px; -` - -const Remove = styled.div` -width: 80px; -height: 40px; - -background: #fff; -border-radius: 5px; -color: #52B6FF; - -display: flex; -justify-content: center; -align-items: center; - -&:hover{ - cursor: pointer; -} -` - -const Cancel = styled.div` -color: #fff; - -&:hover{ - cursor: pointer; -} -` \ No newline at end of file diff --git a/src/components/DayHistoric/index.js b/src/components/DayHistoric/index.js deleted file mode 100644 index a530371..0000000 --- a/src/components/DayHistoric/index.js +++ /dev/null @@ -1,27 +0,0 @@ -import styled from "styled-components"; -import { CheckmarkOutline, CloseOutline } from 'react-ionicons' - - -export default function Day({ habit }) { - - return ( - - {habit.name} - {habit.done ? : } - - ) -} - -const Conatiner = styled.div` -width: 100%; -height: 60px; -padding: 20px; - -background-color: #EA5766; -${props => props.finished && 'background: #8CC654;'} -border-radius: 10px; - -display: flex; -justify-content: space-between; -align-items: center; -` diff --git a/src/components/Habit/index.js b/src/components/Habit/index.js deleted file mode 100644 index 822efc8..0000000 --- a/src/components/Habit/index.js +++ /dev/null @@ -1,45 +0,0 @@ -import { Container, Days, Icon } from './style'; -import WeekDay from '../WeekDay'; -import { TrashOutline } from 'react-ionicons'; -import { useAuth } from '../../Providers/auth'; -import axios from 'axios'; -import Confirm from '../Confirm'; -import { useState } from 'react'; - -export default function Habit({ habit }) { - - const DaysOfWeek = ['D', 'S', 'T', 'Q', 'Q', 'S', 'S']; - const daysOfWeekNumber = [7, 1, 2, 3, 4, 5, 6]; - const { user } = useAuth(); - const [confirmShow, setConfirmShow] = useState(false); - - function removeHabit(id) { - const promise = axios.delete(`https://mock-api.bootcamp.respondeai.com.br/api/v2/trackit/habits/${id}`, - { headers: { 'Authorization': `Bearer ${user.token}` } } - ) - promise.then(() => window.location.reload()) - } - - return ( - - {confirmShow && } - setConfirmShow(true)}> - - - - {habit.name} - - - {DaysOfWeek.map((day, index) => { - let selected; - habit.days.includes(daysOfWeekNumber[index]) ? selected = true : selected = false; - - return - })} - - - ) -} \ No newline at end of file diff --git a/src/components/Habit/style.js b/src/components/Habit/style.js deleted file mode 100644 index d3819ea..0000000 --- a/src/components/Habit/style.js +++ /dev/null @@ -1,32 +0,0 @@ -import styled from "styled-components"; - - -export const Container = styled.div` -height: 91px; -margin: 8px 20px; -padding: 15px; - -background: #FFFFFF; -border-radius: 5px; - -position: relative; -display: flex; -flex-direction: column; -justify-content: center; -` -export const Days = styled.div` -display: flex; -gap: 8px; -` - -export const Icon = styled.div` -width: 13px; - -position: absolute; -top: 7px; -right: 10px; - -&:hover{ - cursor: pointer; -} -` diff --git a/src/components/Header/index.js b/src/components/Header/index.js deleted file mode 100644 index 09c74d7..0000000 --- a/src/components/Header/index.js +++ /dev/null @@ -1,19 +0,0 @@ -import logoHeader from '../../assets/logoHeader.png'; -import { useAuth } from '../../Providers/auth'; -import { Container } from './style'; - -export default function Header() { - - const { user, setNavbar } = useAuth(); - - return ( - user !== null && ( - - Logo app -
- Imagem usuário setNavbar(true)} /> -
- - ) - ) -} diff --git a/src/components/Header/style.js b/src/components/Header/style.js deleted file mode 100644 index bd4cfa2..0000000 --- a/src/components/Header/style.js +++ /dev/null @@ -1,42 +0,0 @@ -import styled from 'styled-components'; - -const Container = styled.div` - width: 100vw; - height: 70px; - - padding: 0px 20px; - background-color: #126BA5; - box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.15); - - display: flex; - justify-content: space-between; - align-items: center; - - position: fixed; - top: 0; - left: 0; - z-index: 10; - - img { - height: 40px; - } - - .userImage { - width: 40px; - height: 40px; - - border-radius: 50%; - - display: flex; - justify-content: center; - align-items: center; - overflow: hidden; - - img { - width: 100%; - height: 100%; - } - } -` - -export { Container } diff --git a/src/components/Menu/index.js b/src/components/Menu/index.js deleted file mode 100644 index edd7673..0000000 --- a/src/components/Menu/index.js +++ /dev/null @@ -1,35 +0,0 @@ -import { Link } from 'react-router-dom'; -import { Container, Button } from './style'; -import { useAuth } from '../../Providers/auth'; -import { CircularProgressbar, buildStyles } from "react-circular-progressbar"; -import "react-circular-progressbar/dist/styles.css"; - -export default function Menu() { - - const { progress } = useAuth(); - - return ( - <> - - Hábitos - Histórico - - - - - - ) -} - - diff --git a/src/components/Menu/style.js b/src/components/Menu/style.js deleted file mode 100644 index dd8f79e..0000000 --- a/src/components/Menu/style.js +++ /dev/null @@ -1,48 +0,0 @@ -import { Link } from "react-router-dom"; -import styled from "styled-components"; - - -export const Container = styled.div` -width: 100vw; -height: 70px; - -background: #fff; -font-size: 17.976px; -line-height: 22px; - -display: flex; -align-items: center; -justify-content: space-between; -padding: 0px 10vw; - -position: fixed; -bottom: 0; -left: 0; -index: 10; - -a{ - color: #52B6FF; - &:hover{ - cursor: pointer; - } -} -` - -export const Button = styled(Link)` -width: 91px; -height: 91px; -padding: 5px; - -background: #52B6FF; -border-radius: 50%; - -position: absolute; -bottom: 10px; -left: 0; -right: 0; -margin: auto; - -display: flex; -justify-content: center; -align-items: center; -` diff --git a/src/components/Message-PageEmpty/index.js b/src/components/Message-PageEmpty/index.js deleted file mode 100644 index fd9e1e6..0000000 --- a/src/components/Message-PageEmpty/index.js +++ /dev/null @@ -1,13 +0,0 @@ -import styled from "styled-components" - -export default function Menssage({ text }) { - return {text} -} - -const Text = styled.div` -padding: 0px 5%; -font-size: 17.976px; -line-height: 22px; - -color: #666666; -` \ No newline at end of file diff --git a/src/components/Navbar/index.js b/src/components/Navbar/index.js deleted file mode 100644 index e426efd..0000000 --- a/src/components/Navbar/index.js +++ /dev/null @@ -1,33 +0,0 @@ -import { Container, Content, Background, Exit, Footer, Text, Top } from './style'; -import logo from '../../assets/logo.png'; -import { useAuth } from '../../Providers/auth'; -import { useNavigate } from 'react-router-dom'; - -export default function Navbar() { - - const navigate = useNavigate(); - const { user, setNavbar } = useAuth(); - - function exitApp() { - setNavbar(false); - navigate('/'); - localStorage.clear(); - window.location.reload(); - } - - return ( - - - - {'Logo - {user && Obrigado pela
preferência, {user.name}! :)
} -
-
- {user && {'Imagem} - Sair -
-
- setNavbar(false)} /> -
- ) -} \ No newline at end of file diff --git a/src/components/Navbar/style.js b/src/components/Navbar/style.js deleted file mode 100644 index 67fbbac..0000000 --- a/src/components/Navbar/style.js +++ /dev/null @@ -1,83 +0,0 @@ -import styled from 'styled-components'; - -export const Container = styled.div` -width: 100vw; -height: 100vh; - -display: flex; - -position: fixed; -top: 0; -left: 0; -z-index: 20; -` - -export const Content = styled.div` -width: 65vw; -height: 100vh; -padding: 30px 8px; - -background: #fff; -box-shadow: 0 0 1em #666666; - -display: flex; -flex-direction: column; -align-items: center; -justify-content: space-between; - -img{ - width: 60%; -} -` - -export const Background = styled.div` -width: 35vw; -height: 100vh; - -background: #666666; -opacity: 0.5; -` - -export const Exit = styled.button` -width: 90px; -height: 40px; - -background: #52B6FF; -border-radius: 5px; -color: #fff; -font-size: 23px; - -&:hover{ - cursor: pointer; -} -` - -export const Text = styled.span` - -` - -export const Footer = styled.div` -display: flex; -gap: 30px; -flex-direction: column; -align-items: center; - -img{ - width: 100px; - height: 100px; - border-radius: 50%; - - box-shadow: 0 0 0.5em #666666; -} -` - -export const Top = styled.div` -color: #666666; -line-height: 1.15; - -display: flex; -gap: 20px; -flex-direction: column; -align-items: center; -text-align: center; -` \ No newline at end of file diff --git a/src/components/PageHabits/index.js b/src/components/PageHabits/index.js deleted file mode 100644 index d9f08cb..0000000 --- a/src/components/PageHabits/index.js +++ /dev/null @@ -1,61 +0,0 @@ -import Header from "../Header"; -import Menu from "../Menu"; -import Title from "../Title"; -import Habit from "../Habit"; -import BildHabit from "../BildHabit"; -import { Container, Top, CreateHabit } from './style'; -import { AddOutline } from 'react-ionicons'; -import { useEffect, useState } from "react"; -import Menssage from "../Message-PageEmpty"; -import axios from "axios"; -import { useAuth } from "../../Providers/auth"; - - -export default function PageHabits() { - - const [creatingHabit, setCreatingHabit] = useState(false); - const [message, setMessage] = useState(true); - const [habits, setHabits] = useState([]); - const { user } = useAuth(); - - useEffect(() => { - if (user !== null) { - const promise = axios.get('https://mock-api.bootcamp.respondeai.com.br/api/v2/trackit/habits', - { headers: { 'Authorization': `Bearer ${user.token}` } } - ); - promise.then(response => { - setHabits(response.data); - response.data.length > 0 && setMessage(false); - }) - } - }, [user]) - - function showBildHabit() { - setCreatingHabit(true); - } - - return ( - -
- - - <CreateHabit onClick={showBildHabit}> - <AddOutline - color='#fff' - width="25px" - /> - </CreateHabit> - </Top> - - {creatingHabit && <BildHabit setCreatingHabit={setCreatingHabit} />} - {(message && habits.length === 0) && <Menssage text={"Você não tem nenhum hábito cadastrado ainda. Adicione um hábito para começar a trackear!"} />} - {(habits && !creatingHabit) && ( - habits.map((habit) => { - return <Habit key={habit.id} habit={habit} /> - }) - )} - - <Menu /> - </Container> - ) -} diff --git a/src/components/PageHabits/style.js b/src/components/PageHabits/style.js deleted file mode 100644 index 7694e40..0000000 --- a/src/components/PageHabits/style.js +++ /dev/null @@ -1,31 +0,0 @@ -import styled from "styled-components"; - - -export const Container = styled.div` -min-height: 100vh; -padding: 70px 0; -background-color: #e5e5e5; -` - -export const Top = styled.div` -padding-right: 20px; -display: flex; -justify-content: space-between; -align-items: center; -` - -export const CreateHabit = styled.div` -width: 40px; -height: 35px; - -background: #52B6FF; -border-radius: 4.63636px; - -display: flex; -justify-content: center; -align-items: center; - -&:hover{ - cursor: pointer; -} -` \ No newline at end of file diff --git a/src/components/PageHistory/index.js b/src/components/PageHistory/index.js deleted file mode 100644 index 284ce2b..0000000 --- a/src/components/PageHistory/index.js +++ /dev/null @@ -1,132 +0,0 @@ -import axios from "axios"; -import dayjs from "dayjs"; -import { useEffect, useState } from "react"; -import { Calendar } from "react-calendar"; -import 'react-calendar/dist/Calendar.css'; -import { useAuth } from "../../Providers/auth"; -import Header from "../Header"; -import Menu from "../Menu"; -import Title from "../Title"; -import Day from "../DayHistoric"; -import { Container, ContainerCalendar, ContainerDays, DateSelected, styleCalendar } from './style'; - - -export default function PageHistory() { - - const [date, setDate] = useState(new Date()); - const { user } = useAuth(); - const [dateHabits, setDateHabits] = useState([]); - const [habitsHistoric, setHabitsHistoric] = useState([]); - const [allDates, setAllDates] = useState([]); - const formatDay = ("0" + date.getDate()).slice(-2) + "/" + ("0" + (date.getMonth() + 1)).slice(-2) + "/" + date.getFullYear(); - - - useEffect(() => { - if (user) { - const promise = axios.get('https://mock-api.bootcamp.respondeai.com.br/api/v2/trackit/habits/history/daily', - { headers: { 'Authorization': `Bearer ${user.token}` } } - ); - promise.then(response => { - console.log(response); - setHabitsHistoric(response.data); - let dateArray = []; - let dates = []; - - response.data.forEach(data => { - data.habits.forEach(habit => { - convertDate(habit.date).dateFormat3 !== dayjs().format('DD/MM/YYYY') && dates.push(convertDate(habit.date).dateFormat3); - let className = verificationHabits(habit); - if (convertDate(habit.date).dateFormat3 !== dayjs().format('DD/MM/YYYY')) { - dateArray.push({ - date: habit.date, - style: className - }); - } - }) - }) - setAllDates(dates); - setDateHabits(dateArray); - }); - } - }, [user]); - - function verificationHabits(habit) { - let name; - let fails = []; - - if (habit.done && !fails.includes(habit.date)) { - name = 'styleDay-green'; - } else { - fails.push(habit.date); - name = 'styleDay-red'; - } - return name; - } - - const onChange = date => { - setDate(date); - }; - - function setClass(date) { - if (dateHabits) { - const dateobj = dateHabits.find((x) => { - return ( - date.getDay() === new Date(x.date).getDay() && - date.getMonth() === new Date(x.date).getMonth() && - date.getDate() === new Date(x.date).getDate() - ); - }); - return dateobj ? dateobj.style : ""; - } - } - - function convertDate(date) { - var date = date.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})/); - if (date == null) { - return false; - } else { - var dateObj = { - dateFormat1: date[3] + '.' + date[2] + '.' + date[1], - dateFormat2: date[1] + '-' + date[2] + '-' + date[3], - dateFormat3: date[3] + '/' + date[2] + '/' + date[1], - time: date[4] + ':' + date[5] + ':' + date[6], - }; - return dateObj; - } - }; - - return ( - <Container> - <Header /> - <Title text={'Histórico'} /> - - <ContainerCalendar> - <Calendar - className={styleCalendar} - value={date} - locale="pt-Br" - onChange={onChange} - formatDay={(locale, date) => dayjs(date).format("DD")} - tileClassName={({ activeStartDate, date, view }) => setClass(date)} - /> - </ContainerCalendar> - - {allDates.includes(formatDay) && ( - <ContainerDays> - <DateSelected>{formatDay}</DateSelected> - {habitsHistoric.map(data => { - if (data.day === formatDay) { - // return day.habits.forEach(() => <Day />) - let habits = []; - data.habits.forEach((habit, index) => { - habits.push(<Day key={index} habit={habit} />); - }); - return habits; - } - })} - </ContainerDays> - )} - <Menu /> - </Container> - ) -} \ No newline at end of file diff --git a/src/components/PageHistory/style.js b/src/components/PageHistory/style.js deleted file mode 100644 index b706af8..0000000 --- a/src/components/PageHistory/style.js +++ /dev/null @@ -1,165 +0,0 @@ -import styled from "styled-components"; - -export const Container = styled.div` -min-height: 100vh; -padding: 70px 0; -background: #E5E5E5; - -display: flex; -flex-direction: column; -align-items: center; - -.styleDay-green { - padding: 2px; - color: black; - background-color: #8CC654; - border-radius: 50%; -} - -.styleDay-red { - padding: 2px; - color: black; - background-color: #EA5766; - border-radius: 50%; -} -` - -export const ContainerCalendar = styled.div` -width: 100vw; -max-width: 500px; -padding: 20px; - -display: flex; -flex-direction: column; -justify-content: center; -align-items: center; -box-sizing: border-box; -` - -export const ContainerDays = styled.div` -width: 100%; -padding: 20px; - -display: flex; -flex-direction: column; -gap: 20px; -` - -export const DateSelected = styled.div` - padding-left: 20px; -` - -export const styleCalendar = styled.div` -.react-calendar { - max-width: 90vw; - background: #fff; - border-radius: 10px; - font-family: Arial, Helvetica, sans-serif; - line-height: 1.125em; -} -.react-calendar--doubleView { - width: 700px; -} -.react-calendar--doubleView .react-calendar__viewContainer { - display: flex; - margin: -0.5em; -} -.react-calendar--doubleView .react-calendar__viewContainer > * { - width: 50%; - margin: 0.5em; -} -.react-calendar, -.react-calendar *, -.react-calendar *:before, -.react-calendar *:after { - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} -.react-calendar button { - margin: 0; - border: 0; - outline: none; -} -.react-calendar button:enabled:hover { - cursor: pointer; -} -.react-calendar__navigation { - display: flex; - height: 44px; - margin-bottom: 1em; -} -.react-calendar__navigation button { - min-width: 44px; - background: none; -} -.react-calendar__navigation button:enabled:hover, -.react-calendar__navigation button:enabled:focus { - background-color: #e6e6e6; -} -.react-calendar__navigation button[disabled] { - background-color: #f0f0f0; -} -.react-calendar__month-view__weekdays { - text-align: center; - text-transform: uppercase; - font-weight: bold; - font-size: 0.75em; -} -.react-calendar__month-view__weekdays__weekday { - padding: 0.5em; -} -.react-calendar__month-view__weekNumbers .react-calendar__tile { - display: flex; - align-items: center; - justify-content: center; - font-size: 0.75em; - font-weight: bold; - padding: calc(0.75em / 0.75) calc(0.5em / 0.75); -} -.react-calendar__month-view__days__day--weekend { - height: 50px; - color: #d10000; -} -.react-calendar__month-view__days__day--neighboringMonth { - height: 50px; - color: #757575; -} -.react-calendar__year-view .react-calendar__tile, -.react-calendar__decade-view .react-calendar__tile, -.react-calendar__century-view .react-calendar__tile { - padding: 2em 0.5em; -} -.react-calendar__tile { - max-width: 100%; - text-align: center; - padding: 0.75em 0.5em; - background: none; -} -.react-calendar__tile:disabled { - background-color: #f0f0f0; -} -.react-calendar__tile:enabled:hover, -.react-calendar__tile:enabled:focus { - background-color: #e6e6e6; - border-radius: 50%; -} -.react-calendar__tile--now { - background: #ffff76; -} -.react-calendar__tile--now:enabled:hover, -.react-calendar__tile--now:enabled:focus { - background: #ffffa9; -} -.react-calendar__tile--hasActive { - background: #76baff; -} -.react-calendar__tile--hasActive:enabled:hover, -.react-calendar__tile--hasActive:enabled:focus { - background: #a9d4ff; -} - -.react-calendar--selectRange .react-calendar__tile--hover { - background-color: #e6e6e6; -} -` diff --git a/src/components/PageLogin/index.js b/src/components/PageLogin/index.js deleted file mode 100644 index e6c0b86..0000000 --- a/src/components/PageLogin/index.js +++ /dev/null @@ -1,79 +0,0 @@ -import { useNavigate } from "react-router-dom"; -import { useState } from 'react'; -import { useAuth } from "../../Providers/auth"; -import axios from "axios"; -import Button from "../Button"; -import Loader from "react-loader-spinner"; -import logo from '../../assets/logo.png'; - -import { ToastContainer, toast } from 'react-toastify'; -import "react-toastify/dist/ReactToastify.css"; -import { Container } from "./style"; - - -export default function PageLogin() { - - const navigate = useNavigate(); - const [loading, setLoading] = useState(false); - const { user, setUser } = useAuth(); - - if (user !== null) { - navigate('/hoje'); - } - - const [userLogin, setUserLogin] = useState({ - email: '', - password: '' - }); - - function login(e) { - e.preventDefault(); - setLoading(true); - - const promise = axios.post('https://mock-api.bootcamp.respondeai.com.br/api/v2/trackit/auth/login', { ...userLogin }); - promise.then(response => { - //navigate('/hoje'); - setLoading(false); - setUser(response.data); - - const person = { - id: response.data.id, - name: response.data.name, - email: response.data.email, - image: response.data.image, - token: response.data.token - } - localStorage.setItem('userLogged', JSON.stringify(person)); - - }); - promise.catch(err => { - setLoading(false); - toast.error('E-mail ou senha inválidos!'); - }); - } - - function ChangeInput(e) { - setUserLogin({ ...userLogin, [e.target.name]: e.target.value }); - } - - return ( - <Container> - <img src={logo} alt="Logo App" /> - - <form> - <input type="email" placeholder="E-mail" value={userLogin.email} name="email" onChange={ChangeInput} /> - <input type="password" placeholder='Senha' value={userLogin.password} name="password" onChange={ChangeInput} /> - - {loading === false ? ( - <Button type={'submit'} text={'Entrar'} destiny={''} action={login} /> - ) : ( - <Loader type="ThreeDots" color="#52B6FF" height={100} width={100} /> - )} - </form> - - <Button loading={loading} type={'button'} text={'Não tem uma conta? cadastre-se!'} destiny={'/cadastro'} /> - <ToastContainer limit={1} /> - </ Container> - ) -} - diff --git a/src/components/PageLogin/style.js b/src/components/PageLogin/style.js deleted file mode 100644 index c4ae37b..0000000 --- a/src/components/PageLogin/style.js +++ /dev/null @@ -1,59 +0,0 @@ -import styled from 'styled-components'; - -const Container = styled.div` - height: 100vh; - - align-items: center; - justify-content: center; - gap: 20px; - - display: flex; - flex-direction: column; - - form { - width: 100%; - - align-items: center; - gap: 6px; - - display: flex; - flex-direction: column; - - button { - background-color: #52B6FF; - color: #FFFFFF; - font-size: 20.976px; - line-height: 26px; - text-decoration-line: none; - &:hover { - cursor: pointer; - } - } - - a { - width: 90%; - } - } - - button, input { - min-width: 90%; - height: 40px; - border-radius: 5px; - } - - button { - width: 100%; - background-color: #ffffff; - color: #52B6FF; - font-size: 13.976px; - line-height: 17px; - text-decoration-line: underline; - span { - &:hover{ - cursor: pointer; - } - } - } -` - -export { Container } \ No newline at end of file diff --git a/src/components/PageRegister/index.js b/src/components/PageRegister/index.js deleted file mode 100644 index 25a4ffb..0000000 --- a/src/components/PageRegister/index.js +++ /dev/null @@ -1,64 +0,0 @@ -import { Container } from "./style"; -import axios from 'axios'; -import Button from "../Button"; -import { useState } from "react"; -import { useNavigate } from "react-router-dom"; -import Loader from "react-loader-spinner"; -import logo from '../../assets/logo.png'; -import { ToastContainer, toast } from 'react-toastify'; -import "react-toastify/dist/ReactToastify.css"; - - -export default function PageRegister() { - - const navigate = useNavigate(); - const [loading, setLoading] = useState(false); - const [userRegister, setUserRegister] = useState({ - email: '', - name: '', - image: '', - password: '' - }); - - function register(e) { - e.preventDefault(); - setLoading(true); - - const promise = axios.post('https://mock-api.bootcamp.respondeai.com.br/api/v2/trackit/auth/sign-up', { ...userRegister }); - promise.then(response => { - navigate('/'); - setLoading(false); - }); - promise.catch(err => { - console.log(err); - setLoading(false); - toast.error('E-mail ou senha inválidos!'); - }); - } - - function ChangeInput(e) { - setUserRegister({ ...userRegister, [e.target.name]: e.target.value }) - } - - return ( - <Container> - <img src={logo} alt="Logo App" /> - <ToastContainer position="top-right" /> - - <form> - <input type="email" placeholder="E-mail" value={userRegister.email} name="email" onChange={ChangeInput} /> - <input type="password" placeholder='Senha' value={userRegister.password} name="password" onChange={ChangeInput} /> - <input type="text" placeholder='Nome' value={userRegister.name} name="name" onChange={ChangeInput} /> - <input type="url" placeholder="Imagem" value={userRegister.image} name="image" onChange={ChangeInput} /> - - {loading === false ? ( - <Button type={'submit'} text={'Cadastrar'} destiny={''} action={register} /> - ) : ( - <Loader type="ThreeDots" color="#52B6FF" height={100} width={100} /> - )} - </form> - - <Button loading={loading} type="button" text={'Já tem uma conta? Faça login'} destiny={'/'} /> - </ Container> - ) -} \ No newline at end of file diff --git a/src/components/PageRegister/style.js b/src/components/PageRegister/style.js deleted file mode 100644 index ac150cc..0000000 --- a/src/components/PageRegister/style.js +++ /dev/null @@ -1,59 +0,0 @@ -import styled from 'styled-components'; - -const Container = styled.div` - height: 100vh; - - align-items: center; - justify-content: center; - gap: 20px; - - display: flex; - flex-direction: column; - - form { - width: 100%; - - align-items: center; - gap: 6px; - - display: flex; - flex-direction: column; - - button { - background-color: #52B6FF; - color: #FFFFFF; - font-size: 20.976px; - line-height: 26px; - text-decoration-line: none; - &:hover { - cursor: pointer; - } - } - - a { - width: 90%; - } - } - - button, input { - min-width: 90%; - height: 40px; - border-radius: 5px; - } - - button { - width: 100%; - background-color: #ffffff; - color: #52B6FF; - font-size: 13.976px; - line-height: 17px; - text-decoration-line: underline; - span { - &:hover{ - cursor: pointer; - } - } - } -` - -export { Container } \ No newline at end of file diff --git a/src/components/PageToday/index.js b/src/components/PageToday/index.js deleted file mode 100644 index 41a92c6..0000000 --- a/src/components/PageToday/index.js +++ /dev/null @@ -1,73 +0,0 @@ -import Header from "../Header"; -import Menu from "../Menu"; -import Title from "../Title"; -import Task from "../Task"; -import { Container, Tasks, LoaderConatiner } from "./style"; -import dayjs from "dayjs"; -import { useEffect, useState } from "react"; -import { useAuth } from "../../Providers/auth"; -import axios from "axios"; -import Menssage from "../Message-PageEmpty"; -import Loader from "react-loader-spinner"; - -export default function PageToday() { - - const daysOfWeek = ['Domingo', 'Segunda-feira', 'Terça-feira', 'Quarta-feira', 'Quinta-feira', 'Sexta-feira', 'Sábado']; - const { user, setProgress } = useAuth(); - const [tasks, setTasks] = useState([]); - const [subtitle, setSubtitle] = useState('Nenhum Hábito concluido ainda!'); - const [numberFinishedTasks, setNumberFinishedTasks] = useState(0); - const [loading, setLoading] = useState(false); - - useEffect(() => { - setLoading(true); - if (user) { - const promise = axios.get('https://mock-api.bootcamp.respondeai.com.br/api/v2/trackit/habits/today', - { headers: { 'Authorization': `Bearer ${user.token}` } } - ); - promise.then(response => { - const numberHabits = response.data.length; - let finishedTasks = 0; - setTasks(response.data); - setLoading(false); - - response.data.forEach(task => { - task.done && finishedTasks++; - }) - - if (finishedTasks !== 0) { - let percentage = (finishedTasks / numberHabits) * 100; - setSubtitle(`${percentage.toFixed(0)}% dos hábitos concluídos!`); - setProgress(percentage); - setNumberFinishedTasks(finishedTasks); - }; - }) - } - }, [user, setProgress]); - - return ( - <Container> - <Header /> - <Title text={`${daysOfWeek[dayjs().day()]}, ${dayjs().format('DD/MM')}`} description={subtitle} finishedTasks={numberFinishedTasks} /> - - {tasks.length === 0 && ( - <Menssage text={"Você não tem nenhum hábito cadastrado para hoje ainda. Click em 'Hábitos' e crie um novo para começar! :)"} /> - )} - - {loading && ( - <LoaderConatiner> - <span>Carregando ...</span> - <Loader type='ThreeDots' color={'#52B6FF'} /> - </LoaderConatiner> - )} - - <Tasks> - {tasks.length !== 0 && ( - tasks.map(task => (<Task key={task.id} task={task} />)) - )} - </Tasks> - - <Menu /> - </ Container> - ) -} \ No newline at end of file diff --git a/src/components/PageToday/style.js b/src/components/PageToday/style.js deleted file mode 100644 index a422b91..0000000 --- a/src/components/PageToday/style.js +++ /dev/null @@ -1,31 +0,0 @@ -import styled from "styled-components"; - -export const Container = styled.div` - width: 100vw; - min-height: 100vh; - padding: 75px 0px; - - background: #E5E5E5; -` - -export const Tasks = styled.div` - width: 100vw; - - display: flex; - flex-direction: column; - align-items: center; - gap: 10px; -` - -export const LoaderConatiner = styled.div` -width: 100vw; -height: 300px; -color: #52B6FF; -font-size: 25px; - -display: flex; -flex-direction: column; -align-items: center; -justify-content: center; -` - diff --git a/src/components/Task/index.js b/src/components/Task/index.js deleted file mode 100644 index 3928669..0000000 --- a/src/components/Task/index.js +++ /dev/null @@ -1,46 +0,0 @@ -import axios from 'axios'; -import { CheckmarkOutline } from 'react-ionicons'; -import { useAuth } from '../../Providers/auth'; -import { Texts, Container, Checkbox, CurrentSequence, HighestSequence } from './style'; - -export default function Task({ task }) { - - const { user } = useAuth(); - - function clickCheckbox(id) { - task.done ? noFinishTask(id) : finishTask(id); - } - - function noFinishTask(id) { - const promise = axios.post(`https://mock-api.bootcamp.respondeai.com.br/api/v2/trackit/habits/${id}/uncheck`, {}, - { headers: { 'Authorization': `Bearer ${user.token}` } } - ); - promise.then(() => window.location.reload()); - } - - function finishTask(id) { - const promise = axios.post(`https://mock-api.bootcamp.respondeai.com.br/api/v2/trackit/habits/${id}/check`, {}, - { headers: { 'Authorization': `Bearer ${user.token}` } } - ); - promise.then(() => window.location.reload()); - } - - return ( - <Container> - <Texts> - <h1>{task.name}</h1> - <span>Sequência atual: <CurrentSequence task={task}>{task.currentSequence} dias</CurrentSequence></span> - <span>Seu recorde: <HighestSequence task={task}>{task.highestSequence} dias</HighestSequence></span> - </Texts> - <Checkbox task={task} onClick={() => clickCheckbox(task.id)}> - <CheckmarkOutline - color="white" - height="100%" - width="100%" - /> - </Checkbox> - </Container> - ) -} - - diff --git a/src/components/Task/style.js b/src/components/Task/style.js deleted file mode 100644 index 79e5cc7..0000000 --- a/src/components/Task/style.js +++ /dev/null @@ -1,57 +0,0 @@ -import styled from 'styled-components'; - - -export const Container = styled.div` -width: 90vw; -height: 94px; -padding: 20px; - -background: #FFFFFF; -border-radius: 5px; - -display: flex; -align-items: center; -justify-content: space-between; -` -export const Texts = styled.div` -width: 70%; -height: 100%; - -color: #666666; - -display: flex; -flex-direction: column; -justify-content: center; -gap: 7px; - -h1 { - font-size: 19.976px; - line-height: 25px; -} - -span { - font-size: 12.976px; - line-height: 16px; -} -` -export const Checkbox = styled.div` -width: 69px; -height: 69px; - -background: #EBEBEB; -${props => props.task.done && 'background: #8FC549;'} -border: 1px solid #E7E7E7; -border-radius: 5px; - -&:hover{ - cursor: pointer; -} -` - -export const CurrentSequence = styled.span` -${props => props.task.done && 'color: #8FC549'} -` - -export const HighestSequence = styled.span` -${props => (props.task.currentSequence === props.task.highestSequence && props.task.done) && 'color: #8FC549'} -` \ No newline at end of file diff --git a/src/components/Title/index.js b/src/components/Title/index.js deleted file mode 100644 index 787e8a8..0000000 --- a/src/components/Title/index.js +++ /dev/null @@ -1,34 +0,0 @@ -import styled from 'styled-components'; - -export default function Title({ text, description, finishedTasks }) { - - return ( - <Container finishedTasks={finishedTasks}> - <h1>{text}</h1> - <span>{description}</span> - </Container> - ) -} - -const Container = styled.div` - width: 100vw; - height: 100px; - padding: 0px 5%; - - display: flex; - flex-direction: column; - justify-content: center; - - h1 { - font-size: 22.976px; - line-height: 29px; - color: #126BA5; - } - - span { - font-size: 17.976px; - line-height: 22px; - color: #BABABA; - ${props => props.finishedTasks !== 0 && 'color: #8FC549;'} - } -` diff --git a/src/components/WeekDay/index.js b/src/components/WeekDay/index.js deleted file mode 100644 index 811ea50..0000000 --- a/src/components/WeekDay/index.js +++ /dev/null @@ -1,33 +0,0 @@ -import styled from "styled-components" - -export default function WeekDay({ text, number, changeDays, selected, loading }) { - - return ( - <Container onClick={() => changeDays(number)} selected={selected} disabled={loading}> - <span>{text}</span> - </Container> - ) -} - -const Container = styled.button` -width: 30px; -height: 30px; -margin-top: 10px; - -border: 1px solid #D5D5D5; -background-color: #FFFFFF; -color: #D5D5D5; -font-size: 19.976px; -line-height: 25px; -border-radius: 5px; -${props => props.selected === true && 'background-color: #cfcfcf;'} -${props => props.selected === true && 'color: white;'} - -display: flex; -justify-content: center; -align-items: center; - -&:hover{ - cursor: pointer; -} -` \ No newline at end of file diff --git a/src/index.js b/src/index.js deleted file mode 100644 index 31abf27..0000000 --- a/src/index.js +++ /dev/null @@ -1,37 +0,0 @@ -import { render } from "react-dom"; -import { BrowserRouter, Routes, Route } from "react-router-dom"; -import { AuthProvider, useAuth } from "./Providers/auth"; -import PageLogin from "./components/PageLogin"; -import PageHistory from "./components/PageHistory"; -import PageRegister from "./components/PageRegister"; -import PageHabits from "./components/PageHabits"; -import PageToday from "./components/PageToday"; -import Navbar from "./components/Navbar"; - -import './reset.css'; -import './style.css'; - -function App() { - - const { navbar } = useAuth(); - - return ( - <BrowserRouter> - {navbar && <Navbar />} - <Routes> - <Route path='/' element={<PageLogin />} /> - <Route path='/cadastro' element={<PageRegister />} /> - <Route path='/habitos' element={<PageHabits />} /> - <Route path='/hoje' element={<PageToday />} /> - <Route path='/historico' element={<PageHistory />} /> - </Routes> - </BrowserRouter> - ) -} - -render( - <AuthProvider> - <App /> - </AuthProvider>, - document.querySelector('.root') -); diff --git a/src/reset.css b/src/reset.css deleted file mode 100644 index 66ed219..0000000 --- a/src/reset.css +++ /dev/null @@ -1,47 +0,0 @@ -html, body, div, span, applet, object, iframe, -h1, h2, h3, h4, h5, h6, p, blockquote, pre, -a, abbr, acronym, address, big, cite, code, -del, dfn, em, img, ins, kbd, q, s, samp, -small, strike, strong, sub, sup, tt, var, -b, u, i, center, -dl, dt, dd, ol, ul, li, -fieldset, form, label, legend, -table, caption, tbody, tfoot, thead, tr, th, td, -article, aside, canvas, details, embed, -figure, figcaption, footer, header, hgroup, -menu, nav, output, ruby, section, summary, -time, mark, audio, video { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - font: inherit; - vertical-align: baseline; -} -/* HTML5 display-role reset for older browsers */ -article, aside, details, figcaption, figure, -footer, header, hgroup, menu, nav, section { - display: block; -} -body { - line-height: 1; -} -ol, ul { - list-style: none; -} -blockquote, q { - quotes: none; -} -blockquote:before, blockquote:after, -q:before, q:after { - content: ''; - content: none; -} -table { - border-collapse: collapse; - border-spacing: 0; -} - -button { - border: none; -} \ No newline at end of file diff --git a/src/style.css b/src/style.css deleted file mode 100644 index 2401c67..0000000 --- a/src/style.css +++ /dev/null @@ -1,22 +0,0 @@ -@import url('https://fonts.googleapis.com/css2?family=Lexend+Deca:wght@100;200;300;400;500;600;700;800;900&family=Roboto:ital,wght@0,100;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap'); - -body { - font-family: 'Lexend Deca', sans-serif; - max-width: 100vw; - height: 100vh; -} - - -*{ - box-sizing: border-box; - text-decoration: none; -} - -input { - padding-left: 10px; - border: 1px solid #D5D5D5; -} -input::placeholder { - font-style: italic; -} -