move section and curtains into recently viweed tanks

This commit is contained in:
tresabhi committed 2026-12-03 21:34:39 -06:00
1 parent 91644255a1
commit f50b791245
5 files changed
+45 -33

No files matched your search

@@ -7,6 +7,8 @@ import { useStrings } from "../../hooks/useStrings";
import { TankFilters } from "../../stores/tankFilters";
import { TankopediaPersistent } from "../../stores/tankopediaPersistent";
import { TankSort } from "../../stores/tankopediaSort";
import { ScrollerCurtains } from "../ScrollerCurtains";
import { Section } from "../Section";
import { TankCard } from "../TankCard";
import { TankCardSkeleton } from "../TankCardSkeleton";
import { MAX_RECENTLY_VIEWED } from "../TankSearchResults/constants";
@@ -43,35 +45,39 @@ function Content() {
}
return (
<div className={styles.recent}>
<Text color="gray" lowContrast className={styles.label}>
{strings.website.common.tank_search.recent}
</Text>
<Section overflow>
<ScrollerCurtains />
<div
className={styles.list}
data-empty={mounted && recentlyViewed.length === 0}
>
{!mounted &&
Array.from({ length: MAX_RECENTLY_VIEWED }, (_, index) => (
<TankCardSkeleton compact key={index} />
))}
<div className={styles.recent}>
<Text color="gray" lowContrast className={styles.label}>
{strings.website.common.tank_search.recent}
</Text>
{mounted && recentlyViewed.length === 0 && (
<>
<TankCardSkeleton compact className={styles.placeholder} />
<div
className={styles.list}
data-empty={mounted && recentlyViewed.length === 0}
>
{!mounted &&
Array.from({ length: MAX_RECENTLY_VIEWED }, (_, index) => (
<TankCardSkeleton compact key={index} />
))}
<Text color="gray" lowContrast className={styles.message}>
{strings.website.common.tank_search.recent_empty}
</Text>
</>
)}
{mounted && recentlyViewed.length === 0 && (
<>
<TankCardSkeleton compact className={styles.placeholder} />
{mounted &&
recentlyViewed.map((id) => (
<TankCard compact tank={tankDefinitions.tanks[id]} key={id} />
))}
<Text color="gray" lowContrast className={styles.message}>
{strings.website.common.tank_search.recent_empty}
</Text>
</>
)}
{mounted &&
recentlyViewed.map((id) => (
<TankCard compact tank={tankDefinitions.tanks[id]} key={id} />
))}
</div>
</div>
</div>
</Section>
);
}