From bc83d296b6f473f75d773a34e25fa761b95cc006 Mon Sep 17 00:00:00 2001 From: Daniel Cardenas <97079553+darcardenasp045@users.noreply.github.com> Date: Mon, 15 Apr 2024 15:27:56 -0500 Subject: [PATCH 1/5] change in design --- src/components/Pronosticos/Vote.astro | 39 +++++++++++++++++---------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/src/components/Pronosticos/Vote.astro b/src/components/Pronosticos/Vote.astro index 9bd163b53..90db69d9f 100644 --- a/src/components/Pronosticos/Vote.astro +++ b/src/components/Pronosticos/Vote.astro @@ -3,6 +3,7 @@ import type { User } from "@auth/core/types" import { Image } from "astro:assets" import { Votes, db, eq } from "astro:db" +import Action from "@/components/Action.astro" import Typography from "@/components/Typography.astro" import { BOXERS } from "@/consts/boxers" import { COMBATS, REY_DE_LA_PISTA_ID } from "@/consts/combats" @@ -46,27 +47,37 @@ const votes = await db .where(eq(Votes.userId, userId)) const userVotes: Record = {} -votes.forEach((vote) => { +votes.forEach((vote: any) => { userVotes[vote.combatId] = vote.voteId }) ---
- ¡haz tu pronóstico! - Vota tus ganadores para cada combate haciendo clic encima de cada uno - -
- {`Avatar -
-

{user.name}

- +
+
+ ¡haz tu pronóstico! + Vota tus ganadores para cada combate haciendo clic encima de cada uno
-
+
+ {`Avatar +
+

{user.name}

+ + Cerrar sesión + +
+
+
    { COMBATS.map((combat, index) => { From 2875cb559df90af7c3768ab7c323cd14b4b391dc Mon Sep 17 00:00:00 2001 From: Daniel Cardenas <97079553+darcardenasp045@users.noreply.github.com> Date: Mon, 15 Apr 2024 15:38:46 -0500 Subject: [PATCH 2/5] Update user profile layout in Vote.astro component --- src/components/Pronosticos/Vote.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Pronosticos/Vote.astro b/src/components/Pronosticos/Vote.astro index 90db69d9f..f951cf52e 100644 --- a/src/components/Pronosticos/Vote.astro +++ b/src/components/Pronosticos/Vote.astro @@ -65,7 +65,7 @@ votes.forEach((vote: any) => {
    {`Avatar -
    +

    {user.name}

    Date: Mon, 15 Apr 2024 15:39:29 -0500 Subject: [PATCH 3/5] Update lintstagedrc to include only TypeScript and JavaScript files --- .lintstagedrc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.lintstagedrc b/.lintstagedrc index 80b91aa34..757916d22 100644 --- a/.lintstagedrc +++ b/.lintstagedrc @@ -1,6 +1,3 @@ { - "src/**/*.{astro,ts,js,tsx,jsx}": [ - "eslint --ext", - "prettier --check" - ] + "src/**/*.{ts,js,tsx,jsx}": ["eslint --ext", "prettier --check"] } From 65952bbb2daf066469beaa2fe6317d4de9e86d1f Mon Sep 17 00:00:00 2001 From: Daniel Cardenas <97079553+darcardenasp045@users.noreply.github.com> Date: Mon, 15 Apr 2024 18:20:26 -0500 Subject: [PATCH 4/5] we fix the lint --- .lintstagedrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.lintstagedrc b/.lintstagedrc index 757916d22..13b3a1281 100644 --- a/.lintstagedrc +++ b/.lintstagedrc @@ -1,3 +1,3 @@ { - "src/**/*.{ts,js,tsx,jsx}": ["eslint --ext", "prettier --check"] + "src/**/*.{astro,ts,js,tsx,jsx}": ["eslint --ext", "prettier --check"] } From 37df519ff6b0c99eafd7d9122f180717e4a2b98c Mon Sep 17 00:00:00 2001 From: Jesus Rojas Date: Wed, 24 Apr 2024 13:42:54 -0500 Subject: [PATCH 5/5] fix: remove type 'any' in Vote.astro :bug: --- src/components/Pronosticos/Vote.astro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Pronosticos/Vote.astro b/src/components/Pronosticos/Vote.astro index f951cf52e..63b167ca3 100644 --- a/src/components/Pronosticos/Vote.astro +++ b/src/components/Pronosticos/Vote.astro @@ -41,13 +41,13 @@ interface Props { const { user } = Astro.props as Props const userId = user.id -const votes = await db +const votes: { combatId: string; voteId: string }[] = await db .select({ combatId: Votes.combatId, voteId: Votes.voteId }) .from(Votes) .where(eq(Votes.userId, userId)) const userVotes: Record = {} -votes.forEach((vote: any) => { +votes.forEach((vote) => { userVotes[vote.combatId] = vote.voteId }) ---