Skip to content

Commit

Permalink
adding a label with combat turn
Browse files Browse the repository at this point in the history
  • Loading branch information
omargr299 committed Apr 18, 2024
1 parent b15cdb8 commit be76725
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 10 deletions.
3 changes: 2 additions & 1 deletion package.json
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
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

0 comments on commit be76725

Please sign in to comment.