Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
TodoList
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
Sakilesh J
TodoList
Commits
10e7ea90
Commit
10e7ea90
authored
Jun 07, 2024
by
Sakilesh J
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix the types
parent
7b8d7dc7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
11 deletions
+18
-11
Item.tsx
components/Top-Level/Item/Item.tsx
+5
-4
item.stories.tsx
components/Top-Level/Item/item.stories.tsx
+5
-5
List.tsx
components/layout/List/List.tsx
+1
-1
db.json
db.json
+7
-1
No files found.
components/Top-Level/Item/Item.tsx
View file @
10e7ea90
...
@@ -4,17 +4,18 @@ import styles from './item.module.css'
...
@@ -4,17 +4,18 @@ import styles from './item.module.css'
import
Input
from
'@/components/base/input/Input'
;
import
Input
from
'@/components/base/input/Input'
;
import
closeIcon
from
'@/public/icons/red-x-10333.svg'
;
import
closeIcon
from
'@/public/icons/red-x-10333.svg'
;
import
Image
from
'next/image'
;
import
Image
from
'next/image'
;
import
{
TodoListItems
}
from
'@/Types/todoTypes'
;
interface
ItemProps
{
interface
ItemProps
{
data
:
TodoListItems
id
:
number
;
task
:
string
;
isCompleted
:
boolean
;
onDelete
:
(
id
:
number
)
=>
void
;
onDelete
:
(
id
:
number
)
=>
void
;
updateTask
:
(
id
:
number
,
task
:
string
,
isCompleted
:
boolean
)
=>
void
;
updateTask
:
(
id
:
number
,
task
:
string
,
isCompleted
:
boolean
)
=>
void
;
}
}
const
Item
:
React
.
FC
<
ItemProps
>
=
({
onDelete
,
updateTask
,
data
})
=>
{
const
Item
:
React
.
FC
<
ItemProps
>
=
({
onDelete
,
updateTask
,
id
,
isCompleted
,
task
})
=>
{
const
{
id
,
task
,
isCompleted
}
=
data
;
const
[
isChecked
,
setisChecked
]
=
useState
(
isCompleted
);
const
[
isChecked
,
setisChecked
]
=
useState
(
isCompleted
);
useEffect
(()
=>
{
useEffect
(()
=>
{
...
...
components/Top-Level/Item/item.stories.tsx
View file @
10e7ea90
...
@@ -14,11 +14,11 @@ export default meta;
...
@@ -14,11 +14,11 @@ export default meta;
type
story
=
StoryObj
<
typeof
meta
>
type
story
=
StoryObj
<
typeof
meta
>
export
const
Item_
:
story
=
{
export
const
Item_
:
story
=
{
args
:
{
args
:
{
data
:
{
id
:
1
,
id
:
1
,
isCompleted
:
true
,
isCompleted
:
true
,
task
:
'Buy groceries'
task
:
'Buy groceries'
}
},
},
}
}
...
...
components/layout/List/List.tsx
View file @
10e7ea90
...
@@ -14,7 +14,7 @@ const ListItem: React.FC<ListItemProps> = ({ data, onDelete, updateTask }) => {
...
@@ -14,7 +14,7 @@ const ListItem: React.FC<ListItemProps> = ({ data, onDelete, updateTask }) => {
return
(
return
(
<
Item
<
Item
key=
{
item
.
id
}
key=
{
item
.
id
}
data=
{
item
}
{
...
item
}
onDelete=
{
onDelete
}
onDelete=
{
onDelete
}
updateTask=
{
updateTask
}
updateTask=
{
updateTask
}
/>
/>
...
...
db.json
View file @
10e7ea90
...
@@ -12,8 +12,13 @@
...
@@ -12,8 +12,13 @@
},
},
{
{
"task"
:
"sdf"
,
"task"
:
"sdf"
,
"isCompleted"
:
fals
e
,
"isCompleted"
:
tru
e
,
"id"
:
7
"id"
:
7
},
{
"task"
:
"new dev another"
,
"isCompleted"
:
false
,
"id"
:
8
}
}
]
]
}
}
\ No newline at end of file
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