diff --git a/.gitignore b/.gitignore index ef5ff33..6b9401c 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,7 @@ yarn-error.log* /.github /.vscode -.firebasesrc +.firebaserc +/firebase.json ␠netlify.toml package-lock.json \ No newline at end of file diff --git a/src/App.js b/src/App.js index f6e958b..16ff13d 100644 --- a/src/App.js +++ b/src/App.js @@ -1,30 +1,16 @@ -import React, {useState} from 'react' -import {firebase} from './components/Firebase/firebase' -import {getAuth, onAuthStateChanged} from 'firebase/auth' -import { doc, updateDoc, getFirestore, collection, getDoc } from "firebase/firestore"; - -import detectKeys from './components/Misc/detectKeys'; - +import { getAuth, onAuthStateChanged } from 'firebase/auth'; +import React, { useState } from 'react'; +import { BrowserRouter as Router, Route, Switch } from "react-router-dom"; import AboutThis from "./components/AboutThis"; -import BannerLogin from "./components/BannerLogin"; -import GoDownArrow from "./components/GoDownArrow"; -import Header from "./components/Header"; -import MainPomodoro from "./components/MainPomodoro"; - -import { - BrowserRouter as Router, - Switch, - Route, - Link -} from "react-router-dom"; - -import Identify from "./components/Identify"; import Account from "./components/Account"; +import BannerLogin from "./components/BannerLogin"; import ClockifyTasksDisplay from './components/ClockifyTasksDisplay'; import Credits from './components/Credits'; - import Footer from './components/Footer'; -import ResetPassword from './components/Identify Childrens/ResetPassword'; +import GoDownArrow from "./components/GoDownArrow"; +import Header from "./components/Header"; +import Identify from "./components/Identify"; +import MainPomodoro from "./components/MainPomodoro"; function App() { diff --git a/src/components/AboutThis.jsx b/src/components/AboutThis.jsx index 36d2718..ba2e192 100644 --- a/src/components/AboutThis.jsx +++ b/src/components/AboutThis.jsx @@ -56,7 +56,7 @@ const AboutThis = (props) => { You have more projects?

- Yes!, all there are in my personal website. + Yes!, all there are in my personal website.

diff --git a/src/components/Account.jsx b/src/components/Account.jsx index 291f6a6..7e2ec08 100644 --- a/src/components/Account.jsx +++ b/src/components/Account.jsx @@ -1,10 +1,10 @@ -import React, {useState} from 'react' -import {firebase} from './Firebase/firebase' -import {getAuth, onAuthStateChanged} from 'firebase/auth' -import { doc, updateDoc, getFirestore, collection, getDoc } from "firebase/firestore"; +import { getAuth, onAuthStateChanged } from 'firebase/auth'; +import { doc, getDoc, getFirestore, updateDoc } from "firebase/firestore"; +import React, { useState } from 'react'; import Message from './Account Childrens/Message'; -import loadingGifLightTheme from './img/loading-light-theme.png' -import loadingGifDarkTheme from './img/loading-dark-theme.png' +import { firebase } from './Firebase/firebase'; +import loadingGifDarkTheme from './img/loading-dark-theme.png'; +import loadingGifLightTheme from './img/loading-light-theme.png'; const Account = (props) => { diff --git a/src/components/ClockifyTasksDisplay.jsx b/src/components/ClockifyTasksDisplay.jsx index 65c0a7a..c4a8a74 100644 --- a/src/components/ClockifyTasksDisplay.jsx +++ b/src/components/ClockifyTasksDisplay.jsx @@ -1,11 +1,9 @@ -import React, {useState} from 'react' -//import { makeRequest } from '../Clockify/clockify' -import { firebase } from './Firebase/firebase'; import { getAuth, onAuthStateChanged } from "firebase/auth"; -import { doc, updateDoc, getFirestore, collection, getDoc } from "firebase/firestore"; -import loadingGifLightTheme from './img/loading-light-theme.png' -import loadingGifDarkTheme from './img/loading-dark-theme.png' -import detectKeys from './Misc/detectKeys'; +import { doc, getDoc, getFirestore } from "firebase/firestore"; +import React, { useState } from 'react'; +import { firebase } from './Firebase/firebase'; +import loadingGifDarkTheme from './img/loading-dark-theme.png'; +import loadingGifLightTheme from './img/loading-light-theme.png'; const ClockifyTasksDisplay = (props) => { diff --git a/src/components/Footer.jsx b/src/components/Footer.jsx index 8c6f133..971572f 100644 --- a/src/components/Footer.jsx +++ b/src/components/Footer.jsx @@ -3,7 +3,7 @@ import React from 'react' const Footer = (props) => { return ( ) } diff --git a/src/components/Header.jsx b/src/components/Header.jsx index 511c99c..8183df6 100644 --- a/src/components/Header.jsx +++ b/src/components/Header.jsx @@ -1,15 +1,13 @@ -import React, {useState} from 'react' +import React from 'react' import DarkMode from './Header Childrens/DarkMode' import GoToAccount from './Header Childrens/GoToAccount' const Header = (props) => { - - return (

Pomodoro Timer

-

Made By Francisco Pessano

+

Made By Francisco Pessano

{ diff --git a/src/components/Main Pomodoro Childrens/MainPomodoroTimer.jsx b/src/components/Main Pomodoro Childrens/MainPomodoroTimer.jsx index 4df180e..6b15c7c 100644 --- a/src/components/Main Pomodoro Childrens/MainPomodoroTimer.jsx +++ b/src/components/Main Pomodoro Childrens/MainPomodoroTimer.jsx @@ -119,7 +119,7 @@ const MainPomodoroTimer = (props) => { } } - const setPomodoroCounter = (counter = false, mode) => { + const setPomodoroCounter = (counter = false) => { if (!counter) { console.error('NOT PARAMETER PASSED') } @@ -158,9 +158,9 @@ const MainPomodoroTimer = (props) => { })*/ const getFavicon = () => { - const r = document.getElementById('favicon') - return r + return document.getElementById('favicon') + } React.useEffect ( () => { @@ -171,7 +171,6 @@ const MainPomodoroTimer = (props) => { if (!weAreInBreakTime) { - getFavicon().href = './img/working favicon.ico' if (!alreadyCountingStart) { @@ -188,7 +187,6 @@ const MainPomodoroTimer = (props) => { playAudio('work') - if (notificationPermission) { new Notification('Pomodoro ended'); @@ -286,6 +284,7 @@ const MainPomodoroTimer = (props) => { } if (!props.timerOn) { + document.title = 'Clockify Pomodoro Timer' getFavicon().href = './img/favicon.ico' @@ -294,26 +293,47 @@ const MainPomodoroTimer = (props) => { if (!weAreInBreakTime) { - if (minutes <= ( setTimeStyle().minutes / 2) ) { - setPomodoroCounter('Pomodoros') - setRestCounter((restCounter + 1)) - - if (!alreadyCountingEnd) { - const time = getAndFormatCurrentTime(props.KonamiCodeActive) + if (restCounter !== 3){ - props.setEndTime(time) - setAlreadyCountingEnd(true) - - props.setLetsUpload(true) - } - } + setTimeout(() => { + + setPomodoroCounter('Pomodoros') + + setRestCounter((restCounter + 1)) + + setBreak(1, 0) + setWeAreInBreakTime(true) + }, 1) } - + if (restCounter === 3) { + + setTimeout(() => { + + setPomodoroCounter('Pomodoros') + setRestCounter((restCounter + 1)) - if (weAreInBreakTime) { + setBreak(0, 1) + setWeAreInBreakTime(true) + }, 1) + } - + if (!alreadyCountingEnd) { + + const time = getAndFormatCurrentTime(props.KonamiCodeActive) + + props.setEndTime(time) + setAlreadyCountingEnd(true) + + props.setLetsUpload(true) + + document.title = randomText('rest') + } + + props.setTimerOn(true) + } + + if (weAreInBreakTime) { if (restCounter === 4) { @@ -322,7 +342,6 @@ const MainPomodoroTimer = (props) => { setRestCounter(0) } else { - setPomodoroCounter('Rest') } diff --git a/src/components/MainPomodoro.jsx b/src/components/MainPomodoro.jsx index 6c85281..859ee43 100644 --- a/src/components/MainPomodoro.jsx +++ b/src/components/MainPomodoro.jsx @@ -6,8 +6,6 @@ import uploadToClockifyTimer from './Clockify/uploadToClockifyTimer' const MainPomodoro = (props) => { - - const [style, setStyle] = useState('Regular') const [displayHidden, setDisplayHidden] = useState(true) diff --git a/␠netlify.toml b/␠netlify.toml deleted file mode 100644 index dbd891d..0000000 --- a/␠netlify.toml +++ /dev/null @@ -1,2 +0,0 @@ -[build] -command = “CI= npm run build” \ No newline at end of file