├── .eslintcache
├── .gitignore
├── LICENSE
├── README.md
├── package-lock.json
├── package.json
├── public
├── favicon.ico
├── index.html
├── logo192.png
├── logo512.png
├── manifest.json
├── react_pomodoro_timer.png
└── robots.txt
└── src
├── Timer.js
├── _variables.sass
├── components
├── Break
│ ├── Break.jsx
│ └── break.sass
├── Controls
│ ├── Controls.jsx
│ └── controls.sass
├── Credits
│ ├── Credits.jsx
│ └── credits.sass
├── Session
│ ├── Session.jsx
│ └── session.sass
└── ThemeToggle
│ ├── ThemeToggle.jsx
│ └── themeToggle.sass
├── contexts
├── stateProvider.js
└── themeProvider.js
├── hooks
└── useClockify.jsx
├── index.js
├── index.sass
├── reducer.js
└── timer.sass
/.eslintcache:
--------------------------------------------------------------------------------
1 | [{"/Users/davidemandelli/Desktop/Personal/React/react-pomodoro-clock/src/index.js":"1","/Users/davidemandelli/Desktop/Personal/React/react-pomodoro-clock/src/Timer.js":"2","/Users/davidemandelli/Desktop/Personal/React/react-pomodoro-clock/src/components/Session/Session.jsx":"3","/Users/davidemandelli/Desktop/Personal/React/react-pomodoro-clock/src/components/Break/Break.jsx":"4","/Users/davidemandelli/Desktop/Personal/React/react-pomodoro-clock/src/components/Controls/Controls.jsx":"5","/Users/davidemandelli/Desktop/Personal/React/react-pomodoro-clock/src/reducer.js":"6","/Users/davidemandelli/Desktop/Personal/React/react-pomodoro-clock/src/hooks/useClockify.jsx":"7","/Users/davidemandelli/Desktop/Personal/React/react-pomodoro-clock/src/contexts/stateProvider.js":"8","/Users/davidemandelli/Desktop/Personal/React/react-pomodoro-clock/src/contexts/themeProvider.js":"9","/Users/davidemandelli/Desktop/Personal/React/react-pomodoro-clock/src/components/ThemeToggle/ThemeToggle.jsx":"10","/Users/davidemandelli/Desktop/Personal/React/react-pomodoro-clock/src/components/Credits/Credits.jsx":"11"},{"size":624,"mtime":1610321482000,"results":"12","hashOfConfig":"13"},{"size":882,"mtime":1609898419000,"results":"14","hashOfConfig":"13"},{"size":1946,"mtime":1609809329000,"results":"15","hashOfConfig":"13"},{"size":1798,"mtime":1609892004000,"results":"16","hashOfConfig":"13"},{"size":3196,"mtime":1609809326000,"results":"17","hashOfConfig":"13"},{"size":2469,"mtime":1610321391000,"results":"18","hashOfConfig":"13"},{"size":376,"mtime":1609809327000,"results":"19","hashOfConfig":"13"},{"size":364,"mtime":1609809318000,"results":"20","hashOfConfig":"13"},{"size":764,"mtime":1609976164000,"results":"21","hashOfConfig":"13"},{"size":1460,"mtime":1609977380000,"results":"22","hashOfConfig":"13"},{"size":430,"mtime":1610321849000,"results":"23","hashOfConfig":"13"},{"filePath":"24","messages":"25","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1ssru8b",{"filePath":"26","messages":"27","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"28","messages":"29","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"30","messages":"31","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"32","messages":"33","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"34","messages":"35","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"36","messages":"37","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"38","messages":"39","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"40","messages":"41","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"42","messages":"43","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"44","messages":"45","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/davidemandelli/Desktop/Personal/React/react-pomodoro-clock/src/index.js",[],"/Users/davidemandelli/Desktop/Personal/React/react-pomodoro-clock/src/Timer.js",[],"/Users/davidemandelli/Desktop/Personal/React/react-pomodoro-clock/src/components/Session/Session.jsx",[],"/Users/davidemandelli/Desktop/Personal/React/react-pomodoro-clock/src/components/Break/Break.jsx",[],"/Users/davidemandelli/Desktop/Personal/React/react-pomodoro-clock/src/components/Controls/Controls.jsx",[],"/Users/davidemandelli/Desktop/Personal/React/react-pomodoro-clock/src/reducer.js",[],"/Users/davidemandelli/Desktop/Personal/React/react-pomodoro-clock/src/hooks/useClockify.jsx",[],"/Users/davidemandelli/Desktop/Personal/React/react-pomodoro-clock/src/contexts/stateProvider.js",[],"/Users/davidemandelli/Desktop/Personal/React/react-pomodoro-clock/src/contexts/themeProvider.js",[],"/Users/davidemandelli/Desktop/Personal/React/react-pomodoro-clock/src/components/ThemeToggle/ThemeToggle.jsx",[],"/Users/davidemandelli/Desktop/Personal/React/react-pomodoro-clock/src/components/Credits/Credits.jsx",[]]
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Davide Mandelli
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 
2 | # 🍅 React Pomodoro Timer
3 | > This is a very small project created with the purpose of learning the fundamentals of React.js starting from a simple [Create React App](https://github.com/facebook/create-react-app).
4 |
5 | ## 🎯 About ##
6 |
7 | I've started this project with the idea of reworking one of the ending projects of the Front End Libraries Certification (300 hours) of [FreeCodeCamp](https://www.freecodecamp.org/learn).
8 | I have structured the project with three React components and I have used some native and custom [React hooks](https://reactjs.org/docs/hooks-intro.html) in order to handle various project features and behaviours.
9 | I have also used the [Context API](https://reactjs.org/docs/context.html) in order to be able to dispatch actions and to avoid prop-drilling (or threading). I have then styled everything with a little bit of custom SASS and I have added a theme switcher in order to be able to toggle the dark mode view.
10 | You can set sessions and breaks for a maximum of 60 minutes: for each mode change you will hear an audio notification.
11 | You can even follow the counter mode & timer in your browser tab name without have the focus on that tab.
12 |
13 | ## ▶️ Demo
14 |
15 | Here you can find the demo link:
16 |
17 | - [Netlify](https://react-tomato-clock.netlify.app/)
18 |
19 | ## :sparkles: Features ##
20 |
21 | :heavy_check_mark: Use of React hooks and custom hooks
22 | :heavy_check_mark: Use of React Context API
23 | :heavy_check_mark: Counter state & timer in browser tab name
24 | :heavy_check_mark: Audio notification when timer ends
25 | :heavy_check_mark: Theme switcher (light/dark mode)
26 | :heavy_check_mark: Gets theme preference from local storage
27 | :heavy_check_mark: Responsive site
28 |
29 | ## :rocket: Technologies ##
30 |
31 | - [React](https://reactjs.org/)
32 | - [React Hooks](https://reactjs.org/docs/hooks-intro.html)
33 | - [React Context API](https://reactjs.org/docs/context.html)
34 | - [SASS with vars switcher](https://sass-lang.com/)
35 | - [Netlify - Responsible for the deploy (have a look below)](https://www.netlify.com/)
36 |
37 | ## Netlify deploy & configuration ##
38 |
39 | > The site is developed with some specific https://netlify.com apis.
40 |
41 | [](https://app.netlify.com/sites/react-tomato-clock/deploys)
42 |
43 | ### Deploy configuration steps
44 |
45 | 1. Connect your GitHub account to Netlify
46 | 3. Select the project
47 | 2. In Settings → Build & Deploy → Set **Build command** to : **_npm run build_**
48 | 3. In Settings → Build & Deploy → Set **Publish directory** to : **_build_**
49 |
50 |
51 | ## :white_check_mark: Requirements ##
52 |
53 | Before starting :checkered_flag:, you need to have [Git](https://git-scm.com) and [Node](https://nodejs.org/en/) installed.
54 |
55 | ## Available Scripts
56 |
57 | In the project directory, you can run:
58 |
59 | ### `npm start`
60 |
61 | Runs the app in the development mode.\
62 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
63 |
64 | The page will reload if you make edits.\
65 | You will also see any lint errors in the console.
66 |
67 | ### `npm test`
68 |
69 | Launches the test runner in the interactive watch mode.\
70 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
71 |
72 | ### `npm run build`
73 |
74 | Builds the app for production to the `build` folder.\
75 | It correctly bundles React in production mode and optimizes the build for the best performance.
76 |
77 | The build is minified and the filenames include the hashes.\
78 | Your app is ready to be deployed!
79 |
80 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
81 |
82 | ### `npm run eject`
83 |
84 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
85 |
86 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
87 |
88 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
89 |
90 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
91 |
92 | ## Learn More
93 |
94 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
95 |
96 | To learn React, check out the [React documentation](https://reactjs.org/).
97 |
98 | ### Code Splitting
99 |
100 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
101 |
102 | ### Analyzing the Bundle Size
103 |
104 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
105 |
106 | ### Making a Progressive Web App
107 |
108 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
109 |
110 | ### Advanced Configuration
111 |
112 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
113 |
114 | ### Deployment
115 |
116 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
117 |
118 | ### `npm run build` fails to minify
119 |
120 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
121 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-pomodoro-clock",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@fortawesome/fontawesome-svg-core": "^1.2.32",
7 | "@fortawesome/free-solid-svg-icons": "^5.15.1",
8 | "@fortawesome/react-fontawesome": "^0.1.14",
9 | "@testing-library/jest-dom": "^5.11.6",
10 | "@testing-library/react": "^11.2.2",
11 | "@testing-library/user-event": "^12.6.0",
12 | "node-sass": "^4.14.1",
13 | "react": "^17.0.1",
14 | "react-dom": "^17.0.1",
15 | "react-scripts": "4.0.1",
16 | "web-vitals": "^0.2.4"
17 | },
18 | "scripts": {
19 | "start": "react-scripts start",
20 | "build": "react-scripts build",
21 | "test": "react-scripts test",
22 | "eject": "react-scripts eject"
23 | },
24 | "eslintConfig": {
25 | "extends": [
26 | "react-app",
27 | "react-app/jest"
28 | ]
29 | },
30 | "browserslist": {
31 | "production": [
32 | ">0.2%",
33 | "not dead",
34 | "not op_mini all"
35 | ],
36 | "development": [
37 | "last 1 chrome version",
38 | "last 1 firefox version",
39 | "last 1 safari version"
40 | ]
41 | },
42 | "guppy": {
43 | "id": "a01ae020-9210-11eb-a526-bffe0af5e401",
44 | "name": "react-pomodoro-clock",
45 | "type": "create-react-app",
46 | "color": "#AA00FF",
47 | "icon": null,
48 | "createdAt": 1617188566822
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Th3Wall/react-pomodoro-clock/e1c39063a61f94e772f535414cc3e0efb723d65a/public/favicon.ico
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |