mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-22 21:53:46 +01:00
simplified page padding scheme
This commit is contained in:
30 files changed
+129
-196
No files matched your search
@@ -23,6 +23,7 @@ styles += "}";
|
||||
<style>
|
||||
:root {
|
||||
--page-width: 64rem;
|
||||
--page-padding: var(--space-4);
|
||||
|
||||
--max-size: max(100vw, 100vh);
|
||||
--radius-max: var(--max-size);
|
||||
|
||||
@@ -75,7 +75,7 @@ export function CompareTable() {
|
||||
}, [members, environment]);
|
||||
|
||||
return (
|
||||
<Table.Root scrollable>
|
||||
<Table.Root>
|
||||
<Table.Head>
|
||||
<Table.Row>
|
||||
<Table.IconCorner>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { api } from "../api/dynamic";
|
||||
import { tools } from "../constants/tools";
|
||||
import { Heading } from "./Heading";
|
||||
import HomeSection from "./HomeSection.astro";
|
||||
import { Section } from "./Section";
|
||||
import ToolCard from "./ToolCard.astro";
|
||||
import ToolCardLayoutColumn from "./ToolCardLayoutColumn.astro";
|
||||
import ToolCardLayoutRoot from "./ToolCardLayoutRoot.astro";
|
||||
@@ -16,7 +16,7 @@ const { locale } = Astro.props;
|
||||
const strings = await api.strings(locale);
|
||||
---
|
||||
|
||||
<HomeSection>
|
||||
<Section>
|
||||
<Heading size="2">{strings.home.cosmetics}</Heading>
|
||||
|
||||
<ToolCardLayoutRoot minor>
|
||||
@@ -28,4 +28,4 @@ const strings = await api.strings(locale);
|
||||
<ToolCard {locale} tool={tools.backgrounds} />
|
||||
</ToolCardLayoutColumn>
|
||||
</ToolCardLayoutRoot>
|
||||
</HomeSection>
|
||||
</Section>
|
||||
@@ -2,7 +2,7 @@
|
||||
import { api } from "../api/dynamic";
|
||||
import { tools } from "../constants/tools";
|
||||
import { Heading } from "./Heading";
|
||||
import HomeSection from "./HomeSection.astro";
|
||||
import { Section } from "./Section";
|
||||
import ToolCard from "./ToolCard.astro";
|
||||
import ToolCardLayoutColumn from "./ToolCardLayoutColumn.astro";
|
||||
import ToolCardLayoutRoot from "./ToolCardLayoutRoot.astro";
|
||||
@@ -16,7 +16,7 @@ const { locale } = Astro.props;
|
||||
const strings = await api.strings(locale);
|
||||
---
|
||||
|
||||
<HomeSection>
|
||||
<Section>
|
||||
<Heading size="2" className="title">{strings.home.games}</Heading>
|
||||
|
||||
<ToolCardLayoutRoot>
|
||||
@@ -28,4 +28,4 @@ const strings = await api.strings(locale);
|
||||
<ToolCard {locale} tool={tools.guesser} />
|
||||
</ToolCardLayoutColumn>
|
||||
</ToolCardLayoutRoot>
|
||||
</HomeSection>
|
||||
</Section>
|
||||
@@ -2,7 +2,7 @@
|
||||
import { api } from "../api/dynamic";
|
||||
import { tools } from "../constants/tools";
|
||||
import { Heading } from "./Heading";
|
||||
import HomeSection from "./HomeSection.astro";
|
||||
import { Section } from "./Section";
|
||||
import ToolCard from "./ToolCard.astro";
|
||||
import ToolCardLayoutColumn from "./ToolCardLayoutColumn.astro";
|
||||
import ToolCardLayoutRoot from "./ToolCardLayoutRoot.astro";
|
||||
@@ -16,7 +16,7 @@ const { locale } = Astro.props;
|
||||
const strings = await api.strings(locale);
|
||||
---
|
||||
|
||||
<HomeSection>
|
||||
<Section>
|
||||
<Heading size="2">{strings.home.players}</Heading>
|
||||
|
||||
<ToolCardLayoutRoot>
|
||||
@@ -30,4 +30,4 @@ const strings = await api.strings(locale);
|
||||
<!-- <ToolCard {locale} tool={tools.players} /> -->
|
||||
</ToolCardLayoutColumn>
|
||||
</ToolCardLayoutRoot>
|
||||
</HomeSection>
|
||||
</Section>
|
||||
@@ -1,11 +0,0 @@
|
||||
<style>
|
||||
.home-section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-4);
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="home-section">
|
||||
<slot />
|
||||
</div>
|
||||
@@ -2,7 +2,7 @@
|
||||
import { api } from "../api/dynamic";
|
||||
import { tools } from "../constants/tools";
|
||||
import { Heading } from "./Heading";
|
||||
import HomeSection from "./HomeSection.astro";
|
||||
import { Section } from "./Section";
|
||||
import ToolCard from "./ToolCard.astro";
|
||||
import ToolCardLayoutColumn from "./ToolCardLayoutColumn.astro";
|
||||
import ToolCardLayoutRoot from "./ToolCardLayoutRoot.astro";
|
||||
@@ -15,7 +15,7 @@ const { locale } = Astro.props;
|
||||
const strings = await api.strings(locale);
|
||||
---
|
||||
|
||||
<HomeSection>
|
||||
<Section>
|
||||
<Heading size="2">{strings.home.tanks}</Heading>
|
||||
|
||||
<ToolCardLayoutRoot>
|
||||
@@ -28,4 +28,4 @@ const strings = await api.strings(locale);
|
||||
<ToolCard {locale} minor tool={tools.performance} />
|
||||
</ToolCardLayoutColumn>
|
||||
</ToolCardLayoutRoot>
|
||||
</HomeSection>
|
||||
</Section>
|
||||
@@ -2,7 +2,7 @@
|
||||
import { api } from "../api/dynamic";
|
||||
import { tools } from "../constants/tools";
|
||||
import { Heading } from "./Heading";
|
||||
import HomeSection from "./HomeSection.astro";
|
||||
import { Section } from "./Section";
|
||||
import ToolCard from "./ToolCard.astro";
|
||||
import ToolCardLayoutColumn from "./ToolCardLayoutColumn.astro";
|
||||
import ToolCardLayoutRoot from "./ToolCardLayoutRoot.astro";
|
||||
@@ -16,7 +16,7 @@ const { locale } = Astro.props;
|
||||
const strings = await api.strings(locale);
|
||||
---
|
||||
|
||||
<HomeSection>
|
||||
<Section>
|
||||
<Heading size="2">{strings.home.technical}</Heading>
|
||||
|
||||
<ToolCardLayoutRoot minor>
|
||||
@@ -28,4 +28,4 @@ const strings = await api.strings(locale);
|
||||
<ToolCard {locale} tool={tools.changelogs} />
|
||||
</ToolCardLayoutColumn>
|
||||
</ToolCardLayoutRoot>
|
||||
</HomeSection>
|
||||
</Section>
|
||||
@@ -24,7 +24,7 @@ export const filtered = Object.values(tools).filter(
|
||||
<style>
|
||||
#navbar-desktop {
|
||||
--icon-size: 1.5rem;
|
||||
--padding: var(--space-4);
|
||||
--padding: var(--page-padding);
|
||||
--min-content-width: calc(var(--icon-size) + 2 * var(--padding));
|
||||
|
||||
display: none;
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
.root {
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.value {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ export function PerformanceTable() {
|
||||
}
|
||||
|
||||
return (
|
||||
<Table.Root className={styles.root}>
|
||||
<Table.Root>
|
||||
<Head />
|
||||
<Body filtered={filtered} />
|
||||
</Table.Root>
|
||||
|
||||
@@ -1,24 +1,25 @@
|
||||
.section {
|
||||
padding: var(--space-4);
|
||||
|
||||
@media (pointer: fine) {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
|
||||
padding-right: var(--page-padding);
|
||||
|
||||
/* astro island's children sometimes end up being first deeper into the div's */
|
||||
&:first-child:not(astro-island > &) {
|
||||
padding-top: var(--page-padding);
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
flex: 1;
|
||||
padding-bottom: var(--page-padding);
|
||||
}
|
||||
|
||||
.content {
|
||||
flex: 1;
|
||||
max-width: var(--page-width);
|
||||
@media (pointer: coarse) {
|
||||
padding-left: var(--page-padding);
|
||||
}
|
||||
|
||||
gap: var(--space-5);
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
&[data-overflow="true"] {
|
||||
padding-right: 0;
|
||||
overflow-x: auto;
|
||||
}
|
||||
}
|
||||
@@ -2,13 +2,17 @@ import type { ComponentProps } from "react";
|
||||
import { classNames } from "../../ui/classNames";
|
||||
import styles from "./index.module.css";
|
||||
|
||||
export interface SectionProps extends ComponentProps<"div"> {}
|
||||
export interface SectionProps extends ComponentProps<"section"> {
|
||||
overflow?: boolean;
|
||||
}
|
||||
|
||||
// TODO: reevaluate the usefulness of this as it seems to do very little
|
||||
export function Section({ className, children, ...props }: SectionProps) {
|
||||
export function Section({ className, overflow, ...props }: SectionProps) {
|
||||
return (
|
||||
<div className={classNames(styles.section, className)} {...props}>
|
||||
<div className={styles.content}>{children}</div>
|
||||
</div>
|
||||
<section
|
||||
className={classNames(styles.section, className)}
|
||||
data-overflow={overflow || undefined}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -1,17 +1,13 @@
|
||||
.scroller {
|
||||
/* Fits the table, centered by the parent, never wider than the page */
|
||||
max-width: 100%;
|
||||
|
||||
border: var(--space-0) solid var(--gray-a5);
|
||||
border-radius: var(--space-3);
|
||||
/* Clips the corners without becoming a scroll container, so sticky headers follow the page */
|
||||
overflow: clip;
|
||||
}
|
||||
|
||||
.table {
|
||||
border-radius: var(--space-3);
|
||||
overflow: hidden;
|
||||
|
||||
border-collapse: separate;
|
||||
border-spacing: 0;
|
||||
|
||||
width: fit-content;
|
||||
margin: auto;
|
||||
|
||||
th,
|
||||
td {
|
||||
padding: var(--space-3);
|
||||
|
||||
@@ -13,16 +13,12 @@ import { Logo } from "../../icons/Logo";
|
||||
import { SortDirection } from "../../stores/tankopediaPersistent";
|
||||
import { CharacteristicRanking } from "../../types/characteristics";
|
||||
import { classNames } from "../../ui/classNames";
|
||||
import { Scroller, ScrollerOrientation } from "../Scroller";
|
||||
import styles from "./index.module.css";
|
||||
|
||||
interface RootProps
|
||||
extends Omit<ComponentProps<typeof Scroller>, "orientation"> {
|
||||
scrollable?: boolean;
|
||||
}
|
||||
interface RootProps extends ComponentProps<"table"> {}
|
||||
|
||||
// When scrollable, scrolls both ways, keeping the head, the row headers and the group titles in view
|
||||
function Root({ children, className, scrollable, ...props }: RootProps) {
|
||||
function Root({ children, className, ...props }: RootProps) {
|
||||
const table = useRef<HTMLTableElement>(null);
|
||||
|
||||
// Group titles stick right below the head, whatever its height
|
||||
@@ -42,30 +38,12 @@ function Root({ children, className, scrollable, ...props }: RootProps) {
|
||||
|
||||
return () => observer.disconnect();
|
||||
}, []);
|
||||
const content = (
|
||||
|
||||
return (
|
||||
<table ref={table} className={styles.table}>
|
||||
{children}
|
||||
</table>
|
||||
);
|
||||
|
||||
if (!scrollable) {
|
||||
return (
|
||||
<div className={classNames(styles.scroller, className)} {...props}>
|
||||
{content}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Scroller
|
||||
orientation={ScrollerOrientation.Both}
|
||||
startCurtain={false}
|
||||
className={classNames(styles.scroller, className)}
|
||||
{...props}
|
||||
>
|
||||
{content}
|
||||
</Scroller>
|
||||
);
|
||||
}
|
||||
|
||||
function Head(props: ComponentProps<"thead">) {
|
||||
|
||||
@@ -25,8 +25,8 @@ const toolStrings = strings.tools[tool.id as keyof typeof strings.tools];
|
||||
background-size: cover;
|
||||
|
||||
@media (pointer: fine) {
|
||||
margin: var(--margin) var(--margin) 0 0;
|
||||
border-radius: var(--space-4);
|
||||
margin: var(--page-padding) var(--page-padding) 0 0;
|
||||
}
|
||||
|
||||
.content {
|
||||
|
||||
@@ -68,6 +68,8 @@ const { locale, accent, solidNavbar = false, tool } = Astro.props;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
gap: var(--page-padding);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
+2
-22
@@ -1,26 +1,6 @@
|
||||
.page {
|
||||
/* Fixed to the viewport so the table scrolls, not the page */
|
||||
height: 100dvh;
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: var(--space-4);
|
||||
|
||||
padding: var(--space-4);
|
||||
}
|
||||
|
||||
.table {
|
||||
align-self: stretch;
|
||||
overflow: hidden;
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
gap: var(--space-4);
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import { api } from "../../../../api/dynamic";
|
||||
import { CompareControls } from "../../../../components/CompareControls";
|
||||
import { CompareTable } from "../../../../components/CompareTable";
|
||||
import { EmptyState } from "../../../../components/EmptyState";
|
||||
import { Section } from "../../../../components/Section";
|
||||
import { tankToCompareMember } from "../../../../core/blitzkit/tankToCompareMember";
|
||||
import { withErrorWrapper } from "../../../../hocs/withErrorWrapper";
|
||||
import { withLocale } from "../../../../hocs/withLocale";
|
||||
@@ -59,23 +60,27 @@ function Content() {
|
||||
}, [members]);
|
||||
|
||||
return (
|
||||
<div className={styles.page}>
|
||||
<div className={styles.top}>
|
||||
<CompareControls />
|
||||
</div>
|
||||
<>
|
||||
<Section>
|
||||
<div className={styles.top}>
|
||||
<CompareControls />
|
||||
</div>
|
||||
</Section>
|
||||
|
||||
{members.length > 0 && (
|
||||
<div className={styles.table}>
|
||||
<Section overflow>
|
||||
<CompareTable />
|
||||
</div>
|
||||
</Section>
|
||||
)}
|
||||
|
||||
{members.length === 0 && (
|
||||
<EmptyState
|
||||
title={strings.compare.no_tanks.title}
|
||||
body={strings.compare.no_tanks.body}
|
||||
/>
|
||||
<Section>
|
||||
<EmptyState
|
||||
title={strings.compare.no_tanks.title}
|
||||
body={strings.compare.no_tanks.body}
|
||||
/>
|
||||
</Section>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
import ColorScale from "../../../../components/ColorScale.astro";
|
||||
import ToolBanner from "../../../../components/ToolBanner.astro";
|
||||
import { tools } from "../../../../constants/tools";
|
||||
import BaseLayout from "../../../../layouts/BaseLayout.astro";
|
||||
import { Page } from "./_index";
|
||||
@@ -9,11 +10,13 @@ export { getStaticPaths } from "../index.astro";
|
||||
const { locale } = Astro.props;
|
||||
---
|
||||
|
||||
<BaseLayout tool={tools.compare} accent="pink" {locale}>
|
||||
<ColorScale color="red" />
|
||||
<ColorScale color="jade" />
|
||||
<ColorScale color="amber" />
|
||||
<ColorScale color="blue" />
|
||||
<ColorScale color="red" />
|
||||
<ColorScale color="jade" />
|
||||
<ColorScale color="amber" />
|
||||
<ColorScale color="blue" />
|
||||
|
||||
<BaseLayout tool={tools.compare} accent="pink" {locale}>
|
||||
<!-- TODO: add svg art for this tool -->
|
||||
<ToolBanner tool={tools.compare} {locale} />
|
||||
<Page {locale} client:load />
|
||||
</BaseLayout>
|
||||
@@ -17,11 +17,11 @@ const iconLayouts = ["leading", "trailing", "both", "icon only"] as const;
|
||||
const extraColors = ["red", "amber", "green"] satisfies Color[];
|
||||
---
|
||||
|
||||
<BaseLayout tool={tools.home} accent="blue" {locale}>
|
||||
{extraColors.map((color) => (
|
||||
<ColorScale {color} />
|
||||
))}
|
||||
{extraColors.map((color) => (
|
||||
<ColorScale {color} />
|
||||
))}
|
||||
|
||||
<BaseLayout tool={tools.home} accent="blue" {locale}>
|
||||
<div class="page">
|
||||
<h1>Badge</h1>
|
||||
|
||||
|
||||
+2
-2
@@ -8,8 +8,8 @@ export { getStaticPaths } from "../index.astro";
|
||||
const { locale, embed } = Astro.props;
|
||||
---
|
||||
|
||||
<EmbedLayout {locale}>
|
||||
<ColorScale color="red" />
|
||||
<ColorScale color="red" />
|
||||
|
||||
<EmbedLayout {locale}>
|
||||
<Page {locale} client:only="react" {embed} />
|
||||
</EmbedLayout>
|
||||
@@ -11,9 +11,9 @@ const { locale } = Astro.props;
|
||||
// TODO: the tank search popup is complete unreviewed AI slop, write a proper system for it manually
|
||||
---
|
||||
|
||||
<BaseLayout tool={tools.guesser} accent="blue" {locale} solidNavbar>
|
||||
<ColorScale color="red" />
|
||||
<ColorScale color="red" />
|
||||
|
||||
<BaseLayout tool={tools.guesser} accent="blue" {locale} solidNavbar>
|
||||
<Page {locale} client:only="react">
|
||||
<Page {locale} skeleton slot="fallback" />
|
||||
</Page>
|
||||
|
||||
@@ -9,7 +9,6 @@ import HomeGames from "../../../components/HomeGames.astro";
|
||||
import HomePlayers from "../../../components/HomePlayers.astro";
|
||||
import HomeTanks from "../../../components/HomeTanks.astro";
|
||||
import HomeTechnical from "../../../components/HomeTechnical.astro";
|
||||
import { Section } from "../../../components/Section";
|
||||
import { tools, type Tool } from "../../../constants/tools";
|
||||
import BaseLayout from "../../../layouts/BaseLayout.astro";
|
||||
import { getStaticPaths as _getStaticPaths } from "../_index";
|
||||
@@ -53,13 +52,11 @@ export const getStaticPaths = mixStaticPaths(_getStaticPaths, () => {
|
||||
|
||||
{environment === "preview" && <AesonPlug />}
|
||||
|
||||
<Section>
|
||||
<HomeTanks {locale} />
|
||||
<HomePlayers {locale} />
|
||||
<HomeGames {locale} />
|
||||
<HomeCosmetics {locale} />
|
||||
<HomeTechnical {locale} />
|
||||
</Section>
|
||||
<HomeTanks {locale} />
|
||||
<HomePlayers {locale} />
|
||||
<HomeGames {locale} />
|
||||
<HomeCosmetics {locale} />
|
||||
<HomeTechnical {locale} />
|
||||
</BaseLayout>
|
||||
|
||||
<!-- TODO: read temp/notes.md for user testing fixes -->
|
||||
+2
-17
@@ -1,21 +1,6 @@
|
||||
.page {
|
||||
.top {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: var(--space-4);
|
||||
|
||||
padding: var(--space-4);
|
||||
}
|
||||
|
||||
.table {
|
||||
align-self: stretch;
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
gap: var(--space-4);
|
||||
}
|
||||
@@ -1,19 +1,22 @@
|
||||
import { PerformanceControls } from "../../../../components/PerformanceControls";
|
||||
import { PerformanceTable } from "../../../../components/PerformanceTable";
|
||||
import { Section } from "../../../../components/Section";
|
||||
import { withErrorWrapper } from "../../../../hocs/withErrorWrapper";
|
||||
import { withLocale } from "../../../../hocs/withLocale";
|
||||
import styles from "./_index.module.css";
|
||||
|
||||
export const Page = withLocale(
|
||||
withErrorWrapper(() => (
|
||||
<div className={styles.page}>
|
||||
<div className={styles.top}>
|
||||
<PerformanceControls />
|
||||
</div>
|
||||
<>
|
||||
<Section>
|
||||
<div className={styles.top}>
|
||||
<PerformanceControls />
|
||||
</div>
|
||||
</Section>
|
||||
|
||||
<div className={styles.table}>
|
||||
<Section overflow>
|
||||
<PerformanceTable />
|
||||
</div>
|
||||
</div>
|
||||
</Section>
|
||||
</>
|
||||
)),
|
||||
);
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
import ColorScale from "../../../../components/ColorScale.astro";
|
||||
import ToolBanner from "../../../../components/ToolBanner.astro";
|
||||
import { tools } from "../../../../constants/tools";
|
||||
import BaseLayout from "../../../../layouts/BaseLayout.astro";
|
||||
import { Page } from "./_index";
|
||||
@@ -9,11 +10,13 @@ export { getStaticPaths } from "../index.astro";
|
||||
const { locale } = Astro.props;
|
||||
---
|
||||
|
||||
<BaseLayout tool={tools.performance} accent="jade" {locale}>
|
||||
<ColorScale color="red" />
|
||||
<ColorScale color="jade" />
|
||||
<ColorScale color="amber" />
|
||||
<ColorScale color="blue" />
|
||||
<ColorScale color="red" />
|
||||
<ColorScale color="jade" />
|
||||
<ColorScale color="amber" />
|
||||
<ColorScale color="blue" />
|
||||
|
||||
<BaseLayout tool={tools.performance} accent="jade" {locale}>
|
||||
<!-- TODO: add svg art for this tool -->
|
||||
<ToolBanner tool={tools.performance} {locale} />
|
||||
<Page {locale} client:load />
|
||||
</BaseLayout>
|
||||
@@ -20,11 +20,11 @@ export const getStaticPaths = mixStaticPaths(_getStaticPaths, async () => {
|
||||
const { id, locale } = Astro.props;
|
||||
---
|
||||
|
||||
<BaseLayout tool={tools.tanks} {locale} accent="violet">
|
||||
<ColorScale color="ruby" />
|
||||
<ColorScale color="cyan" />
|
||||
<ColorScale color="green" />
|
||||
<ColorRanks />
|
||||
<ColorScale color="ruby" />
|
||||
<ColorScale color="cyan" />
|
||||
<ColorScale color="green" />
|
||||
<ColorRanks />
|
||||
|
||||
<BaseLayout tool={tools.tanks} {locale} accent="violet">
|
||||
<Page {id} {locale} client:load />
|
||||
</BaseLayout>
|
||||
@@ -1,17 +1,7 @@
|
||||
import { TankSearch } from "../../../../components/TankSearch";
|
||||
import {
|
||||
LocaleProvider,
|
||||
type LocaleAcceptorProps,
|
||||
} from "../../../../hooks/useLocale";
|
||||
import { withLocale } from "../../../../hocs/withLocale";
|
||||
import type { MaybeSkeletonComponentProps } from "../../../../types/maybeSkeletonComponentProps";
|
||||
|
||||
export function Page({
|
||||
locale,
|
||||
skeleton,
|
||||
}: LocaleAcceptorProps & MaybeSkeletonComponentProps) {
|
||||
return (
|
||||
<LocaleProvider locale={locale}>
|
||||
<TankSearch skeleton={skeleton} />
|
||||
</LocaleProvider>
|
||||
);
|
||||
}
|
||||
export const Page = withLocale<MaybeSkeletonComponentProps>(({ skeleton }) => (
|
||||
<TankSearch skeleton={skeleton} />
|
||||
));
|
||||
@@ -11,15 +11,15 @@ export { getStaticPaths } from "../index.astro";
|
||||
const { locale } = Astro.props;
|
||||
---
|
||||
|
||||
<BaseLayout tool={tools.tanks} {locale} accent="purple">
|
||||
<ColorScale color="blue" />
|
||||
<ColorScale color="amber" />
|
||||
<ColorScale color="red" />
|
||||
<ColorScale color="blue" />
|
||||
<ColorScale color="amber" />
|
||||
<ColorScale color="red" />
|
||||
|
||||
<BaseLayout tool={tools.tanks} {locale} accent="purple">
|
||||
<ToolBanner {locale} tool={tools.tanks} />
|
||||
|
||||
<!-- TODO: eliminate all client:only's -->
|
||||
<Section>
|
||||
<!-- TODO: eliminate all client:only's -->
|
||||
<Page {locale} client:only="react">
|
||||
<Page {locale} skeleton slot="fallback" />
|
||||
</Page>
|
||||
|
||||
Reference in new issue
Block a user