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

adding a label with turn combat #902

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion package.json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Las dependencias las maneja @midudev, si están exactas es para evitar conflictos entre versiones.

Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@astrojs/vercel": "7.5.2",
"@midudev/tailwind-animations": "0.0.7",
"@types/dom-view-transitions": "1.0.4",
"@typescript-eslint/eslint-plugin": "7.6.0",
"@typescript-eslint/parser": "7.6.0",
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
Expand All @@ -42,7 +43,7 @@
"lint-staged": "15.2.2",
"postcss-import": "16.1.0",
"postcss-nesting": "12.1.1",
"prettier": "3.2.5",
"prettier": "^3.2.5",
"prettier-plugin-astro": "0.13.0",
"prettier-plugin-astro-organize-imports": "0.4.4",
"prettier-plugin-tailwindcss": "0.5.13",
Expand Down
2 changes: 1 addition & 1 deletion src/consts/event-date.ts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deberías dejar el archivo como estaba, as const hace que tenga solo acceso de lectura y evita que se pueda modificar.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const EVENT_TIMESTAMP = 1720886400000 as const
export const EVENT_TIMESTAMP = 1720886400000

/*
Mapeo de Abreviaturas de Zonas Horarias
Expand Down
8 changes: 8 additions & 0 deletions src/consts/ordinals.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export const ordinals: Record<number, string> = {
1: "Primer",
2: "Segundo",
3: "Tercer",
4: "Cuarto",
5: "Quinto",
6: "Sexto",
}
12 changes: 12 additions & 0 deletions src/pages/combates/[id].astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
import { Image } from "astro:assets"

import BackgroundVideo from "@/components/Combates/BackgroundVideo.astro"
import Typography from "@/components/Typography.astro"
import { COMBATS } from "@/consts/combats"
import { ordinals } from "@/consts/ordinals"
import Layout from "@/layouts/Layout.astro"
import CombatFeatures from "@/sections/CombatFeatures.astro"

Expand Down Expand Up @@ -33,6 +35,7 @@ if (!combatData) {
status: 404,
}
}
const ordinal = ordinals[combatData.number]

const { teams, boxers } = combatData
const [slug1, slug2] = teams ?? boxers
Expand Down Expand Up @@ -88,6 +91,15 @@ export const prerender = true
class="relative right-36 h-[600px] w-auto md:h-[1000px] xl:right-24 xl:h-[1500px]"
/>
</div>

<div class="mt-20 flex items-center justify-center">
<span class="bg-accent px-5 py-2">
<Typography as="span" variant="h2" color="white" class="m-auto inline"
>{ordinal} combate</Typography
>
</span>
</div>

<div class="pointer-events-auto">
{combatData.boxers.length <= 4 && <CombatFeatures boxerIds={combatData.boxers} />}
</div>
Expand Down
10 changes: 2 additions & 8 deletions src/sections/Combat.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,14 @@ import Typography from "@/components/Typography.astro"
import { COMBATS } from "@/consts/combats"
import type { Boxer } from "@/types/Boxer"

import { ordinals } from "@/consts/ordinals"

interface Props {
combatId: string
combatNumber: number
boxers: Boxer[]
}

const ordinals: Record<number, string> = {
1: "Primer",
2: "Segundo",
3: "Tercer",
4: "Cuarto",
5: "Quinto",
6: "Sexto",
}
const { combatNumber, combatId, boxers } = Astro.props

const createCombatDisplay = (boxers: Boxer[]) => {
Expand Down
Loading