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>
);
}
@@ -3,10 +3,10 @@ import ColorScale from "../../../../components/ColorScale.astro";
import { RecentlyViewedTanks } from "../../../../components/RecentlyViewedTanks";
import { ScrollerCurtains } from "../../../../components/ScrollerCurtains";
import { Section } from "../../../../components/Section";
import Sections from "../../../../components/Sections.astro";
import { TankSearchBar } from "../../../../components/TankSearchBar";
import { TankSearchFilters } from "../../../../components/TankSearchFilters";
import { TankSearchResults } from "../../../../components/TankSearchResults";
import Sections from "../../../../components/Sections.astro";
import ToolBanner from "../../../../components/ToolBanner.astro";
import { tools } from "../../../../config/tools";
import BaseLayout from "../../../../layouts/BaseLayout.astro";
@@ -24,11 +24,6 @@ const { locale } = Astro.props;
<ToolBanner {locale} tool={tools.tanks} />
<Sections>
<Section overflow>
<ScrollerCurtains client:load />
<RecentlyViewedTanks {locale} client:load />
</Section>
<Section>
<TankSearchBar {locale} client:load />
</Section>
@@ -38,6 +33,8 @@ const { locale } = Astro.props;
<TankSearchFilters {locale} client:load />
</Section>
<RecentlyViewedTanks {locale} client:load />
<Section>
<TankSearchResults {locale} client:load />
</Section>