mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
no results
This commit is contained in:
1 parent
4a0fccc526
commit
8d7575815b
6 files changed
+31
-14
No files matched your search
@@ -6,6 +6,10 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
gap: var(--space-3);
|
gap: var(--space-3);
|
||||||
|
|
||||||
|
&[data-underline="always"] {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
&[data-underline="hover"],
|
&[data-underline="hover"],
|
||||||
&[data-underline="never"] {
|
&[data-underline="never"] {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|||||||
@@ -2,6 +2,10 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
max-width: var(--page-width);
|
max-width: var(--page-width);
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
.label {
|
.container {
|
||||||
|
flex: 1;
|
||||||
|
|
||||||
|
.label {
|
||||||
margin: var(--space-4) 0;
|
margin: var(--space-4) 0;
|
||||||
|
|
||||||
/* mt="2" gap="1" align="center" justify="center" direction="column" */
|
/* mt="2" gap="1" align="center" justify="center" direction="column" */
|
||||||
@@ -6,8 +9,9 @@
|
|||||||
.count {
|
.count {
|
||||||
/* gap="2" */
|
/* gap="2" */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.test-warning {
|
.test-warning {
|
||||||
/* justify="center" mt="4" */
|
/* justify="center" mt="4" */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -31,9 +31,9 @@ import { TankCardSkeleton } from "../TankCardSkeleton";
|
|||||||
import { TankCardWrapper } from "../TankCardWrapper";
|
import { TankCardWrapper } from "../TankCardWrapper";
|
||||||
import { TankSearchBar } from "../TankSearchBar";
|
import { TankSearchBar } from "../TankSearchBar";
|
||||||
import { TankSearchFilters } from "../TankSearchFilters";
|
import { TankSearchFilters } from "../TankSearchFilters";
|
||||||
|
import { TankSearchNoResults } from "../TankSearchNoResults";
|
||||||
import { Text } from "../Text";
|
import { Text } from "../Text";
|
||||||
import { TankSearchCard } from "./components/Card";
|
import { TankSearchCard } from "./components/Card";
|
||||||
import { NoResults } from "./components/NoResults";
|
|
||||||
import { MAX_RECENTLY_VIEWED } from "./constants";
|
import { MAX_RECENTLY_VIEWED } from "./constants";
|
||||||
import styles from "./index.module.css";
|
import styles from "./index.module.css";
|
||||||
|
|
||||||
@@ -428,7 +428,7 @@ export const TankSearch = memo<TankSearchProps>(
|
|||||||
}, [tankFilters, tankopediaSort]);
|
}, [tankFilters, tankopediaSort]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex column gap="4">
|
<Flex className={styles.container} column gap="4">
|
||||||
<TankSearchBar
|
<TankSearchBar
|
||||||
skeleton={skeleton}
|
skeleton={skeleton}
|
||||||
topResult={tanks?.[0]}
|
topResult={tanks?.[0]}
|
||||||
@@ -439,6 +439,7 @@ export const TankSearch = memo<TankSearchProps>(
|
|||||||
|
|
||||||
{!skeleton && !compact && <RecentlyViewedTanks />}
|
{!skeleton && !compact && <RecentlyViewedTanks />}
|
||||||
|
|
||||||
|
{tanks.length > 0 && (
|
||||||
<Flex justify="center" className={styles.label}>
|
<Flex justify="center" className={styles.label}>
|
||||||
<div className={styles.count}>
|
<div className={styles.count}>
|
||||||
<Text lowContrast>
|
<Text lowContrast>
|
||||||
@@ -485,6 +486,7 @@ export const TankSearch = memo<TankSearchProps>(
|
|||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
</Flex>
|
</Flex>
|
||||||
|
)}
|
||||||
|
|
||||||
{tankFilters.showTesting && !tankFilters.showNonTesting && (
|
{tankFilters.showTesting && !tankFilters.showNonTesting && (
|
||||||
<div className={styles["test-warning"]}>
|
<div className={styles["test-warning"]}>
|
||||||
@@ -525,7 +527,7 @@ export const TankSearch = memo<TankSearchProps>(
|
|||||||
</TankCardWrapper>
|
</TankCardWrapper>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{tanks.length === 0 && <NoResults type="search" />}
|
{tanks.length === 0 && <TankSearchNoResults type="search" />}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
.no-results {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
+8
-8
@@ -1,22 +1,22 @@
|
|||||||
import { useLocale } from "../../../hooks/useLocale";
|
import { useLocale } from "../../hooks/useLocale";
|
||||||
import { TankFilters } from "../../../stores/tankFilters";
|
import { TankFilters } from "../../stores/tankFilters";
|
||||||
import { Flex } from "../../Flex";
|
import { Flex } from "../Flex";
|
||||||
import { Link } from "../../Link";
|
import { Link } from "../Link";
|
||||||
import { Text } from "../../Text";
|
import { Text } from "../Text";
|
||||||
|
import styles from "./index.module.css";
|
||||||
|
|
||||||
interface NoResultsProps {
|
interface NoResultsProps {
|
||||||
type?: "filters" | "search";
|
type?: "filters" | "search";
|
||||||
}
|
}
|
||||||
|
|
||||||
export function NoResults({ type = "filters" }: NoResultsProps) {
|
export function TankSearchNoResults({ type = "filters" }: NoResultsProps) {
|
||||||
const { strings } = useLocale();
|
const { strings } = useLocale();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex align="center" justify="center">
|
<Flex className={styles["no-results"]} align="center" justify="center">
|
||||||
<Text lowContrast>
|
<Text lowContrast>
|
||||||
{strings.website.common.tank_search.no_tanks_found.body}{" "}
|
{strings.website.common.tank_search.no_tanks_found.body}{" "}
|
||||||
<Link
|
<Link
|
||||||
href="#"
|
|
||||||
underline="always"
|
underline="always"
|
||||||
color="red"
|
color="red"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
Reference in new issue
Block a user