Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

props #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
props
  • Loading branch information
[email protected] committed May 5, 2023
commit b47696be4a98558111fee94f886d73e852537c22
16,322 changes: 39 additions & 16,283 deletions package-lock.json

Large diffs are not rendered by default.

50 changes: 32 additions & 18 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,38 @@
import logo from './platzi.webp';
import './App.css';
import logo from "./platzi.webp";
import "./App.css";
import { TodoCounter } from "./TodoCounter";
import { TodoSearch } from "./TodoSearch";
import { TodoList } from "./TodoList";
import { TodoItem } from "./TodoItem";
import { CreateTodoButton } from "./CreateTodoButton";
import React from "react";

const defaultTodos = [
{ text: "Cut onion", completed: true },
{ text: "Take React Course introduce", completed: true },
{ text: "Cry with Llorona ", completed: true },
{ text: "LALALALAAL", completed: true },
];

function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edita el archivo <code>src/App.js</code> y guarda para recargar.
</p>
<a
className="App-link"
href="https://platzi.com/reactjs"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
<React.Fragment>
<TodoCounter completed={16} total={25} />
<TodoSearch />

<TodoList>
{defaultTodos.map(todo => (
<TodoItem
key={todo.text}
text={todo.text}
completed={todo.completed}
/>
))}
</TodoList>


<CreateTodoButton />
</React.Fragment>
);
}

7 changes: 7 additions & 0 deletions src/CreateTodoButton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function CreateTodoButton() {
return(
<button>+</button>
)
}

export {CreateTodoButton}
14 changes: 14 additions & 0 deletions src/TodoCounter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*function TodoCounter(porp) {
porp.completed
porp.total
*/

function TodoCounter({total, completed}) {

return(
<h1> You have completed {completed} of {total} all</h1>
)
}


export {TodoCounter}
11 changes: 11 additions & 0 deletions src/TodoItem.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
function TodoItem(props) {
return (
<li>
<samp>v</samp>
<p>{props.text}</p>
<samp>X</samp>
</li>
);
}

export { TodoItem };
4 changes: 4 additions & 0 deletions src/TodoList.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
function TodoList({ children }) {
return <ul>{children}</ul>;
}
export {TodoList}
5 changes: 5 additions & 0 deletions src/TodoSearch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function TodoSearch() {
return <input placeholder="enter you chose"></input>;
}

export { TodoSearch };