From b11ef659e40a4a87f323ef1fd1a985f8317f4c84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20N=C3=BA=C3=B1ez?= <124943644+JLeonN@users.noreply.github.com> Date: Mon, 22 Apr 2024 18:26:56 -0300 Subject: [PATCH 1/9] Boton whatsapp --- frontend/src/App.css | 2 ++ frontend/src/Componentes/Cpmpartir.jsx | 15 +++++++++++++++ frontend/src/Componentes/Tarjeta/Tarjeta.jsx | 7 ++++++- 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 frontend/src/Componentes/Cpmpartir.jsx diff --git a/frontend/src/App.css b/frontend/src/App.css index 4b762d3..180fa29 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -297,3 +297,5 @@ span { text-decoration: none; color: var(--texto); } + +/* Componente cpmpartir */ diff --git a/frontend/src/Componentes/Cpmpartir.jsx b/frontend/src/Componentes/Cpmpartir.jsx new file mode 100644 index 0000000..1134d4f --- /dev/null +++ b/frontend/src/Componentes/Cpmpartir.jsx @@ -0,0 +1,15 @@ +import { Link } from "react-router-dom"; + +const Cpmpartir = () => { + return ( + <> + + + + + ); +}; + +export default Cpmpartir; diff --git a/frontend/src/Componentes/Tarjeta/Tarjeta.jsx b/frontend/src/Componentes/Tarjeta/Tarjeta.jsx index 6584501..c585821 100644 --- a/frontend/src/Componentes/Tarjeta/Tarjeta.jsx +++ b/frontend/src/Componentes/Tarjeta/Tarjeta.jsx @@ -1,3 +1,5 @@ +import Cpmpartir from "../Cpmpartir"; + const TarjetaTonta = ({ nombre, total, titulos }) => { return (
@@ -20,11 +22,14 @@ const TarjetaTonta = ({ nombre, total, titulos }) => { Titulos totales:{" "} {titulos.length} -
+

Titulos:{" "} {titulos.join(", ")}

+
+ +
From 99fa26eea1a6ed5eed50e1d980e1e99e8c035e5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20N=C3=BA=C3=B1ez?= <124943644+JLeonN@users.noreply.github.com> Date: Mon, 22 Apr 2024 20:08:18 -0300 Subject: [PATCH 2/9] Boton para compartir --- frontend/src/Componentes/Cpmpartir.jsx | 5 ++++- frontend/src/Componentes/Tarjeta/Tarjeta.jsx | 13 ++++++++++--- .../PerfilDeParticipante/EstructuraDePerfil.jsx | 1 + frontend/src/Pagina/Inicio.jsx | 2 ++ 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/frontend/src/Componentes/Cpmpartir.jsx b/frontend/src/Componentes/Cpmpartir.jsx index 1134d4f..218e8b6 100644 --- a/frontend/src/Componentes/Cpmpartir.jsx +++ b/frontend/src/Componentes/Cpmpartir.jsx @@ -3,7 +3,10 @@ import { Link } from "react-router-dom"; const Cpmpartir = () => { return ( <> - + diff --git a/frontend/src/Componentes/Tarjeta/Tarjeta.jsx b/frontend/src/Componentes/Tarjeta/Tarjeta.jsx index c585821..e58e639 100644 --- a/frontend/src/Componentes/Tarjeta/Tarjeta.jsx +++ b/frontend/src/Componentes/Tarjeta/Tarjeta.jsx @@ -1,6 +1,6 @@ -import Cpmpartir from "../Cpmpartir"; +import { Link } from "react-router-dom"; -const TarjetaTonta = ({ nombre, total, titulos }) => { +const TarjetaTonta = ({ nombre, total, titulos, mensaje }) => { return (
@@ -28,7 +28,14 @@ const TarjetaTonta = ({ nombre, total, titulos }) => { {titulos.join(", ")}

- + + +
diff --git a/frontend/src/Pagina/ElMasTonto/PerfilDeParticipante/EstructuraDePerfil.jsx b/frontend/src/Pagina/ElMasTonto/PerfilDeParticipante/EstructuraDePerfil.jsx index 24477bb..32b6fb0 100644 --- a/frontend/src/Pagina/ElMasTonto/PerfilDeParticipante/EstructuraDePerfil.jsx +++ b/frontend/src/Pagina/ElMasTonto/PerfilDeParticipante/EstructuraDePerfil.jsx @@ -19,6 +19,7 @@ const EstructuraDePerfil = () => { nombre={participante.nombre} total={participante.total} titulos={participante.titulos} + mensaje="Tonto seleccionado " /> {/* Lista de titulos */}
diff --git a/frontend/src/Pagina/Inicio.jsx b/frontend/src/Pagina/Inicio.jsx index 7e8f021..b609108 100644 --- a/frontend/src/Pagina/Inicio.jsx +++ b/frontend/src/Pagina/Inicio.jsx @@ -33,6 +33,7 @@ const Inicio = () => { nombre={tonto.nombre} total={tonto.total} titulos={tonto.titulos} + mensaje="Tonto del día de hoy es " /> )} {errorTonto && ( @@ -51,6 +52,7 @@ const Inicio = () => { nombre={cowboy.name} total={"--"} titulos={["--Próximamente--"]} + mensaje="Cowboy del día de hoy es " /> )} {errorCowboy && ( From 1df728b4ef1c35bd42bd5b7bcee1f6dbe7a363a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20N=C3=BA=C3=B1ez?= <124943644+JLeonN@users.noreply.github.com> Date: Tue, 23 Apr 2024 07:02:43 -0300 Subject: [PATCH 3/9] Borrando componente que no se usa. --- frontend/src/Componentes/Cpmpartir.jsx | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 frontend/src/Componentes/Cpmpartir.jsx diff --git a/frontend/src/Componentes/Cpmpartir.jsx b/frontend/src/Componentes/Cpmpartir.jsx deleted file mode 100644 index 218e8b6..0000000 --- a/frontend/src/Componentes/Cpmpartir.jsx +++ /dev/null @@ -1,18 +0,0 @@ -import { Link } from "react-router-dom"; - -const Cpmpartir = () => { - return ( - <> - - - - - ); -}; - -export default Cpmpartir; From 094f2935fe8be0ae61484360ff596edc990c4e0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20N=C3=BA=C3=B1ez?= <124943644+JLeonN@users.noreply.github.com> Date: Tue, 23 Apr 2024 07:04:35 -0300 Subject: [PATCH 4/9] Posible error --- frontend/src/Pagina/Inicio.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/Pagina/Inicio.jsx b/frontend/src/Pagina/Inicio.jsx index b609108..14d639c 100644 --- a/frontend/src/Pagina/Inicio.jsx +++ b/frontend/src/Pagina/Inicio.jsx @@ -39,9 +39,10 @@ const Inicio = () => { {errorTonto && ( // Tarjeta de error del día del más tonto )} @@ -58,9 +59,10 @@ const Inicio = () => { {errorCowboy && ( // Tarjeta de error del cowboy del día )} From afaedd3497babc5e7667e483b5475acada152430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20N=C3=BA=C3=B1ez?= <124943644+JLeonN@users.noreply.github.com> Date: Tue, 23 Apr 2024 07:31:26 -0300 Subject: [PATCH 5/9] Posible error en cowboy --- frontend/src/Pagina/CowboyDelDia/CowboyDelDia.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/src/Pagina/CowboyDelDia/CowboyDelDia.jsx b/frontend/src/Pagina/CowboyDelDia/CowboyDelDia.jsx index 3acc602..0be2f0f 100644 --- a/frontend/src/Pagina/CowboyDelDia/CowboyDelDia.jsx +++ b/frontend/src/Pagina/CowboyDelDia/CowboyDelDia.jsx @@ -29,6 +29,7 @@ const CowboyDelDia = () => { nombre={cowboy.name} total={"--"} titulos={["--Próximamente--"]} + mensaje="Cowboy del día de hoy es " /> )} {errorCowboy && ( @@ -37,6 +38,7 @@ const CowboyDelDia = () => { nombre={"Procesando un cowboy"} total={"--"} titulos={["----"]} + mensaje="El algoritmo está preparando un cowboy " /> )} From 8f1ebe5bc21f2f3de4a03c155d1bfe4506d4c24a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20N=C3=BA=C3=B1ez?= <124943644+JLeonN@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:28:49 -0300 Subject: [PATCH 6/9] Mensaje para Whatsapp --- frontend/src/Componentes/Tarjeta/Tarjeta.jsx | 19 +++++++++++++++++-- .../src/Pagina/CowboyDelDia/CowboyDelDia.jsx | 2 ++ frontend/src/Pagina/ElMasTonto/ElMasTonto.jsx | 5 ++++- .../EstructuraDePerfil.jsx | 3 ++- frontend/src/Pagina/Inicio.jsx | 4 ++++ 5 files changed, 29 insertions(+), 4 deletions(-) diff --git a/frontend/src/Componentes/Tarjeta/Tarjeta.jsx b/frontend/src/Componentes/Tarjeta/Tarjeta.jsx index e58e639..8c9b005 100644 --- a/frontend/src/Componentes/Tarjeta/Tarjeta.jsx +++ b/frontend/src/Componentes/Tarjeta/Tarjeta.jsx @@ -1,6 +1,21 @@ import { Link } from "react-router-dom"; -const TarjetaTonta = ({ nombre, total, titulos, mensaje }) => { +const TarjetaTonta = ({ nombre, total, titulos, mensaje, todaLaInfo }) => { + let laInfo = ""; + if (todaLaInfo != "") { + laInfo = + mensaje + + nombre + + "%0A" + + "Veces tonto: " + + total + + "%0A" + + "Titulos: " + + titulos; + } else { + laInfo = mensaje + nombre; + } + return (
@@ -29,7 +44,7 @@ const TarjetaTonta = ({ nombre, total, titulos, mensaje }) => {

-
- - -
- ))} -
+ {error == true && ( +

No se puede duplicar el titulo

+ )} +
+
+ {titulos && + titulos.map((titulo) => ( +
+ +
+ ))}
); From 98dbacfec8cbaff472f41b06c90a9f1055a6c56e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20N=C3=BA=C3=B1ez?= <124943644+JLeonN@users.noreply.github.com> Date: Wed, 24 Apr 2024 22:11:54 -0300 Subject: [PATCH 8/9] =?UTF-8?q?Bot=C3=B3n=20para=20compartir=20mejorado?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/Componentes/Tarjeta/Tarjeta.jsx | 20 ++++++++++++++----- .../src/Pagina/CowboyDelDia/CowboyDelDia.jsx | 6 ++---- frontend/src/Pagina/ElMasTonto/ElMasTonto.jsx | 5 ++--- .../EstructuraDePerfil.jsx | 3 +-- frontend/src/Pagina/Inicio.jsx | 12 ++++------- 5 files changed, 24 insertions(+), 22 deletions(-) diff --git a/frontend/src/Componentes/Tarjeta/Tarjeta.jsx b/frontend/src/Componentes/Tarjeta/Tarjeta.jsx index 8c9b005..bdb0d3d 100644 --- a/frontend/src/Componentes/Tarjeta/Tarjeta.jsx +++ b/frontend/src/Componentes/Tarjeta/Tarjeta.jsx @@ -1,10 +1,10 @@ import { Link } from "react-router-dom"; -const TarjetaTonta = ({ nombre, total, titulos, mensaje, todaLaInfo }) => { +const TarjetaTonta = ({ nombre, total, titulos, todaLaInfo }) => { let laInfo = ""; - if (todaLaInfo != "") { + if (todaLaInfo == "perfil") { laInfo = - mensaje + + "Tonto seleccionado: " + nombre + "%0A" + "Veces tonto: " + @@ -12,8 +12,18 @@ const TarjetaTonta = ({ nombre, total, titulos, mensaje, todaLaInfo }) => { "%0A" + "Titulos: " + titulos; - } else { - laInfo = mensaje + nombre; + } + if (todaLaInfo == "tontoDelDía") { + laInfo = "Tonto del día de hoy es " + nombre; + } + if (todaLaInfo == "CowboyDelDía") { + laInfo = "Cowboy del día de hoy es " + nombre; + } + if (todaLaInfo == "errorTonto") { + laInfo = "El algoritmo está preparando un tontos " + nombre; + } + if (todaLaInfo == "errorCowboy") { + laInfo = "El algoritmo está preparando un cowboy " + nombre; } return ( diff --git a/frontend/src/Pagina/CowboyDelDia/CowboyDelDia.jsx b/frontend/src/Pagina/CowboyDelDia/CowboyDelDia.jsx index f71f734..f2cfbc8 100644 --- a/frontend/src/Pagina/CowboyDelDia/CowboyDelDia.jsx +++ b/frontend/src/Pagina/CowboyDelDia/CowboyDelDia.jsx @@ -29,8 +29,7 @@ const CowboyDelDia = () => { nombre={cowboy.name} total={"--"} titulos={["--Próximamente--"]} - mensaje="Cowboy del día de hoy es " - todaLaInfo="" + todaLaInfo="CowboyDelDía" /> )} {errorCowboy && ( @@ -39,8 +38,7 @@ const CowboyDelDia = () => { nombre={"Procesando un cowboy"} total={"--"} titulos={["----"]} - mensaje="El algoritmo está preparando un cowboy " - todaLaInfo="" + todaLaInfo="errorCowboy" /> )} diff --git a/frontend/src/Pagina/ElMasTonto/ElMasTonto.jsx b/frontend/src/Pagina/ElMasTonto/ElMasTonto.jsx index 26e4fea..a08f14d 100644 --- a/frontend/src/Pagina/ElMasTonto/ElMasTonto.jsx +++ b/frontend/src/Pagina/ElMasTonto/ElMasTonto.jsx @@ -19,7 +19,7 @@ const ListaElMasTonto = () => { nombre={tonto.nombre} total={tonto.total} titulos={tonto.titulos} - todaLaInfo="" + todaLaInfo="tontoDelDía" /> )} {errorTonto && ( @@ -28,8 +28,7 @@ const ListaElMasTonto = () => { nombre={"¡Procesando!"} total={"--"} titulos={["----"]} - mensaje="El algoritmo está preparando un tonto " - todaLaInfo="" + todaLaInfo="errorTonto" /> )} diff --git a/frontend/src/Pagina/ElMasTonto/PerfilDeParticipante/EstructuraDePerfil.jsx b/frontend/src/Pagina/ElMasTonto/PerfilDeParticipante/EstructuraDePerfil.jsx index b77a546..4bf4daf 100644 --- a/frontend/src/Pagina/ElMasTonto/PerfilDeParticipante/EstructuraDePerfil.jsx +++ b/frontend/src/Pagina/ElMasTonto/PerfilDeParticipante/EstructuraDePerfil.jsx @@ -19,8 +19,7 @@ const EstructuraDePerfil = () => { nombre={participante.nombre} total={participante.total} titulos={participante.titulos} - mensaje="Tonto seleccionado: " - todaLaInfo={participante.total + participante.titulos} + todaLaInfo="perfil" /> {/* Lista de titulos */}
diff --git a/frontend/src/Pagina/Inicio.jsx b/frontend/src/Pagina/Inicio.jsx index 34f0d6e..8ee599c 100644 --- a/frontend/src/Pagina/Inicio.jsx +++ b/frontend/src/Pagina/Inicio.jsx @@ -33,8 +33,7 @@ const Inicio = () => { nombre={tonto.nombre} total={tonto.total} titulos={tonto.titulos} - mensaje="Tonto del día de hoy es " - todaLaInfo="" + todaLaInfo="tontoDelDía" /> )} {errorTonto && ( @@ -43,8 +42,7 @@ const Inicio = () => { nombre={"¡Procesando!"} total={"--"} titulos={["----"]} - mensaje="El algoritmo está preparando un tonto " - todaLaInfo="" + todaLaInfo="errorTonto" /> )} @@ -55,8 +53,7 @@ const Inicio = () => { nombre={cowboy.name} total={"--"} titulos={["--Próximamente--"]} - mensaje="Cowboy del día de hoy es " - todaLaInfo="" + todaLaInfo="CowboyDelDía" /> )} {errorCowboy && ( @@ -65,8 +62,7 @@ const Inicio = () => { nombre={"¡Procesando!"} total={"--"} titulos={["----"]} - mensaje="El algoritmo está preparando un cowboy " - todaLaInfo="" + todaLaInfo="errorCowboy" /> )} From 6ba3702a8085f95f14774530cfbe9dff5ab9e961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20N=C3=BA=C3=B1ez?= <124943644+JLeonN@users.noreply.github.com> Date: Thu, 25 Apr 2024 07:05:16 -0300 Subject: [PATCH 9/9] Cambiando nombres a variables. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Estoy cambiando los nombres de algunas variables para que el código sea más legible y fácil de entender. 💻 --- frontend/src/Componentes/Tarjeta/Tarjeta.jsx | 26 +++++++++---------- .../src/Pagina/CowboyDelDia/CowboyDelDia.jsx | 4 +-- frontend/src/Pagina/ElMasTonto/ElMasTonto.jsx | 4 +-- .../EstructuraDePerfil.jsx | 2 +- frontend/src/Pagina/Inicio.jsx | 8 +++--- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/frontend/src/Componentes/Tarjeta/Tarjeta.jsx b/frontend/src/Componentes/Tarjeta/Tarjeta.jsx index bdb0d3d..08b507a 100644 --- a/frontend/src/Componentes/Tarjeta/Tarjeta.jsx +++ b/frontend/src/Componentes/Tarjeta/Tarjeta.jsx @@ -1,9 +1,9 @@ import { Link } from "react-router-dom"; -const TarjetaTonta = ({ nombre, total, titulos, todaLaInfo }) => { - let laInfo = ""; - if (todaLaInfo == "perfil") { - laInfo = +const TarjetaTonta = ({ nombre, total, titulos, tipoDeMensaje }) => { + let mensajeFinal = ""; + if (tipoDeMensaje == "perfilTonto") { + mensajeFinal = "Tonto seleccionado: " + nombre + "%0A" + @@ -13,17 +13,17 @@ const TarjetaTonta = ({ nombre, total, titulos, todaLaInfo }) => { "Titulos: " + titulos; } - if (todaLaInfo == "tontoDelDía") { - laInfo = "Tonto del día de hoy es " + nombre; + if (tipoDeMensaje == "tontoDelDía") { + mensajeFinal = "Tonto del día de hoy es " + nombre; } - if (todaLaInfo == "CowboyDelDía") { - laInfo = "Cowboy del día de hoy es " + nombre; + if (tipoDeMensaje == "cowboyDelDía") { + mensajeFinal = "Cowboy del día de hoy es " + nombre; } - if (todaLaInfo == "errorTonto") { - laInfo = "El algoritmo está preparando un tontos " + nombre; + if (tipoDeMensaje == "errorTonto") { + mensajeFinal = "El algoritmo está preparando un tontos " + nombre; } - if (todaLaInfo == "errorCowboy") { - laInfo = "El algoritmo está preparando un cowboy " + nombre; + if (tipoDeMensaje == "errorCowboy") { + mensajeFinal = "El algoritmo está preparando un cowboy " + nombre; } return ( @@ -54,7 +54,7 @@ const TarjetaTonta = ({ nombre, total, titulos, todaLaInfo }) => {