You don't have access to this class

Keep learning! Join and start boosting your career

Aprovecha el precio especial y haz tu profesión a prueba de IA

Antes: $249

Currency
$209
Suscríbete

Termina en:

1 Días
17 Hrs
47 Min
41 Seg

Code review: Entregando la Prueba

8/9
Resources

How to create a "My Account" view in an application?

Creating a "My Account" view for an application is essential to enable users to manage their personal information easily and efficiently. In this section, we will explore the essential steps to achieve this, from adjusting pre-existing details to implementing data editing functionality.

Step 1: Adjusting pre-existing data

Before creating new functionality, it is crucial to adjust and update any pre-existing data or text in the application. A notable example is:

  • Update a "burned" email: change any fictitious or static data, such as an email, to reflect real information from your data storage (often located in local storage).

Step 2: Create the "My Account" page

The essence of a "My Account" page lies in providing both a view of the user's data and the option to edit it. The steps are as follows:

  • Conditional rendering: Use techniques such as conditional rendering to toggle between displaying information or editing forms depending on the state of the interface.
  • User interaction: Implements buttons and actions, such as an "Edit" button, which when pressed, changes the interface to display an edit form similar to the one used when creating an account.

How to implement a form to edit data?

In this section, it is vital to provide a functional form that allows the user to modify their information efficiently. The form should include:

  • Inputs and labels: Provide input fields with explanatory labels for each piece of data that the user can modify.
  • Action button: Include a button with a clear action that confirms the editing of the data, updating both the interface and any underlying storage.
// Representation of the component for editing user informationfunction renderEditUserInfo() { return ( <form> <label>Name:</label> <input type="text"  value={user.name}/> <label>Email:</label> <input type="email"  value={user.email}/> <buttononClick={handleEdit}>Edit</button> </form> );}

Aesthetic and functional improvements.

Beyond basic functionality, small tweaks can improve appearance and usability:

  • Text alignment: Use tools such as Flexbox to vertically center text or elements on cards, ensuring a uniform presentation.
  • Change navbar background: With Tailwind utility, e.g. bg-white, to ensure that items in the navbar are always visible when scrolling.

Conclusion and next steps

It is always advisable to review and test different approaches for any technical solution, adapting the logic according to specific needs and coding style. And don't forget that these practices and adjustments contribute significantly to improve the user experience in your application. Keep learning and developing!

Contributions 14

Questions 1

Sort by:

Want to see more contributions, questions and answers from the community?

Encontré un error y es que al filtar por Furnitures no filtra los items. La API los encuentra por Furniture, sin la S.

Quisiera dejar por acá mi idea de diseño para la página My Account:
.
Cree una vista con un botón de edit para cada campo, cuando este es clickeado, el texto se transforma en un input que permite setear la info:

.
.

.
.

¡Hola a todos! 👋 Quiero compartirles que la API original del curso está rota, lo que puede dificultar completar los ejercicios. Para ayudarles, he creado una versión funcional del proyecto base con una nueva API y código actualizado. 🚀 Pueden clonar este repositorio para seguir el curso sin problemas: 👉 <<https://github.com/darubiomunoz/prueba-tecnica-reactjs>> Además, si les resulta útil, no olviden darle una estrella ⭐ al repositorio y seguirme en GitHub. ¡Espero que les sea de ayuda y puedan completar el curso con éxito! 💚 ¡Happy coding! 💻
![](https://static.platzi.com/media/user_upload/image-76d88636-9055-4ae5-8602-4e35c8f99400.jpg) Habilite el Home pero con la condicion de que si agrega un produto al carrito y quiere comprarlo debe iniciar sesion! en caso de hacer click lo direcciona al sign-in
✨🦄 Considero que la sección de MyAccount debía estar dentro del primer issue, ya que está relacionado mucho con las páginas de Log In y Sign Up. Pero esta es la manera en que desarrollé esta sección n.n ![](https://static.platzi.com/media/user_upload/image-a19606dd-849d-4342-9860-32425fc66282.jpg) ![](https://static.platzi.com/media/user_upload/image-aced30c8-40cf-4b2b-9da6-2f8c110f038c.jpg) Cada cosa con su validación :3 ![](https://static.platzi.com/media/user_upload/image-c1fa8593-e9c4-4735-9525-b8fedb87dc2a.jpg)
Yo lo que hice fue utilizar el código que ya tenia para crear un usuario, lo extraje e hice un componente el cual cambia el valor del botón "Create/Edit" según donde sea llamado. Capaz abuso del useState un poco o no ? ![](https://static.platzi.com/media/user_upload/image-13950524-0a73-46ea-92a5-ab64f9c7f531.jpg)En el context ![](https://static.platzi.com/media/user_upload/image-05b9ed00-e97a-44bc-bd38-dfe3b85a98de.jpg)Y el resto seria con el onClick hacer el cambio con setText y utilizar otro estado para el render. Ej de MyAccount ![](https://static.platzi.com/media/user_upload/image-b88bc8f6-46d8-49dc-a58d-9ce851e24c0d.jpg)![](https://static.platzi.com/media/user_upload/image-7efd699a-bebc-49bd-b0c7-630d0919fa76.jpg)

Así quedó mi route “My Account”:

Cuando el state view sea igual a “edit-user-info” agrego un button al lado del título con el cual puedo volver “user-info” por si algún usuario se arrepiente de editar su cuenta.

A la teacher se le fue el sonido

Les comparto como me quedo: ![](https://static.platzi.com/media/user_upload/image-9a29ed53-7eaa-4f98-b914-0a1a78bfaff9.jpg)

La categoria “Toys” no funciona, al parecer no hay productos en la Fake Store con esa categoria porque no existe.

Mi solucion fue cambiar a Shoes…

me parece muy interesante para implementar el despliegue de navbar en la app de mercadoLibre. Si haces scroll para abajo el navbar desaparece para dar mas espacio a los productos. Pero si haces scroll para arriba vuelve a aparecer el navbar.

Bueno les dejo como quedo el proyecto
Code Github
y el demo
Demo live

Comparto como me quedó la sección de MyAccount (En el navbar coloco el primer nombre del usuario):

yo lo hize de esta manera funciona todo pero al agregar una dirección en el url o recargarlo me sale pagina no encontrada, alguien podría revisar mi codigo y decirme como puedo solucionarlo https://github.com/anonimussapee/shopiLab