Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
react-todo
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Manivasagam S
react-todo
Commits
634590c3
Commit
634590c3
authored
May 19, 2025
by
Manivasagam S
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style changed
parent
341f0210
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
100 additions
and
26 deletions
+100
-26
App.css
src/App.css
+0
-0
TodoForm.jsx
src/component/TodoForm/TodoForm.jsx
+3
-3
TodoForm.module.css
src/component/TodoForm/TodoForm.module.css
+3
-0
TodoItem.jsx
src/component/TodoItem/TodoItem.jsx
+1
-1
TodoItem.module.css
src/component/TodoItem/TodoItem.module.css
+4
-1
TodoList.jsx
src/component/TodoList/TodoList.jsx
+2
-2
TodoList.module.css
src/component/TodoList/TodoList.module.css
+1
-3
db.json
src/db.json
+70
-10
Todo.jsx
src/pages/Todo.jsx
+7
-4
Todo.module.css
src/pages/Todo.module.css
+9
-2
No files found.
src/
Styles/
App.css
→
src/App.css
View file @
634590c3
File moved
src/component/TodoForm.jsx
→
src/component/TodoForm
/TodoForm
.jsx
View file @
634590c3
import
React
from
"react"
;
import
React
from
"react"
;
import
styles
from
".
./styles
/TodoForm.module.css"
;
import
styles
from
"./TodoForm.module.css"
;
const
TodoForm
=
({
input
,
error
,
handleInputChange
,
handleSubmit
})
=>
{
const
TodoForm
=
({
input
,
error
,
handleInputChange
,
handleSubmit
})
=>
{
return
(
return
(
<
div
>
<
form
className=
{
styles
.
form
}
onSubmit=
{
handleSubmit
}
>
<
form
className=
{
styles
.
form
}
onSubmit=
{
handleSubmit
}
>
<
div
className=
{
styles
[
'input-wrapper'
]
}
>
<
div
className=
{
styles
[
'input-wrapper'
]
}
>
<
input
<
input
...
@@ -17,7 +17,7 @@ const TodoForm = ({ input, error, handleInputChange, handleSubmit }) => {
...
@@ -17,7 +17,7 @@ const TodoForm = ({ input, error, handleInputChange, handleSubmit }) => {
</
div
>
</
div
>
<
button
type=
"submit"
className=
{
styles
.
button
}
>
Submit
</
button
>
<
button
type=
"submit"
className=
{
styles
.
button
}
>
Submit
</
button
>
</
form
>
</
form
>
</
div
>
);
);
};
};
...
...
src/
Styles
/TodoForm.module.css
→
src/
component/TodoForm
/TodoForm.module.css
View file @
634590c3
...
@@ -3,6 +3,9 @@
...
@@ -3,6 +3,9 @@
flex-wrap
:
wrap
;
flex-wrap
:
wrap
;
gap
:
15px
;
gap
:
15px
;
padding
:
1rem
;
padding
:
1rem
;
position
:
sticky
;
bottom
:
0
;
background-color
:
white
}
}
.input-wrapper
{
.input-wrapper
{
...
...
src/component/TodoItem.jsx
→
src/component/TodoItem
/TodoItem
.jsx
View file @
634590c3
import
React
,
{
useState
,
useEffect
}
from
"react"
;
import
React
,
{
useState
,
useEffect
}
from
"react"
;
import
{
TiDelete
}
from
"react-icons/ti"
;
import
{
TiDelete
}
from
"react-icons/ti"
;
import
styles
from
".
./styles
/TodoItem.module.css"
;
import
styles
from
"./TodoItem.module.css"
;
const
TodoItem
=
({
item
,
handleToggleComplete
,
handleUpdate
,
handleDelete
,
error
})
=>
{
const
TodoItem
=
({
item
,
handleToggleComplete
,
handleUpdate
,
handleDelete
,
error
})
=>
{
const
[
showConfirm
,
setShowConfirm
]
=
useState
(
false
);
const
[
showConfirm
,
setShowConfirm
]
=
useState
(
false
);
...
...
src/
Styles
/TodoItem.module.css
→
src/
component/TodoItem
/TodoItem.module.css
View file @
634590c3
...
@@ -83,6 +83,7 @@
...
@@ -83,6 +83,7 @@
display
:
flex
;
display
:
flex
;
justify-content
:
center
;
justify-content
:
center
;
align-items
:
center
;
align-items
:
center
;
z-index
:
1000
;
}
}
.modal
{
.modal
{
...
@@ -91,7 +92,9 @@
...
@@ -91,7 +92,9 @@
border-radius
:
8px
;
border-radius
:
8px
;
text-align
:
center
;
text-align
:
center
;
max-width
:
auto
;
max-width
:
auto
;
margin
:
0
20px
margin
:
0
20px
;
position
:
relative
;
z-index
:
1001
;
}
}
.modalButtons
{
.modalButtons
{
...
...
src/component/TodoList.jsx
→
src/component/TodoList
/TodoList
.jsx
View file @
634590c3
import
React
from
"react"
;
import
React
from
"react"
;
import
TodoItem
from
"./TodoItem"
;
import
TodoItem
from
".
./TodoItem
/TodoItem"
;
import
styles
from
".
./Styles
/TodoList.module.css"
;
import
styles
from
"./TodoList.module.css"
;
const
TodoList
=
({
todos
,
handleToggleComplete
,
handleUpdate
,
handleDelete
,
updateErrors
})
=>
(
const
TodoList
=
({
todos
,
handleToggleComplete
,
handleUpdate
,
handleDelete
,
updateErrors
})
=>
(
<
ul
className=
{
styles
.
task
}
>
<
ul
className=
{
styles
.
task
}
>
...
...
src/
Styles
/TodoList.module.css
→
src/
component/TodoList
/TodoList.module.css
View file @
634590c3
...
@@ -2,7 +2,5 @@
...
@@ -2,7 +2,5 @@
ul
{
ul
{
margin
:
0
;
margin
:
0
;
padding
:
0
;
padding
:
0
;
max-height
:
84vh
;
/* max-height: 84vh; */
overflow-y
:
auto
;
scroll-behavior
:
smooth
;
}
}
src/db.json
View file @
634590c3
{
{
"todos"
:
[
"todos"
:
[
{
{
"id"
:
"
f87f
"
,
"id"
:
"
4a27
"
,
"text"
:
"
vjbdcbdxcvfdvdvfvfxvfrgrv
"
,
"text"
:
"
Buy Groceries tommorrow
"
,
"completed"
:
false
"completed"
:
false
},
},
{
{
"id"
:
"
ed2b
"
,
"id"
:
"
1aa1
"
,
"text"
:
"
bbbzdfbdfff
"
,
"text"
:
"
Travel to head office
"
,
"completed"
:
false
"completed"
:
false
},
},
{
{
"id"
:
"
d7e7
"
,
"id"
:
"
274c
"
,
"text"
:
"
sdfgdsfg
"
,
"text"
:
"
hsdfds
"
,
"completed"
:
false
"completed"
:
false
},
},
{
{
"id"
:
"
2ccd
"
,
"id"
:
"
e40e
"
,
"text"
:
"
dfhgfhdfh
"
,
"text"
:
"
rege
"
,
"completed"
:
false
"completed"
:
false
},
},
{
{
"id"
:
"9b94"
,
"id"
:
"a146"
,
"text"
:
"dfghdfgh"
,
"text"
:
"gergr"
,
"completed"
:
false
},
{
"id"
:
"4dc6"
,
"text"
:
"cbvcbv"
,
"completed"
:
false
},
{
"id"
:
"c6d8"
,
"text"
:
"ngnn"
,
"completed"
:
false
},
{
"id"
:
"6838"
,
"text"
:
"gnfgn"
,
"completed"
:
false
},
{
"id"
:
"fe38"
,
"text"
:
"gngfn"
,
"completed"
:
false
},
{
"id"
:
"02d1"
,
"text"
:
"ngfng"
,
"completed"
:
false
},
{
"id"
:
"78c1"
,
"text"
:
"gngfn"
,
"completed"
:
false
},
{
"id"
:
"7a0c"
,
"text"
:
"gngfn"
,
"completed"
:
false
},
{
"id"
:
"0698"
,
"text"
:
"gngn"
,
"completed"
:
false
},
{
"id"
:
"81af"
,
"text"
:
"fgnfgn"
,
"completed"
:
false
},
{
"id"
:
"9219"
,
"text"
:
"gngn"
,
"completed"
:
false
},
{
"id"
:
"24d0"
,
"text"
:
"gngn"
,
"completed"
:
false
},
{
"id"
:
"8053"
,
"text"
:
"ngn"
,
"completed"
:
false
"completed"
:
false
}
}
]
]
...
...
src/pages/Todo.jsx
View file @
634590c3
import
React
,
{
useEffect
,
useState
}
from
"react"
;
import
React
,
{
useEffect
,
useState
}
from
"react"
;
import
{
getTodos
,
addTodo
,
deleteTodo
,
updateTodo
}
from
"../api/todo"
;
import
{
getTodos
,
addTodo
,
deleteTodo
,
updateTodo
}
from
"../api/todo"
;
import
TodoList
from
"../component/TodoList"
;
import
TodoList
from
"../component/TodoList
/TodoList.jsx
"
;
import
TodoForm
from
"../component/TodoForm"
;
import
TodoForm
from
"../component/TodoForm
/TodoForm.jsx
"
;
import
styles
from
".
./Styles
/Todo.module.css"
;
import
styles
from
"./Todo.module.css"
;
function
Todo
()
{
function
Todo
()
{
const
[
todos
,
setTodos
]
=
useState
([]);
const
[
todos
,
setTodos
]
=
useState
([]);
...
@@ -83,9 +83,12 @@ const handleSubmit = async (e) => {
...
@@ -83,9 +83,12 @@ const handleSubmit = async (e) => {
return
(
return
(
<
div
className=
{
styles
.
wrapper
}
>
<
div
className=
{
styles
.
wrapper
}
>
<
div
className=
{
styles
.
container
}
>
<
div
className=
{
styles
.
container
}
>
<
h1
className=
{
styles
.
title
}
>
<
div
className=
{
styles
.
wrap
}
>
<
h1
className=
{
styles
.
title
}
>
You have
{
todos
.
length
}
{
todos
.
length
===
1
?
"Todo"
:
"Todos"
}
You have
{
todos
.
length
}
{
todos
.
length
===
1
?
"Todo"
:
"Todos"
}
</
h1
>
</
h1
>
</
div
>
{
todos
.
length
===
0
?
(
{
todos
.
length
===
0
?
(
<
p
className=
{
styles
.
message
}
>
No task
</
p
>
<
p
className=
{
styles
.
message
}
>
No task
</
p
>
)
:
(
)
:
(
...
...
src/
Styl
es/Todo.module.css
→
src/
pag
es/Todo.module.css
View file @
634590c3
...
@@ -7,10 +7,14 @@
...
@@ -7,10 +7,14 @@
background-color
:
#f5f5f5
;
background-color
:
#f5f5f5
;
background-image
:
radial-gradient
(
#ccc
0.5px
,
transparent
1px
);
background-image
:
radial-gradient
(
#ccc
0.5px
,
transparent
1px
);
background-size
:
10px
10px
;
background-size
:
10px
10px
;
}
.wrap
{
position
:
sticky
;
top
:
0
;
}
}
.wrapper
{
.wrapper
{
height
:
100vh
;
min-
height
:
100vh
;
display
:
flex
;
display
:
flex
;
justify-content
:
center
;
justify-content
:
center
;
align-items
:
center
;
align-items
:
center
;
...
@@ -34,6 +38,9 @@
...
@@ -34,6 +38,9 @@
font-family
:
system-ui
;
font-family
:
system-ui
;
padding
:
1rem
;
padding
:
1rem
;
box-shadow
:
0
2px
4px
rgba
(
0
,
0
,
0
,
0.1
);
box-shadow
:
0
2px
4px
rgba
(
0
,
0
,
0
,
0.1
);
position
:
sticky
;
top
:
0
;
background-color
:
white
;
}
}
.message
{
.message
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment