You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: exercises/03.2-a-real-component/README.es.md
+4-5Lines changed: 4 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
# `03.2`Un componente real
1
+
# `03.2` A real component
2
2
3
-
En el ejericio anterior hemos creado nuestro primer componente llamado **PrintHello** y hemos aprendido que podemos usar el componente como una etiqueta HTML.
3
+
En el ejericio anterior hemos creado nuestro primer componente llamado **PrintHello**, y hemos aprendido que podemos usar el componente como una etiqueta HTML.
4
4
5
5
```jsx
6
6
<PrintHello />
@@ -18,13 +18,12 @@ Ahora, vamos a crear un nuevo componente (función) llamado **`<BootstrapCard />
18
18
</div>
19
19
</div>
20
20
```
21
-
🔎
22
-
Este código HTML está basado en la [Bootstrap Card](https://getbootstrap.com/docs/4.0/components/card/).
21
+
Nota: Este código HTML está basado en la [Bootstrap Card](https://getbootstrap.com/docs/4.0/components/card/).
23
22
24
23
## 📝 Instrucciones:
25
24
26
25
1. Por favor, crea una función llamada `BootstrapCard` que devuelva el código de la card y usa la función `ReactDOM.render` para añadir `<BootstrapCard />` dentro del sitio web, dentro de `#myDiv`.
27
26
28
27
## 💡 Pista:
29
28
30
-
* Si no sabes o no recuerdas cómo usar `ReactDOM.render`, puedes revisar los ejercicios anteriores.
29
+
+ Si no sabes o no recuerdas cómo usar `ReactDOM.render`, puedes revisar los ejercicios anteriores.
In the past exercise we created our first component called **`PrintHello`** and we learn that we can use the component like an HTML tag.
7
+
In the past exercise we created our first component called **`PrintHello`**, and we have learned that we can use the component like an HTML tag.
8
8
9
9
```jsx
10
10
<PrintHello />
@@ -23,12 +23,12 @@ Now let's create another component (function) called **`<BootstrapCard />`** tha
23
23
</div>
24
24
```
25
25
26
-
> 🔎 This HTML code its based on the [Bootstrap Card](https://getbootstrap.com/docs/4.0/components/card/).
26
+
Note: This HTML code its based on the [Bootstrap Card](https://getbootstrap.com/docs/4.0/components/card/).
27
27
28
-
## 📝 Instructions
28
+
## 📝 Instructions:
29
29
30
30
1. Please create a function called `BootstrapCard` that returns the card code and use the `ReactDOM.render` function `<BootstrapCard />` to add it into the website inside `#myDiv`.
31
31
32
32
## 💡 Hint:
33
33
34
-
* if you don't know or remember how to use `ReactDOM.render` you can review the past exercises.
34
+
+ If you don't know or remember how to use `ReactDOM.render` you can review the past exercises.
Copy file name to clipboardExpand all lines: exercises/03.3-component-properties/README.es.md
+14-12Lines changed: 14 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
-
# `03.3`Propiedades de un componente
1
+
# `03.3`Component Properties
2
2
3
-
La BootstrapCard que acabas de hacer está [hard coded](https://es.quora.com/Qu%C3%A9-significa-en-computacion-hard-coded) para **Bob Dylan** únicamente.
3
+
La `BootstrapCard` que acabas de hacer está [hard coded](https://es.quora.com/Qu%C3%A9-significa-en-computacion-hard-coded) para **Bob Dylan** únicamente.
4
4
5
-
Pero, ¿qué pasa si queremos reutilizar el componente `<BootstrapCard />` para **Paul Mccartney** o cualquier otra persona? ¿Cómo podriamos hacer? ¡Usar propiedades!
5
+
Pero, ¿qué pasa si queremos reutilizar el componente `<BootstrapCard />` para **Paul Mccartney** o cualquier otra persona? ¿Cómo podriamos hacer? ¡Usa propiedades!
6
6
7
7
## Usando propiedades en HTML
8
8
@@ -15,11 +15,11 @@ Cuando usas la etiqueta **anchor** (`<a>`) tienes que especificar la propiedad *
15
15
<ahref="http://twitter.com">Take me to twitter</a>
16
16
```
17
17
18
-
🔎 Aquí estoy reutilizando la etiqueta de enlace(<a>) en dos enlaces diferentes
18
+
Nota: Aquí estoy reutilizando la etiqueta de enlace (`<a>`) en dos enlaces diferentes
19
19
20
20
> Usando propiedades en React.js
21
21
22
-
>En React.js también podemos crear nuestras propias etiquetas y usar nuestras propias propiedades inventadas. Por ejemplo, podríamos especificar la propiedad `title` de nuestra `<BootstrapCard />` de esta forma:
22
+
En React.js también podemos crear nuestras propias etiquetas y usar nuestras propias propiedades inventadas. Por ejemplo, podríamos especificar la propiedad `title` de nuestra `<BootstrapCard />` de esta forma:
Para trabajar con propiedades de componentes, tienes que especificar qué propiedades recibirá el componente (nombre y tipo de dato de cada propiedad), [puedes leer más sobre las prop-types aquí](https://reactjs.org/docs/typechecking-with-proptypes.html). e.g:
44
+
Para trabajar con propiedades de componentes, tienes que especificar qué propiedades recibirá el componente (nombre y tipo de dato de cada propiedad), [puedes leer más sobre las prop-types aquí](https://reactjs.org/docs/typechecking-with-proptypes.html).
45
+
46
+
Por ejemplo:
45
47
46
48
```js
47
49
// aquí estamos especificando que este componente recibirá la propiedad "title" y será un string.
@@ -54,14 +56,14 @@ BootstrapCard.propTypes = {
54
56
55
57
1. Por favor, agrega/usa las propiedades `imageUrl`, `description`, `buttonUrl` y `buttonLabel` dentro de la función `BootstrapCard` y también en la etiqueta `<BootstrapCard />` (Con la información de Bob Dylan que trae por defecto). Hazlo de la misma manera en que `title` ha sido incluida en ambas.
56
58
57
-
## 💡 Pista:
59
+
## 💡 Pistas:
58
60
59
-
* Tienes que editar 3 partes del archivo (verifica los comentarios para ayudarte).
61
+
+ Tienes que editar 3 partes del archivo (verifica los comentarios para ayudarte).
60
62
61
-
* El primer paso es reemplazar las cosas escritas directamente por las propiedades del componente.
63
+
+ El primer paso es reemplazar las cosas escritas directamente por las propiedades del componente.
62
64
63
-
* El segundo paso es definir esas propiedades en el objeto prop-types en la línea 23, [aquí un video de cómo hacerlo](https://www.youtube.com/watch?v=oty7VGcXK44).
65
+
+ El segundo paso es definir esas propiedades en el objeto prop-types en la línea 23, [aquí un video de cómo hacerlo](https://www.youtube.com/watch?v=oty7VGcXK44).
64
66
65
-
* El tercer paso será usar ReactDOM para añadir la declaración de la etiqueta `<BootstrapCard>` incluyendo las 5 propiedades y sus respectivos valores.
67
+
+ El tercer paso será usar ReactDOM para añadir la declaración de la etiqueta `<BootstrapCard>` incluyendo las 5 propiedades y sus respectivos valores.
66
68
67
-
* No tienes que renderizar el componente muchas veces, solo una.
69
+
+ No tienes que renderizar el componente muchas veces, solo una.
Copy file name to clipboardExpand all lines: exercises/03.3-component-properties/README.md
+12-10Lines changed: 12 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ But, what if we also want to re-use the same `<BootstrapCard />` component for *
10
10
11
11
## Using properties in HTML
12
12
13
-
When you are coding HTML you are constantly using the `<tag>` properties to modify the tag behavior, e.g.:
13
+
When you are coding HTML you are constantly using the `<tag>` properties to modify the tag behavior, for example:
14
14
15
15
When you use the **anchor** tag (`<a>`) you have to specify the **href** property like this:
16
16
@@ -19,11 +19,11 @@ When you use the **anchor** tag (`<a>`) you have to specify the **href** propert
19
19
<ahref="http://twitter.com">Take me to twitter</a>
20
20
```
21
21
22
-
:mag_right: Here I'm re-using the anchor tag for two different links
22
+
Note: Here I'm re-using the anchor tag (`<a>`) for two different links
23
23
24
24
> Using properties in React.js
25
25
26
-
> In React.js we also can create our own tags and use our own invented properties, for example we could specify the `title` property of our `<BootstrapCard />` like this:
26
+
In React.js we also can create our own tags and use our own invented properties, for example we could specify the `title` property of our `<BootstrapCard />`, like this:
To be able to work with component properties, you have to specify what properties the component will receive (the name and data-type of each property), [here you can read more about prop-types](https://reactjs.org/docs/typechecking-with-proptypes.html). E.g:
48
+
To be able to work with component properties, you have to specify what properties the component will receive (the name and data-type of each property), [here you can read more about prop-types](https://reactjs.org/docs/typechecking-with-proptypes.html).
49
+
50
+
For example:
49
51
50
52
```jsx
51
53
// here we are specifying that this component will receive the property "title" and it will be a string.
@@ -58,14 +60,14 @@ BootstrapCard.propTypes = {
58
60
59
61
1. Please add/use the `imageUrl`, `description`, `buttonUrl` and `buttonLabel` properties inside the `BootstrapCard` function and also on the `<BootstrapCard />` tag (With Bob Dylan's information that has by default). Do it the same way `title` was already included in both.
60
62
61
-
## 💡 Hint:
63
+
## 💡 Hints:
62
64
63
-
* You have to edit 3 parts of the file (check the comments for help).
65
+
+ You have to edit 3 parts of the file (check the comments for help).
64
66
65
-
* The first step will be to replace the hardcoded stuff with properties inside the component.
67
+
+ The first step will be to replace the hardcoded stuff with properties inside the component.
66
68
67
-
* The second step will be to define those properties in the prop-types object on line 23, [here is a video on how to do it](https://www.youtube.com/watch?v=oty7VGcXK44).
69
+
+ The second step will be to define those properties in the prop-types object on line 23, [here is a video on how to do it](https://www.youtube.com/watch?v=oty7VGcXK44).
68
70
69
-
* The third step will be to use ReactDOM to add the `<BootstrapCard>` tag declaration including the 5 properties and their respective values.
71
+
+ The third step will be to use ReactDOM to add the `<BootstrapCard>` tag declaration including the 5 properties and their respective values.
70
72
71
-
* You don't have to render the component two times, just once.
73
+
+ You don't have to render the component two times, just once.
1. Por favor, crea un componente `<Alert />` que reciba 1 prop `text: Proptype.string` y renderice una [bootstrap alert](https://getbootstrap.com/docs/4.0/components/alerts/#examples) como la siguiente:
8
-
9
-
## 💡 Pista:
10
-
11
-
Así es como deberías usar el componente:
5
+
## 📝 Instrucciones:
12
6
13
-
```jsx
14
-
<Alert text="OMG! Something really bad has happended!"/>
15
-
```
7
+
1. Por favor, crea un componente `<Alert />` que reciba 1 prop `text: Proptype.string` y renderice una [bootstrap alert](https://getbootstrap.com/docs/4.0/components/alerts/#examples) como la siguiente:
16
8
17
-
###Resultado esperado:
9
+
## Resultado esperado:
18
10
19
11
Esto es lo que el componente debería generar en el HTML:
20
12
21
13
```html
22
14
<divclass="alert alert-danger"role="alert">
23
15
OMG! Something really bad has happended!
24
16
</div>
25
-
```
17
+
```
18
+
19
+
## 💡 Pista:
20
+
21
+
+ Así es como deberías usar el componente:
22
+
23
+
```jsx
24
+
<Alert text="OMG! Something really bad has happended!"/>
1. Please create an `<Alert />` component that receives 1 prop `text: Proptype.string` and renders a [bootstrap alert](https://getbootstrap.com/docs/4.0/components/alerts/#examples) like the following:
12
-
13
-
## 💡 Hint:
14
-
15
-
This is how the component will be used:
9
+
## 📝 Instructions:
16
10
17
-
```jsx
18
-
<Alert text="OMG! Something really bad has happended!"/>
19
-
```
11
+
1. Please create an `<Alert />` component that receives 1 prop `text: Proptype.string` and renders a [bootstrap alert](https://getbootstrap.com/docs/4.0/components/alerts/#examples) like the following:
20
12
21
13
## Expected Result:
22
14
@@ -26,4 +18,11 @@ This is What the component should output as HTML:
26
18
<divclass="alert alert-danger"role="alert">
27
19
OMG! Something really bad has happended!
28
20
</div>
29
-
```
21
+
```
22
+
## 💡 Hint:
23
+
24
+
+ This is how the component should be used:
25
+
26
+
```jsx
27
+
<Alert text="OMG! Something really bad has happended!"/>
Copy file name to clipboardExpand all lines: exercises/04-conditional-rendering/README.es.md
+9-6Lines changed: 9 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
# `04`Renderizado condicional
1
+
# `04`Conditional Rendering
2
2
3
-
También puedes usar las propiedades de un componente para cambiar su comportamiento, como mostrar u ocultar `<Alert />` según una propiedad llamada `show`.
3
+
También puedes usar las propiedades de un componente para cambiar su comportamiento y como mostrar u ocultar `<Alert />`, según una propiedad llamada `show`.
4
4
5
5
```jsx
6
6
{/* Esto hará que tu alerta se muestre */}
@@ -23,13 +23,16 @@ const Alert = (props) => {
23
23
};
24
24
```
25
25
26
-
☝️ Devolver distinto código HTML según ciertas condiciones es llamado formalmente [renderizado condicional](https://joshblog.net/2018/conditional-rendering-with-react-and-jsx/).
26
+
Nota: ☝️ Devolver distinto código HTML según ciertas condiciones es llamado formalmente [renderizado condicional](https://joshblog.net/2018/conditional-rendering-with-react-and-jsx/).
27
27
28
-
## 📝 Instrucciones
28
+
## 📝 Instrucciones:
29
29
30
30
1. Crea un componente `<Alert />` que renderice una [bootstrap alert](https://getbootstrap.com/docs/4.0/components/alerts/#examples).
31
31
32
+
## 💡 Pista:
33
+
32
34
El componente debe ser capaz de recibir las siguientes dos propiedades:
33
35
34
-
- show (bool): True or false.
35
-
- text (string): El mensaje a incluir dentro del mensaje del `<Alert />`.
36
+
+ Show (bool): veradero o falso.
37
+
38
+
+ Text (string): El mensaje a incluir dentro del mensaje del `<Alert />`.
Copy file name to clipboardExpand all lines: exercises/04-conditional-rendering/README.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,14 +27,16 @@ const Alert = (props) => {
27
27
};
28
28
```
29
29
30
-
☝️ Returning different HTML code based on conditions its formally called [conditional rendering](https://joshblog.net/2018/conditional-rendering-with-react-and-jsx/).
30
+
Note: ☝️ Returning different HTML code based on conditions its formally called [conditional rendering](https://joshblog.net/2018/conditional-rendering-with-react-and-jsx/).
31
31
32
32
## 📝 Instructions:
33
33
34
34
1. Create an `<Alert />` component that renders a [bootstrap alert](https://getbootstrap.com/docs/4.0/components/alerts/#examples).
35
35
36
+
## 💡 Hint:
37
+
36
38
The component must be able to receive the following 2 properties:
37
39
38
-
- show (bool): True or false.
40
+
+ Show (bool): True or false.
39
41
40
-
- text (string): The message to include inside the alert message
42
+
+ Text (string): The message to include inside the alert message.
0 commit comments