Skip to content
Open
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
23 changes: 23 additions & 0 deletions todo-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
6 changes: 6 additions & 0 deletions todo-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
1) Add a task
2) Edit a task
3) Delete a task
4) Mark it as done/re-open

Implemented redux for the above tasks so that state managment will be uniform
14,062 changes: 14,062 additions & 0 deletions todo-app/package-lock.json

Large diffs are not rendered by default.

44 changes: 44 additions & 0 deletions todo-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"name": "todo-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"bootstrap": "^4.5.0",
"font-awesome": "^4.7.0",
"react": "^16.13.1",
"react-bootstrap": "^1.2.2",
"react-bootstrap-table-next": "^4.0.3",
"react-bootstrap-table2-filter": "^1.3.3",
"react-dom": "^16.13.1",
"react-icons": "^3.10.0",
"react-redux": "^7.2.0",
"react-scripts": "3.4.1",
"redux": "^4.0.5",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0"
},
"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"
]
}
}
Binary file added todo-app/public/favicon.ico
Binary file not shown.
43 changes: 43 additions & 0 deletions todo-app/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.

Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.

You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.

To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
Binary file added todo-app/public/logo192.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 todo-app/public/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions todo-app/public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
3 changes: 3 additions & 0 deletions todo-app/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
38 changes: 38 additions & 0 deletions todo-app/src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
.App {
text-align: center;
}

.App-logo {
height: 40vmin;
pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}

.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}

.App-link {
color: #61dafb;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
26 changes: 26 additions & 0 deletions todo-app/src/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from 'react';
import './App.css';

import Dashboard from './pages/dashboard/dashboard';

const App = () => {


return (
<div className="App">
<Dashboard />
</div>
);
}

export default App;


// display: flex;
// align-items: center;
// justify-content: center;
// position: fixed;
// bottom: 3rem;
// right: 3rem;
// font-size: 3rem;
// cursor: pointer;
9 changes: 9 additions & 0 deletions todo-app/src/App.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';
import { render } from '@testing-library/react';
import App from './App';

test('renders learn react link', () => {
const { getByText } = render(<App />);
const linkElement = getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});
10 changes: 10 additions & 0 deletions todo-app/src/components/add-todo-button/add-todo-button.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.add-btn-cls {
display: flex;
align-items: center;
justify-content: center;
position: fixed;
bottom: 3rem;
right: 3rem;
font-size: 3rem;
cursor: pointer;
}
17 changes: 17 additions & 0 deletions todo-app/src/components/add-todo-button/add-todo-button.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';
import {IoIosAddCircle} from 'react-icons/io';

import './add-todo-button.css';

const AddTodoButton = ({show}) => {

return (
<div className="add-btn-cls">
<IoIosAddCircle
onClick={show}
/>
</div>
)
}

export default AddTodoButton
Empty file.
29 changes: 29 additions & 0 deletions todo-app/src/components/confirm-model/confirm-model.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from 'react';

import { Modal, Button } from 'react-bootstrap';

const ConfirmModal = ({show,handleClose, handleYes}) => {
return (
<Modal
show={show}
onHide={handleClose}
backdrop="static"
keyboard={false}
>
<Modal.Header closeButton>
<Modal.Title>Delete Task</Modal.Title>
</Modal.Header>
<Modal.Body>
Do you want to delete this task?
</Modal.Body>
<Modal.Footer>
<Button variant="secondary" onClick={handleClose}>
No
</Button>
<Button variant="primary" onClick={handleYes}>Yes</Button>
</Modal.Footer>
</Modal>
)
}

export default ConfirmModal;
Empty file.
84 changes: 84 additions & 0 deletions todo-app/src/components/form-modal/form-modal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import React from 'react';

import { Modal, Button } from 'react-bootstrap';

const FormModal = ({show, handleOnClose,todoState=[], handleSubmit, onChangeValue,btnText}) => {

return (
<React.Fragment>

<Modal show={show} onHide={handleOnClose} size="lg">
<Modal.Header closeButton>
<Modal.Title>Add Todo</Modal.Title>
</Modal.Header>
<Modal.Body>
<div className="form-group row">
<label htmlFor="summaryVal" className="col-sm-2 col-form-label">Summary </label>
<div className="col-sm-10">
<textarea type="text"
onChange={(e) => onChangeValue('summary', e.target.value)}
value={todoState.summary}
className="form-control"
id="summaryVal"
rows="1"
min="10"
max="100"
placeholder="Please enter Summary" required />
</div>
</div>
<div className="form-group row">
<label htmlFor="description" className="col-sm-2 col-form-label">Description</label>
<div className="col-sm-10">
<textarea type="text"
onChange={(e) => onChangeValue('description', e.target.value)}
value={todoState.description}
className="form-control"
id="description"
rows="5"
min="10"
max="100"
placeholder="Please Enter Description" required />
</div>
</div>
<div className="form-group row">
<label htmlFor="priority" className="col-sm-2 col-form-label">Priority</label>
<div className="col-sm-10">
<select
onChange={(e) => onChangeValue('priority', e.target.value)}
value={todoState.priority}
className="form-control"
id="priority">
<option value="None">None</option>
<option value="Low">Low</option>
<option value="Medium">Medium</option>
<option value="High">High</option>
</select>
</div>
</div>
<div className="form-group row">
<label className="col-sm-2 col-form-label">Due Date</label>
<div className="col-sm-10">
<input type="date"
onChange={(e) => onChangeValue('dueDate', e.target.value)}
className="form-control"
value={todoState.dueDate}
placeholder="dd/mm/yy" required />
</div>
</div>
<Modal.Footer>
<Button variant="secondary" onClick={handleOnClose}>
Close
</Button>
<Button type="button" variant="primary" onClick={handleSubmit} >
{btnText}
</Button>
</Modal.Footer>
</Modal.Body>

</Modal>
</React.Fragment>

)
}

export default FormModal;
Empty file.
Loading