From 099795ab4c56782067873be5e2ee395af48478ce Mon Sep 17 00:00:00 2001 From: PrinOrange Date: Sat, 6 Jan 2024 20:53:18 +0800 Subject: [PATCH] Fix some UI flaws --- components/readerpage/TOC.tsx | 2 +- components/utils/PostList.tsx | 2 +- lib/utils.ts | 4 ++-- pages/about.tsx | 5 +++-- pages/friends.tsx | 5 +++-- pages/index.tsx | 7 ++++--- pages/posts/[[...slug]].tsx | 7 ++++--- pages/sponsor.tsx | 2 +- pages/tags/[...slug].tsx | 5 +++-- 9 files changed, 22 insertions(+), 17 deletions(-) diff --git a/components/readerpage/TOC.tsx b/components/readerpage/TOC.tsx index ef11445..f6c3d11 100644 --- a/components/readerpage/TOC.tsx +++ b/components/readerpage/TOC.tsx @@ -3,7 +3,7 @@ import Link from "next/link"; export const TOC = (props: { data: TTOCItem[] }) => { return ( -
+
{"TABLE OF CONTENTS"}
diff --git a/components/utils/PostList.tsx b/components/utils/PostList.tsx index 1880cec..a34fcad 100644 --- a/components/utils/PostList.tsx +++ b/components/utils/PostList.tsx @@ -13,7 +13,7 @@ export const PostList = (props: { data: TPostListItem[] }) => { key={`post-list-${nanoid()}`} className={`${fontSourceSerifScreenCN.className} flex flex-col justify-center ${ index !== props.data.length - 1 && "border-b" - } border-dashed border-gray-400 py-3`} + } border-gray-200 dark:border-gray-800 py-3`} >
diff --git a/lib/utils.ts b/lib/utils.ts index f760959..094637a 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -61,7 +61,7 @@ export function isEmptyString(value: string | null | undefined): boolean { * @returns The array without empty values. * @template T - The type of the array elements. */ -export function removeEmptyValuesFromArray(value: any[]): T[] { +export function removeEmptyValuesFromArray(value: T[]): T[] { return value.filter((item) => item != null); } @@ -74,7 +74,7 @@ export function isEmptyArray(value: any[] | null | undefined): boolean { if (value === null || value === undefined) { return true; } - return removeEmptyValuesFromArray(value).length !== 0; + return removeEmptyValuesFromArray(value).length === 0; } /** diff --git a/pages/about.tsx b/pages/about.tsx index fe56444..e2eb300 100644 --- a/pages/about.tsx +++ b/pages/about.tsx @@ -1,4 +1,5 @@ import { ContentContainer, Page } from "@/components/layouts/layouts"; +import { Separator } from "@/components/ui/separator"; import { Footer } from "@/components/utils/Footer"; import { NavBar } from "@/components/utils/NavBar"; import { SEO } from "@/components/utils/SEO"; @@ -17,10 +18,10 @@ export default function AboutPage() { /> -

+

{"ABOUT ME"}

-
+
my-profile diff --git a/pages/friends.tsx b/pages/friends.tsx index 565d190..5076115 100644 --- a/pages/friends.tsx +++ b/pages/friends.tsx @@ -1,4 +1,5 @@ import { ContentContainer, Page } from "@/components/layouts/layouts"; +import { Separator } from "@/components/ui/separator"; import { Footer } from "@/components/utils/Footer"; import { NavBar } from "@/components/utils/NavBar"; import { SEO } from "@/components/utils/SEO"; @@ -17,7 +18,7 @@ export default function FriendsPage() {

{"FRIENDS"}

-
+
{FriendsList.map((item) => ( @@ -25,7 +26,7 @@ export default function FriendsPage() { ))}
-
+
{"Welcome to exchange our friend links and every high-quality blog websites are welcomed. "} diff --git a/pages/index.tsx b/pages/index.tsx index a647dbd..ab34067 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,6 +1,7 @@ import { HomeCover } from "@/components/homepage/HomeCover"; import { ContentContainer, Page } from "@/components/layouts/layouts"; import { Button } from "@/components/ui/button"; +import { Separator } from "@/components/ui/separator"; import { Footer } from "@/components/utils/Footer"; import { NavBar } from "@/components/utils/NavBar"; import { PostList } from "@/components/utils/PostList"; @@ -34,12 +35,12 @@ export default function Home(props: HomePageProps) { {props.pinnedPostList.length !== 0 && (
-
+

{"PINNED POSTS"}

-
+
)} @@ -50,7 +51,7 @@ export default function Home(props: HomePageProps) { {"LATEST POSTS"} -
+