Skip to content

Commit

Permalink
Agregamos css a nuestros botones
Browse files Browse the repository at this point in the history
  • Loading branch information
MatiRivarola committed Jun 8, 2023
1 parent f87efcb commit e27e9e7
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 29 deletions.
23 changes: 7 additions & 16 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -153,37 +153,28 @@
display: flex;
justify-content: center;
align-items: center;
height: 48px;
width: 48px;
height: 43px;
width: 37px;
font-size: 24px;
font-weight: bold;
}


.icon-check{
position: absolute;
left: 12px;
}

.icon-check:hover{
color: green;
}

.icon-check--active{
color: green;
}


.icon-delete{
position: absolute;
top: -20px;
right: -5px;
}

.icon-delete:hover{
color: red;
.icon-delete:hover .icon-svg{
fill: red;
}

.icon-svg{
width: 24px;
height: 24px;
.icon-check:hover .icon-svg{
fill: green;
}
6 changes: 3 additions & 3 deletions src/CompleteIcon.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from "react";
import { TodoIcon } from "./TodoIcon";

import { BiCheck } from "react-icons/bi";

function CompleteIcon() {
function CompleteIcon( { completed ,onComplete} ) {
return (
<TodoIcon
type="check"
color="gray"
color= {completed ? "green": "gray"}
onClick={onComplete}
/>
)

Expand Down
5 changes: 3 additions & 2 deletions src/DeleteIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import React from "react";
import { TodoIcon } from "./TodoIcon";


function DeleteIcon(){
function DeleteIcon( {onDelete} ){
return (
<TodoIcon
type="delete"
color="red"
color="grey"
onClick={onDelete}
/>
);
}
Expand Down
15 changes: 9 additions & 6 deletions src/TodoIcon.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
import { AiOutlineDelete } from "react-icons/ai";
import { TiDeleteOutline } from "react-icons/ti";
import { BiCheck } from "react-icons/bi";

const iconTypes = {
"check": <BiCheck/>,
"delete":<AiOutlineDelete/>,
"check": (color) => <BiCheck
className="icon-svg" fill={color}/>,
"delete": (color) => <TiDeleteOutline
className="icon-svg" fill={color}/>,
};

function TodoIcon( {type} ) {
function TodoIcon( {type, color ,onClick } ) {
return(
<span
className= {`icon icon-svg icon-${type}`}
className= {`icon icon-${type}`}
onClick = {onClick}
>
{iconTypes[type]}
{iconTypes[type](color)}
</span>
)
}
Expand Down
9 changes: 7 additions & 2 deletions src/TodoItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,16 @@ function TodoItem(props){
return (
<li className='todo-item'>

<CompleteIcon/>
<CompleteIcon
completed={props.completed}
onComplete={props.onComplete}
/>

<p className={`todo-item-p ${props.completed && "todoItem-p-completed"}`} > {props.text} </p>

<DeleteIcon/>
<DeleteIcon
onDelete={props.onDelete}
/>

</li>
);
Expand Down

0 comments on commit e27e9e7

Please sign in to comment.