From dd4d538a4765f90e68ce458a258c01f8d563dce6 Mon Sep 17 00:00:00 2001 From: xueweihan <595666367@qq.com> Date: Sun, 29 Sep 2024 16:42:16 +0800 Subject: [PATCH] perf: rank in mobile --- public/locales/en/home.json | 4 +- public/locales/zh/home.json | 4 +- src/components/ImageWithPreview.tsx | 6 +- .../dropdown/AvatarWithDropdown.tsx | 7 +- src/components/links/TagLink.tsx | 47 +++++--- src/components/links/rankLink.tsx | 104 +++++++++--------- src/components/loading/skeleton.tsx | 22 +++- src/components/navbar/IndexBar.tsx | 68 ++++-------- src/components/rankTable/RankTable.tsx | 4 +- src/components/respository/CommentItem.tsx | 4 +- src/hooks/useFilterHandling.tsx | 12 -- 11 files changed, 146 insertions(+), 136 deletions(-) diff --git a/public/locales/en/home.json b/public/locales/en/home.json index aa1e697..a44695d 100644 --- a/public/locales/en/home.json +++ b/public/locales/en/home.json @@ -8,9 +8,7 @@ "newest": "Newest", "monthly": "Monthly", "yearly": "Yearly", - "featured": "Featured", - "tag": "Tags", - "submit": "Submit" + "featured": "Featured" }, "tag_side": { "title": "Topics", diff --git a/public/locales/zh/home.json b/public/locales/zh/home.json index 7636d2b..b41e755 100644 --- a/public/locales/zh/home.json +++ b/public/locales/zh/home.json @@ -8,9 +8,7 @@ "monthly": "月度", "yearly": "年度", "all": "全部", - "featured": "精选", - "tag": "标签", - "submit": "提交" + "featured": "精选" }, "tag_side": { "title": "热门标签", diff --git a/src/components/ImageWithPreview.tsx b/src/components/ImageWithPreview.tsx index 9cf9cfd..0535bc0 100644 --- a/src/components/ImageWithPreview.tsx +++ b/src/components/ImageWithPreview.tsx @@ -42,7 +42,11 @@ const ImageWithPreview = (props: { }, toolbarRender: () => <>, diff --git a/src/components/dropdown/AvatarWithDropdown.tsx b/src/components/dropdown/AvatarWithDropdown.tsx index f126e77..222576c 100644 --- a/src/components/dropdown/AvatarWithDropdown.tsx +++ b/src/components/dropdown/AvatarWithDropdown.tsx @@ -4,6 +4,7 @@ import { useLoginContext } from '@/hooks/useLoginContext'; import LanguageSwitcher from '@/components/buttons/LanguageSwitcher'; import ThemeSwitcher from '@/components/buttons/ThemeSwitcher'; +import { RepoModal } from '@/components/dialog/RepoModal'; import { CustomLink } from '@/components/links/CustomLink'; import { DEFAULT_AVATAR } from '@/utils/constants'; @@ -52,6 +53,11 @@ const AvatarWithDropdown = ({ t, className }: Props) => { {t('header.profile')} + +
+ {t('header.submit')} +
+
{t('header.notification')} @@ -62,7 +68,6 @@ const AvatarWithDropdown = ({ t, className }: Props) => { )}
-
diff --git a/src/components/links/TagLink.tsx b/src/components/links/TagLink.tsx index 819a39c..cbe6e7d 100644 --- a/src/components/links/TagLink.tsx +++ b/src/components/links/TagLink.tsx @@ -1,32 +1,53 @@ import { NoPrefetchLink } from '@/components/links/CustomLink'; +import { constructURL } from '@/utils/util'; + import { TagType } from '@/types/tag'; interface Props { + year?: number; + month?: number; tid?: string; sort_by: string; items: TagType[]; + rank_by: string; } -export default function TagLink(props: Props) { +export default function TagLink({ + tid, + sort_by, + items, + rank_by, + year, + month, +}: Props) { return ( -
+