mirror of
https://github.com/snowykami/neo-blog.git
synced 2025-09-26 11:06:23 +00:00
♻️ refactor: standardize code formatting and improve readability across components
- Updated component files to use consistent single quotes for strings. - Removed unnecessary newlines and adjusted indentation for better readability. - Simplified conditional rendering and improved code structure in various components. - Added ESLint configuration for better code quality and adherence to standards. - Enhanced error handling in i18n request logic.
This commit is contained in:
@ -1,9 +1,8 @@
|
||||
|
||||
export default function ArchivesPage() {
|
||||
return (
|
||||
<div>
|
||||
<h1>归档</h1>
|
||||
<p>这里是博客文章的归档页面。</p>
|
||||
</div>
|
||||
)
|
||||
return (
|
||||
<div>
|
||||
<h1>归档</h1>
|
||||
<p>这里是博客文章的归档页面。</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
@ -1,14 +1,15 @@
|
||||
"use client";
|
||||
'use client'
|
||||
|
||||
import { AnimatePresence, motion } from 'framer-motion'
|
||||
import { usePathname } from 'next/navigation'
|
||||
import { Navbar } from '@/components/navbar'
|
||||
|
||||
import { Navbar } from "@/components/navbar";
|
||||
import { AnimatePresence, motion } from "framer-motion";
|
||||
import { usePathname } from "next/navigation";
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
children: React.ReactNode
|
||||
}>) {
|
||||
const pathname = usePathname();
|
||||
const pathname = usePathname()
|
||||
return (
|
||||
<>
|
||||
<header className="fixed top-0 left-0 w-full z-50 bg-white/80 dark:bg-slate-900/80 backdrop-blur flex justify-center border-b border-slate-200 dark:border-slate-800">
|
||||
@ -21,9 +22,9 @@ export default function RootLayout({
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
exit={{ opacity: 0, y: 16 }}
|
||||
transition={{
|
||||
type: "tween",
|
||||
ease: "easeOut",
|
||||
duration: 0.18
|
||||
type: 'tween',
|
||||
ease: 'easeOut',
|
||||
duration: 0.18,
|
||||
}}
|
||||
className="pt-16"
|
||||
>
|
||||
@ -31,5 +32,5 @@ export default function RootLayout({
|
||||
</motion.main>
|
||||
</AnimatePresence>
|
||||
</>
|
||||
);
|
||||
)
|
||||
}
|
||||
|
@ -1,13 +1,14 @@
|
||||
import { getPostById } from "@/api/post";
|
||||
import BlogPost from "@/components/blog-post";
|
||||
import { getPostById } from '@/api/post'
|
||||
import BlogPost from '@/components/blog-post'
|
||||
|
||||
interface Props {
|
||||
params: Promise<{ id: string }>
|
||||
}
|
||||
|
||||
export default async function PostPage({ params }: Props) {
|
||||
const { id } = await params;
|
||||
const post = await getPostById(id);
|
||||
if (!post) return <div>文章不存在</div>;
|
||||
return <BlogPost post={post} />;
|
||||
}
|
||||
const { id } = await params
|
||||
const post = await getPostById(id)
|
||||
if (!post)
|
||||
return <div>文章不存在</div>
|
||||
return <BlogPost post={post} />
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
export default function LabelsPage() {
|
||||
return (
|
||||
<div>
|
||||
<h1>标签</h1>
|
||||
<p>这里是博客文章的标签页面。</p>
|
||||
</div>
|
||||
)
|
||||
return (
|
||||
<div>
|
||||
<h1>标签</h1>
|
||||
<p>这里是博客文章的标签页面。</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
export default function Page() {
|
||||
return (
|
||||
<div>
|
||||
<h1>Page Title</h1>
|
||||
<p>This is the User content.</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
return (
|
||||
<div>
|
||||
<h1>Page Title</h1>
|
||||
<p>This is the User content.</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
@ -1,11 +1,11 @@
|
||||
export default function RootLayout({
|
||||
children,
|
||||
children,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
children: React.ReactNode
|
||||
}>) {
|
||||
return (
|
||||
<>
|
||||
{children}
|
||||
</>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<>
|
||||
{children}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ import { Geist, Geist_Mono } from "next/font/google";
|
||||
import "./globals.css";
|
||||
import { DeviceProvider } from "@/contexts/device-context";
|
||||
import { NextIntlClientProvider } from 'next-intl';
|
||||
import { getLocale } from 'next-intl/server';
|
||||
|
||||
const geistSans = Geist({
|
||||
variable: "--font-geist-sans",
|
||||
|
@ -1,7 +1,7 @@
|
||||
import Image from "next/image"
|
||||
import { LoginForm } from "@/components/login-form"
|
||||
import config from "@/config"
|
||||
import { Suspense } from "react"
|
||||
import Image from 'next/image'
|
||||
import { Suspense } from 'react'
|
||||
import { LoginForm } from '@/components/login-form'
|
||||
import config from '@/config'
|
||||
|
||||
function LoginPageContent() {
|
||||
return (
|
||||
@ -27,7 +27,7 @@ function LoginPageContent() {
|
||||
|
||||
export default function LoginPage() {
|
||||
return (
|
||||
<Suspense fallback={
|
||||
<Suspense fallback={(
|
||||
<div className="bg-muted flex min-h-svh flex-col items-center justify-center gap-6 p-6 md:p-10">
|
||||
<div className="flex w-full max-w-sm flex-col gap-6">
|
||||
<div className="animate-pulse">
|
||||
@ -44,8 +44,9 @@ export default function LoginPage() {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}>
|
||||
)}
|
||||
>
|
||||
<LoginPageContent />
|
||||
</Suspense>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user