diff --git a/packages/client/src/components/gallery/GalleryCard.tsx b/packages/client/src/components/gallery/GalleryCard.tsx index a0b02fd..9381f02 100644 --- a/packages/client/src/components/gallery/GalleryCard.tsx +++ b/packages/client/src/components/gallery/GalleryCard.tsx @@ -4,6 +4,7 @@ import TagBadge from "@/components/gallery/TagBadge.tsx"; import { Fragment, useLayoutEffect, useRef, useState } from "react"; import { LazyImage } from "./LazyImage.tsx"; import StyledLink from "./StyledLink.tsx"; +import React from "react"; function clipTagsWhenOverflow(tags: string[], limit: number) { let l = 0; @@ -17,7 +18,7 @@ function clipTagsWhenOverflow(tags: string[], limit: number) { return tags; } -export function GalleryCard({ +function GalleryCardImpl({ doc: x }: { doc: Document; }) { const ref = useRef(null); @@ -85,3 +86,5 @@ export function GalleryCard({ ; } + +export const GalleryCard = React.memo(GalleryCardImpl); \ No newline at end of file diff --git a/packages/client/src/components/layout/layout.tsx b/packages/client/src/components/layout/layout.tsx index c4380d6..1216fc8 100644 --- a/packages/client/src/components/layout/layout.tsx +++ b/packages/client/src/components/layout/layout.tsx @@ -40,7 +40,7 @@ export default function Layout({ children }: LayoutProps) { - + {children} diff --git a/packages/client/src/components/layout/nav.tsx b/packages/client/src/components/layout/nav.tsx index 10ee170..51fa2dd 100644 --- a/packages/client/src/components/layout/nav.tsx +++ b/packages/client/src/components/layout/nav.tsx @@ -32,7 +32,7 @@ export function NavItem({ export function NavList() { const loginInfo = useLogin(); - return