forked from platzi/curso-react-intro
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
90 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from "react"; | ||
import {TodoIcon} from './TodoIcon'; | ||
function IconCheck({onComplete}){ | ||
return ( | ||
<TodoIcon | ||
type="check" | ||
onClick={onComplete} | ||
/> | ||
) | ||
} | ||
export {IconCheck} | ||
|
||
|
||
|
||
// import React from 'react';import{TodoIcon}from './TodoIcon'; | ||
|
||
// function CompleteIcon({completed,onComplete}){return(<TodoIcon | ||
// type="check" | ||
// color={completed?'green':'gray'} | ||
// onClick={onComplete}/>);} | ||
// export{CompleteIcon}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from "react"; | ||
import {TodoIcon} from "./TodoIcon"; | ||
function IconDelete({onDelete}){ | ||
return ( | ||
<TodoIcon | ||
type="delete" | ||
onClick={onDelete} | ||
/> | ||
) | ||
} | ||
export {IconDelete} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from "react"; | ||
import { ReactComponent as CheckSVG} from './Icons/check.svg' | ||
import { ReactComponent as DeleteSVG} from './Icons/delete.svg' | ||
|
||
const iconTypes={"check":<CheckSVG/>,"delete":<DeleteSVG/>,} | ||
function TodoIcon({type, onClick}){ | ||
return( | ||
<span className={`Icon Icon-svg Icon-${type}`} onClick={onClick} > | ||
{iconTypes[type]} | ||
</span> | ||
) | ||
} | ||
export {TodoIcon}; | ||
|
||
|
||
|
||
// import{ReactComponent as CheckSVG}from './check.svg';import{ReactComponent as DeleteSVG}from './delete.svg';import './TodoIcon.css';const iconTypes={"check":(color)=><CheckSVG className="Icon-svg"fill={color}/>,"delete":(color)=><DeleteSVG className="Icon-svg"fill={color}/>,}; | ||
|
||
|
||
// function TodoIcon({type,color,onClick}){return(<span | ||
// className={`Icon-container Icon-container-${type}`} | ||
// onClick={onClick}>{iconTypes[type](color)}</span>)} | ||
// export{TodoIcon}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
import "./TodoItem.css" | ||
import { IconCheck } from './IconCheck' | ||
import { IconDelete } from './IconDelete' | ||
|
||
function TodoItem(props){ | ||
return( | ||
<li className={`TodoIteM ${props.completed && "Icon-check-active"}`}> | ||
<span className={`Icon Icon-check`} onClick={props.onComplete}> V </span> | ||
{/* <span className={`Icon Icon-check`} onClick={props.onComplete}> V </span> */} | ||
<IconCheck onComplete={props.onComplete}/> | ||
<p className={`TodoItem-p TodoItem-p--complete`}>{props.text}</p> | ||
<span className='Icon Icon-delete' onClick={props.onDelete}>X </span> | ||
<IconDelete onDelete={props.onDelete}/> | ||
|
||
{/* <span className='Icon Icon-delete' onClick={props.onDelete}>X </span> */} | ||
</li> | ||
); | ||
} | ||
export { TodoItem}; | ||
export { TodoItem}; |