From 871636ced99db7daaf7337e4ba0dbb5e4d666358 Mon Sep 17 00:00:00 2001 From: "noneflow[bot]" <129742071+noneflow[bot]@users.noreply.github.com> Date: Sun, 9 Mar 2025 13:25:31 +0000 Subject: [PATCH] :memo: Update changelog --- website/src/changelog/changelog.md | 1 + website/src/components/Form/index.tsx | 8 ++++---- website/src/components/Messenger/index.tsx | 2 +- website/src/components/Resource/Tag/index.tsx | 1 - website/src/components/Resource/ValidStatus/index.tsx | 8 ++++++-- website/src/libs/filter.ts | 9 ++++++--- website/src/libs/search.ts | 4 +++- website/src/libs/store.ts | 7 ++++--- website/src/libs/toolbar.ts | 4 +++- website/static/uwu.js | 5 +++-- website/tailwind.config.ts | 4 +++- 11 files changed, 34 insertions(+), 19 deletions(-) diff --git a/website/src/changelog/changelog.md b/website/src/changelog/changelog.md index e03f80e0..af3521b6 100644 --- a/website/src/changelog/changelog.md +++ b/website/src/changelog/changelog.md @@ -17,6 +17,7 @@ toc_max_heading_level: 2 ### 📝 文档 +- Docs: 商店头像 skeleton [@StarHeartHunt](https://github.com/StarHeartHunt) ([#3362](https://github.com/nonebot/nonebot2/pull/3362)) - Docs: 添加 localstore `use_cwd` 配置项文档 [@yanyongyu](https://github.com/yanyongyu) ([#3345](https://github.com/nonebot/nonebot2/pull/3345)) - Docs: 商店插件可用性筛选 \& 更新排序 [@StarHeartHunt](https://github.com/StarHeartHunt) ([#3334](https://github.com/nonebot/nonebot2/pull/3334)) - Docs: 添加 微信公众平台 适配器描述 [@YangRucheng](https://github.com/YangRucheng) ([#3264](https://github.com/nonebot/nonebot2/pull/3264)) diff --git a/website/src/components/Form/index.tsx b/website/src/components/Form/index.tsx index 4308f4f0..cda5e498 100644 --- a/website/src/components/Form/index.tsx +++ b/website/src/components/Form/index.tsx @@ -4,7 +4,6 @@ import clsx from "clsx"; import "./styles.css"; - import type { Resource } from "@/libs/store"; import { fetchRegistryData } from "@/libs/store"; @@ -64,9 +63,10 @@ export function Form({ const currentStepNames = formItems[currentStep].items.map( (item) => item.name ); - if (currentStepNames.every((name) => result[name])) - {setCurrentStep(currentStep + 1);} - else {} + if (currentStepNames.every((name) => result[name])) { + setCurrentStep(currentStep + 1); + } else { + } }; const onPrev = () => currentStep > 0 && setCurrentStep(currentStep - 1); const onNext = () => diff --git a/website/src/components/Messenger/index.tsx b/website/src/components/Messenger/index.tsx index f25bd821..1a52c1c4 100644 --- a/website/src/components/Messenger/index.tsx +++ b/website/src/components/Messenger/index.tsx @@ -55,7 +55,7 @@ function MessageBox({ dangerouslySetInnerHTML={{ __html: msg.replace(/\n/g, "
").replace(/ /g, " "), }} - /> + /> ); } diff --git a/website/src/components/Resource/Tag/index.tsx b/website/src/components/Resource/Tag/index.tsx index 67c78a57..1df91818 100644 --- a/website/src/components/Resource/Tag/index.tsx +++ b/website/src/components/Resource/Tag/index.tsx @@ -6,7 +6,6 @@ import { pickTextColor } from "@/libs/color"; import type { Tag } from "@/types/tag"; - import "./styles.css"; export type Props = Tag & { diff --git a/website/src/components/Resource/ValidStatus/index.tsx b/website/src/components/Resource/ValidStatus/index.tsx index 5aee4a3a..1d9a74a4 100644 --- a/website/src/components/Resource/ValidStatus/index.tsx +++ b/website/src/components/Resource/ValidStatus/index.tsx @@ -12,8 +12,12 @@ import type { IconName } from "@fortawesome/fontawesome-common-types"; export const getValidStatus = (resource: Resource) => { switch (resource.resourceType) { case "plugin": - if (resource.skip_test) {return ValidStatus.SKIP;} - if (resource.valid) {return ValidStatus.VALID;} + if (resource.skip_test) { + return ValidStatus.SKIP; + } + if (resource.valid) { + return ValidStatus.VALID; + } return ValidStatus.INVALID; default: return ValidStatus.MISSING; diff --git a/website/src/libs/filter.ts b/website/src/libs/filter.ts index aea3db43..4626fa3f 100644 --- a/website/src/libs/filter.ts +++ b/website/src/libs/filter.ts @@ -8,7 +8,6 @@ import { ValidStatus } from "./valid"; import type { Resource } from "./store"; - export type Filter = { type: string; id: string; @@ -104,7 +103,9 @@ export const queryFilter = ( id: `query-${query}`, displayName: query, filter: (resource: Resource): boolean => { - if (!query) {return true;} + if (!query) { + return true; + } const queryLower = query.toLowerCase(); const pluginMatch = resource.resourceType === "plugin" && @@ -143,7 +144,9 @@ export function useFilteredResources( const addFilter = useCallback( (filter: Filter) => { - if (filters.some((f) => f.id === filter.id)) {return;} + if (filters.some((f) => f.id === filter.id)) { + return; + } setFilters((filters) => [...filters, filter]); }, [filters, setFilters] diff --git a/website/src/libs/search.ts b/website/src/libs/search.ts index cf5672d9..1e125fa2 100644 --- a/website/src/libs/search.ts +++ b/website/src/libs/search.ts @@ -43,7 +43,9 @@ export function useSearchControl( const newFilter = queryFilter(newQuery); // do nothing if filter is not changed - if (currentFilter?.id === newFilter.id) {return;} + if (currentFilter?.id === newFilter.id) { + return; + } // remove old currentFilter currentFilter && removeFilter(currentFilter); diff --git a/website/src/libs/store.ts b/website/src/libs/store.ts index 3b0c66c4..fe006cc7 100644 --- a/website/src/libs/store.ts +++ b/website/src/libs/store.ts @@ -30,10 +30,11 @@ export async function fetchRegistryData( ).catch((e) => { throw new Error(`Failed to fetch ${dataType}s: ${e}`); }); - if (!resp.ok) - {throw new Error( + if (!resp.ok) { + throw new Error( `Failed to fetch ${dataType}s: ${resp.status} ${resp.statusText}` - );} + ); + } const data = (await resp.json()) as RegistryDataResponseTypes[T]; return data.map( (resource) => ({ ...resource, resourceType: dataType }) as ResourceTypes[T] diff --git a/website/src/libs/toolbar.ts b/website/src/libs/toolbar.ts index 611b2739..b3ccbd25 100644 --- a/website/src/libs/toolbar.ts +++ b/website/src/libs/toolbar.ts @@ -76,7 +76,9 @@ export function useToolbar({ choices: Object.keys(validateStatusFilterMapping), onSubmit: (type: string) => { const validStatus = validateStatusFilterMapping[type]; - if (!validStatus) {return;} + if (!validStatus) { + return; + } addFilter(validStatusFilter(validStatus)); }, }; diff --git a/website/static/uwu.js b/website/static/uwu.js index 95b41f6a..7ede24fe 100644 --- a/website/static/uwu.js +++ b/website/static/uwu.js @@ -1,2 +1,3 @@ -if (location.search.includes("?uwu")) - {document.documentElement.setAttribute("data-uwu", "true");} +if (location.search.includes("?uwu")) { + document.documentElement.setAttribute("data-uwu", "true"); +} diff --git a/website/tailwind.config.ts b/website/tailwind.config.ts index 3b113e06..c70eb943 100644 --- a/website/tailwind.config.ts +++ b/website/tailwind.config.ts @@ -11,7 +11,9 @@ function excludeThemeColor( ): { [key: string]: string } { const newObj: { [key: string]: string } = {}; for (const key in theme) { - if (exclude.includes(key)) {continue;} + if (exclude.includes(key)) { + continue; + } newObj[key] = theme[key]!; } return newObj;