From f73131dc03b3c039ed39f18069d77e3b968a7dee Mon Sep 17 00:00:00 2001 From: TerryM Date: Fri, 29 May 2026 12:49:22 +0800 Subject: [PATCH] style: apply prettier formatting to fix format:check Co-Authored-By: Claude Opus 4.8 (1M context) --- src/App.tsx | 69 +-- src/components/BackToTop.tsx | 4 +- .../messageStream/MessageStream.tsx | 5 +- src/layouts/PublicLayout.tsx | 7 +- src/pages/Categories/index.tsx | 5 +- src/pages/Home/index.tsx | 460 +++++++++--------- 6 files changed, 274 insertions(+), 276 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index c661b21..42799df 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -25,41 +25,44 @@ export default function App() { - - - - - - }> - } /> - } /> - } /> - } - /> - } /> - } /> - } /> - } /> - } /> - + + + + + + }> + } /> + } /> + } /> + } + /> + } + /> + } /> + } /> + } /> + } /> + - {adminEnabled ? ( - AdminRouteTree() - ) : ( - } - /> - )} + {adminEnabled ? ( + AdminRouteTree() + ) : ( + } + /> + )} - } /> - - - - - + } /> + + + + + diff --git a/src/components/BackToTop.tsx b/src/components/BackToTop.tsx index 99afa8f..26e4475 100644 --- a/src/components/BackToTop.tsx +++ b/src/components/BackToTop.tsx @@ -30,9 +30,7 @@ export function BackToTop() { animate={{ opacity: 1, scale: 1, y: 0 }} exit={{ opacity: 0, scale: 0.8, y: 8 }} transition={{ type: "spring", stiffness: 380, damping: 26 }} - onClick={() => - window.scrollTo({ top: 0, behavior: "smooth" }) - } + onClick={() => window.scrollTo({ top: 0, behavior: "smooth" })} className="fixed bottom-[94px] right-4 z-30 flex h-11 w-11 items-center justify-center rounded-full bg-ark-gold text-black shadow-lg shadow-black/40 outline-none transition hover:bg-ark-gold2 active:scale-95 focus-visible:ring-2 focus-visible:ring-ark-gold/80 focus-visible:ring-offset-2 focus-visible:ring-offset-ark-bg md:bottom-8 md:right-8" aria-label={t("backToTop")} title={t("backToTop")} diff --git a/src/components/messageStream/MessageStream.tsx b/src/components/messageStream/MessageStream.tsx index 39ff232..42091bc 100644 --- a/src/components/messageStream/MessageStream.tsx +++ b/src/components/messageStream/MessageStream.tsx @@ -71,8 +71,9 @@ export function MessageStream({ scope }: MessageStreamProps) { // When arriving with a `#post-` hash (e.g. from a recommended card), // scroll to that bubble — loading more pages until it shows up — then give // it a brief highlight so the user can see where they landed. - const targetPostId = - hash.startsWith("#post-") ? hash.slice("#post-".length) : ""; + const targetPostId = hash.startsWith("#post-") + ? hash.slice("#post-".length) + : ""; const handledTargetRef = useRef(""); useEffect(() => { diff --git a/src/layouts/PublicLayout.tsx b/src/layouts/PublicLayout.tsx index bbda386..ae96daa 100644 --- a/src/layouts/PublicLayout.tsx +++ b/src/layouts/PublicLayout.tsx @@ -1,12 +1,7 @@ import { ChevronDown, Menu, Search as SearchIcon, X } from "lucide-react"; import { AnimatePresence, m } from "framer-motion"; import { useEffect, useRef, useState } from "react"; -import { - Link, - useLocation, - useNavigate, - useOutlet, -} from "react-router-dom"; +import { Link, useLocation, useNavigate, useOutlet } from "react-router-dom"; import { pageTransition } from "../motion"; import { ArkLogoMark } from "../components/ArkLogoMark"; import { BackToTop } from "../components/BackToTop"; diff --git a/src/pages/Categories/index.tsx b/src/pages/Categories/index.tsx index 4327e24..bd902b9 100644 --- a/src/pages/Categories/index.tsx +++ b/src/pages/Categories/index.tsx @@ -80,10 +80,7 @@ export function CategoriesPage() {
{isLoading ? Array.from({ length: 14 }).map((_, i) => ( - + )) : cats.map((category, index) => ( -
-
- -
- -
-
- {categoryPages.map((page, pageIndex) => ( -
- {page.map((c) => ( - - -
- {cleanCategoryDisplayName(c.name)} -
- - ))} -
- ))} +
+
+
- {categoryPages.length > 1 ? ( +
- {categoryPages.map((_, index) => ( + {categoryPages.map((page, pageIndex) => ( +
+ {page.map((c) => ( + + +
+ {cleanCategoryDisplayName(c.name)} +
+ + ))} +
+ ))} +
+ + {categoryPages.length > 1 ? ( +
+ {categoryPages.map((_, index) => ( +
+ ) : null} +
+ +
+ {figmaOrderedCategories.map((c, index) => ( + + + +
+ {cleanCategoryDisplayName(c.name)} +
+ +
+ ))} +
+
+ + + +
+
+ +
+
+
+ {rec.map((r, index) => ( +
+ + + +
+ ))} +
+
+ {Array.from({ length: recommendedDotCount }).map((_, index) => (
- ) : null} -
- -
- {figmaOrderedCategories.map((c, index) => ( - - - -
- {cleanCategoryDisplayName(c.name)} -
- -
- ))} -
-
+ {canScrollRec ? ( + <> + + + + ) : null} +
+
-
-
- -
-
-
- {rec.map((r, index) => ( -
- - - -
- ))} -
-
- {Array.from({ length: recommendedDotCount }).map((_, index) => ( -
- {canScrollRec ? ( - <> - - - - ) : null} -
-
-
- - -
-
- -
-
- {latestPosts.slice(0, 5).map((post) => ( - - ))} -
-
-
- {latest.map((r) => ( -
- -
- ))} - {Array.from({ length: latestPlaceholderCount }).map((_, index) => ( -
- -
- ))} -
- {canScrollLatest ? ( - <> - - - - ) : null} -
-
-
- - {hasPopular ? ( - -
-- 2.49.1