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

change in design #908

Closed
Closed
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
5 changes: 1 addition & 4 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"src/**/*.{astro,ts,js,tsx,jsx}": [
"eslint --ext",
"prettier --check"
]
"src/**/*.{astro,ts,js,tsx,jsx}": ["eslint --ext", "prettier --check"]
}
39 changes: 25 additions & 14 deletions src/components/Pronosticos/Vote.astro
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -40,7 +41,7 @@ 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))
Expand All @@ -52,21 +53,31 @@ votes.forEach((vote) => {
---

<section class="w-full">
<Typography class="mb-8 text-center" color="white" as="h1" variant={"atomic-title"}
>¡haz tu pronóstico!</Typography
>
<Typography class="mb-2 text-center" color="white" as="p" variant={"medium"}
>Vota tus ganadores para cada combate haciendo clic encima de cada uno</Typography
>

<div class="flex items-center justify-center gap-4">
<img class="size-12 rounded-full" src={user.image} alt={`Avatar del usuario ${user.name}`} />
<div class="flex flex-col justify-center">
<h4 class="text-lg font-bold">{user.name}</h4>
<button id="logout" class="text-sm font-light text-yellow-300">Cerrar sesión</button>
<main class="flex flex-row justify-between">
<div>
<Typography class="mb-8 text-center" color="white" as="h1" variant={"atomic-title"}
>¡haz tu pronóstico!</Typography
>
<Typography class="mb-2 text-center" color="white" as="p" variant={"medium"}
>Vota tus ganadores para cada combate haciendo clic encima de cada uno</Typography
>
</div>
</div>

<div class="flex items-center justify-center gap-4">
<img class="size-12 rounded-full" src={user.image} alt={`Avatar del usuario ${user.name}`} />
<div class="flex flex-col items-center justify-center gap-1">
<h4 class="text-lg font-bold">{user.name}</h4>
<Action
id="logout"
class="w-full text-sm md:text-base"
as="button"
aria-label="Iniciar sesión de usuario"
>
Cerrar sesión
</Action>
</div>
</div>
</main>
<ul class="flex flex-col items-center justify-center">
{
COMBATS.map((combat, index) => {
Expand Down
Loading