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
6df9de60
Commit
6df9de60
authored
Jun 07, 2024
by
Sakilesh J
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix in types
parent
10e7ea90
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
7 deletions
+11
-7
todoTypes.ts
Types/todoTypes.ts
+6
-0
Item.tsx
components/Top-Level/Item/Item.tsx
+2
-3
List.tsx
components/layout/List/List.tsx
+3
-4
No files found.
Types/todoTypes.ts
View file @
6df9de60
...
@@ -3,3 +3,8 @@ export type TodoListItems = {
...
@@ -3,3 +3,8 @@ export type TodoListItems = {
task
:
string
;
task
:
string
;
isCompleted
:
boolean
;
isCompleted
:
boolean
;
}
}
export
interface
TodoMethods
{
onDelete
:
(
id
:
number
)
=>
void
;
updateTask
:
(
id
:
number
,
task
:
string
,
isCompleted
:
boolean
)
=>
void
;
}
\ No newline at end of file
components/Top-Level/Item/Item.tsx
View file @
6df9de60
...
@@ -4,14 +4,13 @@ import styles from './item.module.css'
...
@@ -4,14 +4,13 @@ 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
{
TodoMethods
}
from
'@/Types/todoTypes'
;
interface
ItemProps
{
interface
ItemProps
extends
TodoMethods
{
id
:
number
;
id
:
number
;
task
:
string
;
task
:
string
;
isCompleted
:
boolean
;
isCompleted
:
boolean
;
onDelete
:
(
id
:
number
)
=>
void
;
updateTask
:
(
id
:
number
,
task
:
string
,
isCompleted
:
boolean
)
=>
void
;
}
}
const
Item
:
React
.
FC
<
ItemProps
>
=
({
onDelete
,
updateTask
,
id
,
isCompleted
,
task
})
=>
{
const
Item
:
React
.
FC
<
ItemProps
>
=
({
onDelete
,
updateTask
,
id
,
isCompleted
,
task
})
=>
{
...
...
components/layout/List/List.tsx
View file @
6df9de60
import
Item
from
"@/components/Top-Level/Item/Item"
;
import
Item
from
"@/components/Top-Level/Item/Item"
;
import
styles
from
"./list.module.css"
;
import
styles
from
"./list.module.css"
;
import
{
TodoListItems
}
from
"@/Types/todoTypes"
;
import
{
TodoListItems
,
TodoMethods
}
from
"@/Types/todoTypes"
;
interface
ListItemProps
{
interface
ListItemProps
extends
TodoMethods
{
data
:
TodoListItems
[];
data
:
TodoListItems
[];
onDelete
:
(
id
:
number
)
=>
void
;
updateTask
:
(
id
:
number
,
task
:
string
,
isCompleted
:
boolean
)
=>
void
;
}
}
const
ListItem
:
React
.
FC
<
ListItemProps
>
=
({
data
,
onDelete
,
updateTask
})
=>
{
const
ListItem
:
React
.
FC
<
ListItemProps
>
=
({
data
,
onDelete
,
updateTask
})
=>
{
return
(
return
(
...
...
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