Fixes and adjustments in the Pomodoro registration

This commit is contained in:
2022-01-14 21:01:47 -03:00
parent aa07e93786
commit 52ad7f06f3
11 changed files with 74 additions and 76 deletions

3
.gitignore vendored
View File

@@ -32,6 +32,7 @@ yarn-error.log*
/.github /.github
/.vscode /.vscode
.firebasesrc .firebaserc
/firebase.json
␠netlify.toml ␠netlify.toml
package-lock.json package-lock.json

View File

@@ -1,30 +1,16 @@
import React, {useState} from 'react' import { getAuth, onAuthStateChanged } from 'firebase/auth';
import {firebase} from './components/Firebase/firebase' import React, { useState } from 'react';
import {getAuth, onAuthStateChanged} from 'firebase/auth' import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
import { doc, updateDoc, getFirestore, collection, getDoc } from "firebase/firestore";
import detectKeys from './components/Misc/detectKeys';
import AboutThis from "./components/AboutThis"; 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 Account from "./components/Account";
import BannerLogin from "./components/BannerLogin";
import ClockifyTasksDisplay from './components/ClockifyTasksDisplay'; import ClockifyTasksDisplay from './components/ClockifyTasksDisplay';
import Credits from './components/Credits'; import Credits from './components/Credits';
import Footer from './components/Footer'; 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() { function App() {

View File

@@ -56,7 +56,7 @@ const AboutThis = (props) => {
You have more projects? You have more projects?
</h4> </h4>
<p> <p>
Yes!, all there are in my <a href="http://franp.xyz">personal website</a>. Yes!, all there are in my <a target="_blank" href="https://porfolio-franp.netlify.app">personal website</a>.
</p> </p>
</li> </li>
</ul> </ul>

View File

@@ -1,10 +1,10 @@
import React, {useState} from 'react' import { getAuth, onAuthStateChanged } from 'firebase/auth';
import {firebase} from './Firebase/firebase' import { doc, getDoc, getFirestore, updateDoc } from "firebase/firestore";
import {getAuth, onAuthStateChanged} from 'firebase/auth' import React, { useState } from 'react';
import { doc, updateDoc, getFirestore, collection, getDoc } from "firebase/firestore";
import Message from './Account Childrens/Message'; import Message from './Account Childrens/Message';
import loadingGifLightTheme from './img/loading-light-theme.png' import { firebase } from './Firebase/firebase';
import loadingGifDarkTheme from './img/loading-dark-theme.png' import loadingGifDarkTheme from './img/loading-dark-theme.png';
import loadingGifLightTheme from './img/loading-light-theme.png';
const Account = (props) => { const Account = (props) => {

View File

@@ -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 { getAuth, onAuthStateChanged } from "firebase/auth";
import { doc, updateDoc, getFirestore, collection, getDoc } from "firebase/firestore"; import { doc, getDoc, getFirestore } from "firebase/firestore";
import loadingGifLightTheme from './img/loading-light-theme.png' import React, { useState } from 'react';
import loadingGifDarkTheme from './img/loading-dark-theme.png' import { firebase } from './Firebase/firebase';
import detectKeys from './Misc/detectKeys'; import loadingGifDarkTheme from './img/loading-dark-theme.png';
import loadingGifLightTheme from './img/loading-light-theme.png';
const ClockifyTasksDisplay = (props) => { const ClockifyTasksDisplay = (props) => {

View File

@@ -3,7 +3,7 @@ import React from 'react'
const Footer = (props) => { const Footer = (props) => {
return ( return (
<footer className={props.darkMode ? 'made-with-love dark-mode-component' : 'made-with-love'}> <footer className={props.darkMode ? 'made-with-love dark-mode-component' : 'made-with-love'}>
Made with 💓 by <a href="http://www.franp.xyz">Francisco Pessano</a> Made with 💓 by <a href="https://porfolio-franp.netlify.app" target="_blank">Francisco Pessano</a>
</footer> </footer>
) )
} }

View File

@@ -1,15 +1,13 @@
import React, {useState} from 'react' import React from 'react'
import DarkMode from './Header Childrens/DarkMode' import DarkMode from './Header Childrens/DarkMode'
import GoToAccount from './Header Childrens/GoToAccount' import GoToAccount from './Header Childrens/GoToAccount'
const Header = (props) => { const Header = (props) => {
return ( return (
<header className={props.darkMode ? 'header-main-page dark-mode-component' : 'header-main-page'} > <header className={props.darkMode ? 'header-main-page dark-mode-component' : 'header-main-page'} >
<a href="/"><h1>Pomodoro Timer</h1></a> <a href="/"><h1>Pomodoro Timer</h1></a>
<h3>Made By <span className="selectable"><a target="_blank" href="http://www.franp.xyz" rel="noreferrer">Francisco Pessano</a></span></h3> <h3>Made By <span className="selectable"><a target="_blank" href="https://porfolio-franp.netlify.app" rel="noreferrer">Francisco Pessano</a></span></h3>
<DarkMode <DarkMode
darkMode={props.darkMode} darkMode={props.darkMode}
setDarkmode={props.setDarkmode} setDarkmode={props.setDarkmode}

View File

@@ -1,16 +1,16 @@
import React, {useState} from 'react' import { createUserWithEmailAndPassword, getAuth, onAuthStateChanged, sendPasswordResetEmail, signInWithEmailAndPassword, signOut } from 'firebase/auth'
import { doc, getFirestore, setDoc } from 'firebase/firestore'
import React, { useState } from 'react'
import { withRouter } from 'react-router-dom'
import { firebase } from './Firebase/firebase'
import LoginForm from './Identify Childrens/LoginForm' import LoginForm from './Identify Childrens/LoginForm'
import RegisterForm from './Identify Childrens/RegisterForm' import RegisterForm from './Identify Childrens/RegisterForm'
import {firebase} from './Firebase/firebase'
import {withRouter} from 'react-router-dom'
import {getAuth, createUserWithEmailAndPassword, signInWithEmailAndPassword, signOut, onAuthStateChanged, sendPasswordResetEmail } from 'firebase/auth'
import { getFirestore, collection, doc, setDoc } from 'firebase/firestore'
import ResetPassword from './Identify Childrens/ResetPassword' import ResetPassword from './Identify Childrens/ResetPassword'
import loadingGifLightTheme from './img/loading-light-theme.png'
import loadingGifDarkTheme from './img/loading-dark-theme.png' import loadingGifDarkTheme from './img/loading-dark-theme.png'
import loadingGifLightTheme from './img/loading-light-theme.png'
const Identify = (props) => { const Identify = (props) => {

View File

@@ -119,7 +119,7 @@ const MainPomodoroTimer = (props) => {
} }
} }
const setPomodoroCounter = (counter = false, mode) => { const setPomodoroCounter = (counter = false) => {
if (!counter) { if (!counter) {
console.error('NOT PARAMETER PASSED') console.error('NOT PARAMETER PASSED')
} }
@@ -158,9 +158,9 @@ const MainPomodoroTimer = (props) => {
})*/ })*/
const getFavicon = () => { const getFavicon = () => {
const r = document.getElementById('favicon')
return r return document.getElementById('favicon')
} }
React.useEffect ( () => { React.useEffect ( () => {
@@ -171,7 +171,6 @@ const MainPomodoroTimer = (props) => {
if (!weAreInBreakTime) { if (!weAreInBreakTime) {
getFavicon().href = './img/working favicon.ico' getFavicon().href = './img/working favicon.ico'
if (!alreadyCountingStart) { if (!alreadyCountingStart) {
@@ -188,7 +187,6 @@ const MainPomodoroTimer = (props) => {
playAudio('work') playAudio('work')
if (notificationPermission) { if (notificationPermission) {
new Notification('Pomodoro ended'); new Notification('Pomodoro ended');
@@ -286,6 +284,7 @@ const MainPomodoroTimer = (props) => {
} }
if (!props.timerOn) { if (!props.timerOn) {
document.title = 'Clockify Pomodoro Timer' document.title = 'Clockify Pomodoro Timer'
getFavicon().href = './img/favicon.ico' getFavicon().href = './img/favicon.ico'
@@ -294,27 +293,48 @@ const MainPomodoroTimer = (props) => {
if (!weAreInBreakTime) { if (!weAreInBreakTime) {
if (minutes <= ( setTimeStyle().minutes / 2) ) { if (restCounter !== 3){
setPomodoroCounter('Pomodoros')
setRestCounter((restCounter + 1))
if (!alreadyCountingEnd) { setTimeout(() => {
const time = getAndFormatCurrentTime(props.KonamiCodeActive)
props.setEndTime(time) setPomodoroCounter('Pomodoros')
setAlreadyCountingEnd(true)
props.setLetsUpload(true) setRestCounter((restCounter + 1))
}
} setBreak(1, 0)
setWeAreInBreakTime(true)
}, 1)
} }
if (restCounter === 3) {
setTimeout(() => {
setPomodoroCounter('Pomodoros')
setRestCounter((restCounter + 1))
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 (weAreInBreakTime) {
if (restCounter === 4) { if (restCounter === 4) {
@@ -323,7 +343,6 @@ const MainPomodoroTimer = (props) => {
} else { } else {
setPomodoroCounter('Rest') setPomodoroCounter('Rest')
} }

View File

@@ -6,8 +6,6 @@ import uploadToClockifyTimer from './Clockify/uploadToClockifyTimer'
const MainPomodoro = (props) => { const MainPomodoro = (props) => {
const [style, setStyle] = useState('Regular') const [style, setStyle] = useState('Regular')
const [displayHidden, setDisplayHidden] = useState(true) const [displayHidden, setDisplayHidden] = useState(true)

View File

@@ -1,2 +0,0 @@
[build]
command = CI= npm run build