From d0993a427f68b1fa9d446b0b7474ca7cb4891365 Mon Sep 17 00:00:00 2001 From: Aelita4 Date: Fri, 8 Nov 2024 12:44:26 +0100 Subject: [PATCH] Add links to wiki articles in building/research/ship cards --- src/components/ItemCard.astro | 3 ++- src/pages/game/buildings.astro | 5 +++-- src/pages/game/research.astro | 1 + src/pages/game/ships.astro | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/ItemCard.astro b/src/components/ItemCard.astro index 5382d49..a7b3052 100644 --- a/src/components/ItemCard.astro +++ b/src/components/ItemCard.astro @@ -2,6 +2,7 @@ import { getHighestWeightedLanguage, getLocales, getName } from '../lib/utils/langDriver'; interface Props { + category: string; id: string; level: string; name: string; @@ -17,7 +18,7 @@ const lang = await getLocales(Astro.cookies.get('language')?.value ?? await getH
{Astro.props.name} | {Astro.props.level}
-
{Astro.props.description}
+
{Astro.props.description} [more]
i
diff --git a/src/pages/game/buildings.astro b/src/pages/game/buildings.astro index a94a2d8..493a2be 100644 --- a/src/pages/game/buildings.astro +++ b/src/pages/game/buildings.astro @@ -1,7 +1,7 @@ --- import Layout from '../../layouts/Layout.astro'; import NavBar from '../../components/NavBar.astro'; -import BuildingCard from '../../components/ItemCard.astro'; +import ItemCard from '../../components/ItemCard.astro'; import { getUserByAccessToken } from '../../lib/db/users'; import { getHighestWeightedLanguage, getLocales, getName, getObj } from '../../lib/utils/langDriver'; import ResourceBar from '../../components/ResourceBar.astro'; @@ -89,7 +89,8 @@ const buildingsByCategory = buildingsList.reduce((acc: { [key: string]: Array{getName(lang, 'buildings', `cat-${category}`)}
{buildings.map(building => ( - {researchList.map(research => <> x.id === research.id)?.level.toString() ?? "0"} diff --git a/src/pages/game/ships.astro b/src/pages/game/ships.astro index a52bd90..aa2aea8 100644 --- a/src/pages/game/ships.astro +++ b/src/pages/game/ships.astro @@ -62,6 +62,7 @@ for(const ship of ships) {
{ships.map(ship => <>