From d1adac91d7a506a8b7121fc7a6f8992ac235b5c4 Mon Sep 17 00:00:00 2001 From: DefectingCat Date: Wed, 22 Mar 2023 15:34:59 +0800 Subject: [PATCH] Format code --- {components => app}/gists/file-content.tsx | 10 ++++------ .../gists/gists-code-skeleton.tsx | 0 .../gists/gists-code.module.css | 0 {components => app}/gists/gists-code.tsx | 0 {components => app}/gists/gists-skeleton.tsx | 18 ++---------------- app/gists/page.tsx | 2 +- 6 files changed, 7 insertions(+), 23 deletions(-) rename {components => app}/gists/file-content.tsx (91%) rename {components => app}/gists/gists-code-skeleton.tsx (100%) rename {components => app}/gists/gists-code.module.css (100%) rename {components => app}/gists/gists-code.tsx (100%) rename {components => app}/gists/gists-skeleton.tsx (74%) diff --git a/components/gists/file-content.tsx b/app/gists/file-content.tsx similarity index 91% rename from components/gists/file-content.tsx rename to app/gists/file-content.tsx index 0333c2b..34bacee 100644 --- a/components/gists/file-content.tsx +++ b/app/gists/file-content.tsx @@ -1,12 +1,10 @@ import LinkAnchor from 'components/mdx/link-anchor'; -import Loading from 'components/rua/loading/rua-loading'; import dayjs from 'dayjs'; -import { GistData } from 'lib/fetcher'; -import dynamic from 'next/dynamic'; -import Link from 'next/link'; -import { memo, Suspense } from 'react'; -import GistsCode from './gists-code'; import relativeTime from 'dayjs/plugin/relativeTime'; +import { GistData } from 'lib/fetcher'; +import Link from 'next/link'; +import { memo } from 'react'; +import GistsCode from './gists-code'; dayjs.extend(relativeTime); diff --git a/components/gists/gists-code-skeleton.tsx b/app/gists/gists-code-skeleton.tsx similarity index 100% rename from components/gists/gists-code-skeleton.tsx rename to app/gists/gists-code-skeleton.tsx diff --git a/components/gists/gists-code.module.css b/app/gists/gists-code.module.css similarity index 100% rename from components/gists/gists-code.module.css rename to app/gists/gists-code.module.css diff --git a/components/gists/gists-code.tsx b/app/gists/gists-code.tsx similarity index 100% rename from components/gists/gists-code.tsx rename to app/gists/gists-code.tsx diff --git a/components/gists/gists-skeleton.tsx b/app/gists/gists-skeleton.tsx similarity index 74% rename from components/gists/gists-skeleton.tsx rename to app/gists/gists-skeleton.tsx index 13f13fb..cd981a9 100644 --- a/components/gists/gists-skeleton.tsx +++ b/app/gists/gists-skeleton.tsx @@ -1,17 +1,5 @@ -import dayjs from 'dayjs'; -import relativeTime from 'dayjs/plugin/relativeTime'; -import dynamic from 'next/dynamic'; -import { Suspense } from 'react'; import clsx from 'clsx'; - -const GistsCode = dynamic( - () => import('components/gists/gists-code-skeleton'), - { - suspense: true, - } -); - -dayjs.extend(relativeTime); +// import GistsCode from './gists-code'; const GistSkeleton = () => { return ( @@ -48,9 +36,7 @@ const GistSkeleton = () => {

- - - + {/* */} diff --git a/app/gists/page.tsx b/app/gists/page.tsx index bb9432d..81dfd7a 100644 --- a/app/gists/page.tsx +++ b/app/gists/page.tsx @@ -2,8 +2,8 @@ import { getGists } from 'lib/fetcher'; import { notFound } from 'next/navigation'; import UserInfo from './user-info'; import { Suspense } from 'react'; -import FileContent from 'components/gists/file-content'; import Pagination from 'components/rua/rua-pagination'; +import FileContent from './file-content'; export default async function Page() { const gists = await getGists();