Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 62dee3a

Browse files
author
Rankvet-Developer
committedSep 11, 2022
modal added
1 parent 3db7174 commit 62dee3a

File tree

3 files changed

+44
-30
lines changed

3 files changed

+44
-30
lines changed
 

‎src/App.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
import React from 'react';
2-
import Footer from './components/Footer';
3-
import Header from './components/Header';
4-
import Navbar from './components/Navbar';
5-
import TodoList from './components/TodoList';
2+
// import Footer from './components/Footer';
3+
// import Header from './components/Header';
4+
// import Navbar from './components/Navbar';
5+
// import TodoList from './components/TodoList';
6+
import Modal from './components/ui/Modal';
67

78
export default function App() {
89
return (
910
<div className="grid place-items-center bg-blue-100 h-screen px-6 font-sans">
10-
<Navbar />
11+
{/* <Navbar /> */}
1112

1213
<div className="w-full max-w-3xl shadow-lg rounded-lg p-6 bg-white">
13-
<Header />
14+
{/* <Header /> */}
1415

1516
<hr className="mt-4" />
1617

17-
<TodoList />
18+
<Modal/>
19+
20+
{/* <TodoList /> */}
1821

1922
<hr className="mt-4" />
2023

21-
<Footer />
24+
{/* <Footer /> */}
2225
</div>
2326
</div>
2427
)

‎src/components/TodoList.js

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,6 @@ export default function TodoList() {
2727
))
2828
}
2929

30-
// const filterByStatus = (todo) => {
31-
// const { status } = filters;
32-
// switch (status) {
33-
// case "Complete":
34-
// return todo.completed;
35-
36-
// case "Incomplete":
37-
// return !todo.completed;
38-
39-
// default:
40-
// return true;
41-
// }
42-
// };
43-
44-
// const filterByColors = (todo) => {
45-
// const { colors } = filters;
46-
// if (colors.length > 0) {
47-
// return colors.includes(todo?.color);
48-
// }
49-
// return true;
50-
// };
51-
5230
return (
5331
<div className="mt-2 text-gray-700 text-sm max-h-[300px] overflow-y-auto">
5432
{content}

‎src/components/ui/Modal.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import React from 'react'
2+
3+
const CancelSvg = () => (
4+
<>
5+
<svg aria-hidden="true" className="w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fillRule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clipRule="evenodd"></path></svg>
6+
<span className="sr-only">Close modal</span>
7+
</>
8+
)
9+
10+
export default function Modal() {
11+
return (
12+
<div className="bg-slate-800 bg-opacity-50 flex justify-center items-center absolute top-0 right-0 bottom-0 left-0">
13+
<div className="relative p-4 w-full max-w-md h-full md:h-auto">
14+
<div className="relative bg-white rounded-lg shadow dark:bg-gray-700">
15+
<button type="button" className="absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white" data-modal-toggle="authentication-modal">
16+
<CancelSvg/>
17+
</button>
18+
<div className="py-6 px-6 lg:px-8">
19+
<h3 className="mb-4 text-xl font-medium text-gray-900 dark:text-white">Update the todo</h3>
20+
<form className="space-y-6">
21+
<div>
22+
{/* <label className="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300">Your email</label> */}
23+
<input type="text" name="email" className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white" placeholder="name@company.com" required/>
24+
25+
<input className='px-4 py-2 bg-sky-500 rounded-full text-white' type="submit" value="update" />
26+
</div>
27+
</form>
28+
</div>
29+
</div>
30+
</div>
31+
</div>
32+
)
33+
}

0 commit comments

Comments
 (0)
Please sign in to comment.