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

Ch19 challenge #11

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
37 changes: 22 additions & 15 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
import logo from './platzi.webp';
// import logo from './platzi.webp';
// un componente en React se tiene que importar como un objeto
import { TodoCounter } from './TodoCounter';
import { TodoSearch } from './TodoSearch';
import { TodoList } from './TodoList';
import {TodoItem} from './TodoItem';
import { CreateTodoButton } from './CreateTodoButton';

import './App.css';

function App() {
return (
// Fijense que al momento de crear la aplicacion se colocan todos los componentes para declararlos y saber o tener una idea de como se va a crear la aplicacion
<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>
{/* se usa KebabCase para la creacion y denominacion de componentes */}
<TodoCounter />
<TodoSearch />

<TodoList>
<TodoItem />
<TodoItem />
</TodoList>
{/* clase 2 creando la aplicacion */}
<CreateTodoButton />
</div>
);
}




export default App;
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>Crear Tarea</button>
)
};

export {CreateTodoButton};
9 changes: 9 additions & 0 deletions src/TodoCounter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function TodoCounter(){
return (
<h1>Tienes que hacer x tareas</h1>

)
}

// Se tiene que exportar el componente y colocar como se va a exportar
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(){
return (
<li>
<span>V</span>
<p>Tarea Tarea</p>
<span>X</span>
</li>
)
}

export {TodoItem};
10 changes: 10 additions & 0 deletions src/TodoList.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
function TodoList(props){
return (
<ul>
{/* Se deben colocar las propiedades necesarias apra tener los hijos en el componente */}
{props.children}
</ul>
);
};

export {TodoList};
7 changes: 7 additions & 0 deletions src/TodoSearch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function TodoSearch(){
return (
<input type="text" placeholder="Tarea" />
)
};

export {TodoSearch};