mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-14 21:26:08 +01:00
feat: flesh out popular tanks
This commit is contained in:
1 parent
b6c4c4e852
commit
406ad52c8d
10 files changed
+85
-30
No files matched your search
@@ -0,0 +1,9 @@
|
||||
.tanks {
|
||||
z-index: 1;
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
|
||||
gap: 2rem;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import { api } from "../../core/api/dynamic";
|
||||
import { useAwait } from "../../hooks/useAwait";
|
||||
import {
|
||||
LocaleProvider,
|
||||
type LocaleAcceptorProps,
|
||||
} from "../../hooks/useLocale";
|
||||
import { Scroller } from "../Scroller";
|
||||
import { TankCard } from "../TankCard";
|
||||
import styles from "./index.module.css";
|
||||
|
||||
export function HomeTanksPopular({ locale }: LocaleAcceptorProps) {
|
||||
return (
|
||||
<LocaleProvider locale={locale}>
|
||||
<Content />
|
||||
</LocaleProvider>
|
||||
);
|
||||
}
|
||||
|
||||
function Content() {
|
||||
const popular = useAwait(() => api.popularTanks(), "popular-tanks");
|
||||
const trimmed = popular.tanks.slice(0, 32);
|
||||
|
||||
return (
|
||||
<Scroller className={styles.tanks}>
|
||||
<div className={styles.content}>
|
||||
{trimmed.map((tank) => (
|
||||
<TankCard key={tank.id} {...tank} />
|
||||
))}
|
||||
</div>
|
||||
</Scroller>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user