mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-14 21:26:08 +01:00
feat: start migration to proto for popular tanks
This commit is contained in:
1 parent
001709c25c
commit
ccb86ae824
8 files changed
+68
-66
No files matched your search
@@ -15,19 +15,9 @@ interface Props {
|
||||
const { locale } = Astro.props;
|
||||
|
||||
const strings = await api.strings(locale);
|
||||
const popular = (await api.popularTanks()).tanks.slice(0, 8);
|
||||
|
||||
const popular = [
|
||||
"Concept 1B",
|
||||
"Obj. 268",
|
||||
"Grille 15",
|
||||
"Kpz 70 Missile",
|
||||
"Concept 1B",
|
||||
"Concept 1B",
|
||||
"Concept 1B",
|
||||
"Concept 1B",
|
||||
"Concept 1B",
|
||||
"Concept 1B",
|
||||
];
|
||||
console.log(popular.length);
|
||||
---
|
||||
|
||||
<style>
|
||||
@@ -51,7 +41,7 @@ const popular = [
|
||||
|
||||
<Scroller client:load className="tanks">
|
||||
<div class="content">
|
||||
{popular.map((tank) => <TankCard {tank} />)}
|
||||
{popular.map((tank) => <TankCard {...tank} />)}
|
||||
</div>
|
||||
</Scroller>
|
||||
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import type { PopularTank } from "../../protos/popular_tanks";
|
||||
import { Text } from "../Text";
|
||||
import styles from "./index.module.css";
|
||||
|
||||
interface TankCard {
|
||||
tank: string;
|
||||
}
|
||||
export function TankCard({ id }: PopularTank) {
|
||||
const tanks = useAwait(api.tanks, "tanks");
|
||||
|
||||
export function TankCard({ tank }: TankCard) {
|
||||
return (
|
||||
<div className={styles["tank-card"]}>
|
||||
<div className={styles["icon-wrapper"]}>
|
||||
@@ -19,12 +18,12 @@ export function TankCard({ tank }: TankCard) {
|
||||
<div
|
||||
className={styles.icon}
|
||||
style={{
|
||||
backgroundImage: "url(https://i.imgur.com/HrkTwHc.png)",
|
||||
backgroundImage: `url(/api/tanks/${id}.webp)`,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Text className={styles.name}>{tank}</Text>
|
||||
<Text className={styles.name}>{id}</Text>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user