diff --git a/packages/website-ue/src/components/BaseStyles.astro b/packages/website-ue/src/components/BaseStyles.astro index 839d6a103..180907903 100644 --- a/packages/website-ue/src/components/BaseStyles.astro +++ b/packages/website-ue/src/components/BaseStyles.astro @@ -81,5 +81,7 @@ import "@fontsource-variable/roboto-flex"; --duration-brief: 200ms; --duration-subtle: 2s; + + --tank-card-width: 11rem; } diff --git a/packages/website-ue/src/components/TankCard/index.module.css b/packages/website-ue/src/components/TankCard/index.module.css index 164e03e2a..58086af37 100644 --- a/packages/website-ue/src/components/TankCard/index.module.css +++ b/packages/website-ue/src/components/TankCard/index.module.css @@ -23,7 +23,7 @@ } .icon { - width: 11rem; + width: var(--tank-card-width); height: 7rem; position: relative; diff --git a/packages/website-ue/src/components/TankCard/index.tsx b/packages/website-ue/src/components/TankCard/index.tsx index 784f8bcc5..7367b8a1a 100644 --- a/packages/website-ue/src/components/TankCard/index.tsx +++ b/packages/website-ue/src/components/TankCard/index.tsx @@ -1,4 +1,3 @@ -import type { PopularTank } from "@protos/blitzkit/popular_tanks"; import { api } from "../../core/api/dynamic"; import { useAwait } from "../../hooks/useAwait"; import { useGameStrings } from "../../hooks/useGameStrings"; @@ -7,7 +6,12 @@ import { LinkI18n } from "../LinkI18n"; import { Text } from "../Text"; import styles from "./index.module.css"; -export function TankCard({ id }: PopularTank) { +interface TankCardProps { + id: string; + subtitle?: string; +} + +export function TankCard({ id }: TankCardProps) { const tank = useAwait(() => api.tank(id), `tank-${id}`); const gameStrings = useGameStrings("TankEntity"); const locale = useLocale(); diff --git a/packages/website-ue/src/components/TankCards/index.module.css b/packages/website-ue/src/components/TankCards/index.module.css new file mode 100644 index 000000000..c547572c0 --- /dev/null +++ b/packages/website-ue/src/components/TankCards/index.module.css @@ -0,0 +1,6 @@ +.tank-cards { + display: grid; + gap: var(--space-5) var(--space-4); + grid-template-columns: repeat(auto-fill, var(--tank-card-width)); + justify-content: center; +} diff --git a/packages/website-ue/src/components/TankCards/index.tsx b/packages/website-ue/src/components/TankCards/index.tsx new file mode 100644 index 000000000..1747dc2a1 --- /dev/null +++ b/packages/website-ue/src/components/TankCards/index.tsx @@ -0,0 +1,9 @@ +import styles from "./index.module.css"; + +interface Props { + children: React.ReactNode; +} + +export function TankCards({ children }: Props) { + return