Skip to content

Commit

Permalink
v3 Patch 1
Browse files Browse the repository at this point in the history
added ticking options
  • Loading branch information
yunusparvezkhan committed May 14, 2023
1 parent cc556f2 commit dc54d02
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function App() {
<div className="task-list" >
<TaskList tasks={tasks} deleteTaskById={deleteTaskById} />
</div>
<h1 className="title" >Niyoga</h1>
<h1 className="title">Niyoga</h1>
<TaskCreate onCreate={createTask} />
</div>
);
Expand Down
11 changes: 9 additions & 2 deletions src/components/TaskCard.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import React from 'react';
import React, { useState } from 'react';


const TaskCard = ({ task, deleteTaskById, slnum }) => {
const [active, setActive] = useState('');

const clickHandler = () => {
active === '' ? setActive('active') : setActive('');
}

return (
<div>
<div className='book-show'>
<div onClick={clickHandler} className={`book-show ${active}`}>
<b>{slnum}. </b>
{task.title}
<div className='actions'>
Expand Down
3 changes: 2 additions & 1 deletion src/styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@
border-radius: 5px;
margin: 10px;
padding: 20px;
width: 300px
width: 300px;
cursor: pointer;
}

.book-edit {
Expand Down
4 changes: 4 additions & 0 deletions src/styles/stylelib.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,8 @@
width: 100%;
height: 100%;
/* background-color: red; */
}

.active {
background-color: aquamarine;
}

0 comments on commit dc54d02

Please sign in to comment.