fix: key error
This commit is contained in:
parent
b068cf1def
commit
e06787fb3f
@ -1,5 +1,6 @@
|
|||||||
import StyledLink from "@/components/gallery/StyledLink";
|
import StyledLink from "@/components/gallery/StyledLink";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
|
import { Fragment } from "react/jsx-runtime";
|
||||||
|
|
||||||
export function DescItem({ name, children, className }: {
|
export function DescItem({ name, children, className }: {
|
||||||
name: string;
|
name: string;
|
||||||
@ -21,10 +22,10 @@ export function DescTagItem({
|
|||||||
return <DescItem name={name} className={className}>
|
return <DescItem name={name} className={className}>
|
||||||
{items.length === 0 ? "N/A" : items.map(
|
{items.length === 0 ? "N/A" : items.map(
|
||||||
(x, i) =>
|
(x, i) =>
|
||||||
<>
|
<Fragment key={x}>
|
||||||
<StyledLink key={x} to={`/search?allow_tag=${name.toLowerCase()}:${x}`}>{x}</StyledLink>
|
<StyledLink to={`/search?allow_tag=${name.toLowerCase()}:${x}`}>{x}</StyledLink>
|
||||||
{i + 1 < items.length && <span className="">, </span>}
|
{i + 1 < items.length && <span className="">, </span>}
|
||||||
</>
|
</Fragment>
|
||||||
)}
|
)}
|
||||||
</DescItem>;
|
</DescItem>;
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ export default function Gallery() {
|
|||||||
|
|
||||||
|
|
||||||
const isLoadingMore = data && size > 0 && (data[size - 1] === undefined);
|
const isLoadingMore = data && size > 0 && (data[size - 1] === undefined);
|
||||||
return (<div className="p-4 grid gap-2 items-start content-start" ref={parentRef}>
|
return (<div className="p-4 grid gap-2 overflow-auto h-dvh items-start content-start" ref={parentRef}>
|
||||||
<Search />
|
<Search />
|
||||||
{(word || tags) &&
|
{(word || tags) &&
|
||||||
<div className="bg-primary rounded-full p-1 sticky top-0 shadow-md z-10">
|
<div className="bg-primary rounded-full p-1 sticky top-0 shadow-md z-10">
|
||||||
|
Loading…
Reference in New Issue
Block a user