From 92ec1b14c5981821db170881d26bf4fba46ac9a0 Mon Sep 17 00:00:00 2001 From: javayhu Date: Sun, 9 Mar 2025 20:01:07 +0800 Subject: [PATCH] refactor: format src/app folder --- biome.json | 4 +- .../[locale]/(dashborad)/dashboard/page.tsx | 10 +-- src/app/[locale]/(marketing)/(home)/page.tsx | 18 ++-- .../(marketing)/(pages)/about/page.tsx | 83 ++++++++++--------- .../(marketing)/(pages)/changelog/page.tsx | 4 +- .../(marketing)/(pages)/contact/page.tsx | 16 ++-- .../(pages)/cookie-policy/page.tsx | 10 +-- .../[locale]/(marketing)/(pages)/layout.tsx | 6 +- .../(pages)/privacy-policy/page.tsx | 10 +-- .../(pages)/terms-of-service/page.tsx | 10 +-- .../(marketing)/(pages)/waitlist/page.tsx | 10 +-- .../blocks/call-to-action/page.tsx | 8 +- .../(marketing)/blocks/content/page.tsx | 14 ++-- .../[locale]/(marketing)/blocks/faq/page.tsx | 4 +- .../(marketing)/blocks/features/page.tsx | 30 +++---- .../[locale]/(marketing)/blocks/hero/page.tsx | 12 +-- .../(marketing)/blocks/pricing/page.tsx | 10 +-- .../(marketing)/blocks/stats/page.tsx | 14 ++-- .../(marketing)/blocks/testimonials/page.tsx | 18 ++-- .../blog/(blog)/category/[slug]/page.tsx | 46 +++++----- .../(marketing)/blog/(blog)/layout.tsx | 20 ++--- .../(marketing)/blog/(blog)/loading.tsx | 2 +- .../[locale]/(marketing)/blog/(blog)/page.tsx | 13 +-- .../(marketing)/blog/[...slug]/layout.tsx | 6 +- .../(marketing)/blog/[...slug]/page.tsx | 54 ++++++------ src/app/[locale]/(marketing)/layout.tsx | 9 +- src/app/[locale]/(marketing)/pricing/page.tsx | 10 +-- src/app/[locale]/[...rest]/page.tsx | 8 +- src/app/[locale]/auth/error/page.tsx | 12 +-- .../[locale]/auth/forgot-password/page.tsx | 12 +-- src/app/[locale]/auth/layout.tsx | 6 +- src/app/[locale]/auth/loading.tsx | 2 +- src/app/[locale]/auth/login/page.tsx | 28 +++---- src/app/[locale]/auth/register/page.tsx | 12 +-- src/app/[locale]/auth/reset-password/page.tsx | 10 +-- src/app/[locale]/error.tsx | 10 +-- src/app/[locale]/layout.tsx | 78 +++++++++-------- src/app/[locale]/loading.tsx | 2 +- src/app/[locale]/not-found.tsx | 10 +-- src/app/[locale]/providers.tsx | 17 ++-- src/app/api/auth/[...all]/route.ts | 6 +- src/app/layout.tsx | 8 +- src/app/manifest.ts | 14 ++-- src/app/not-found.tsx | 8 +- src/app/robots.ts | 8 +- 45 files changed, 352 insertions(+), 350 deletions(-) diff --git a/biome.json b/biome.json index e57265f..0a50ab2 100644 --- a/biome.json +++ b/biome.json @@ -9,6 +9,7 @@ "ignoreUnknown": true, "ignore": [ ".next/**", + ".content-collections/**", "node_modules/**", "dist/**", "build/**", @@ -45,6 +46,7 @@ }, "ignore": [ ".next/**", + ".content-collections/**", "node_modules/**", "dist/**", "build/**", @@ -55,7 +57,7 @@ }, "javascript": { "formatter": { - "quoteStyle": "double", + "quoteStyle": "single", "trailingCommas": "es5", "semicolons": "always" } diff --git a/src/app/[locale]/(dashborad)/dashboard/page.tsx b/src/app/[locale]/(dashborad)/dashboard/page.tsx index d66ba6c..c4893af 100644 --- a/src/app/[locale]/(dashborad)/dashboard/page.tsx +++ b/src/app/[locale]/(dashborad)/dashboard/page.tsx @@ -1,4 +1,4 @@ -import { AppSidebar } from "@/components/app-sidebar"; +import { AppSidebar } from '@/components/app-sidebar'; import { Breadcrumb, BreadcrumbItem, @@ -6,20 +6,20 @@ import { BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, -} from "@/components/ui/breadcrumb"; -import { Separator } from "@/components/ui/separator"; +} from '@/components/ui/breadcrumb'; +import { Separator } from '@/components/ui/separator'; import { SidebarInset, SidebarProvider, SidebarTrigger, -} from "@/components/ui/sidebar"; +} from '@/components/ui/sidebar'; export default function Page() { return ( -
+
diff --git a/src/app/[locale]/(marketing)/(home)/page.tsx b/src/app/[locale]/(marketing)/(home)/page.tsx index 801c046..328a68b 100644 --- a/src/app/[locale]/(marketing)/(home)/page.tsx +++ b/src/app/[locale]/(marketing)/(home)/page.tsx @@ -1,16 +1,16 @@ -import CallToAction3 from "@/components/blocks/call-to-action/call-to-action-3"; -import Content2 from "@/components/blocks/content/content-2"; -import FAQs from "@/components/blocks/faq/faqs"; -import FeaturesSection from "@/components/blocks/features/features-8"; -import HeroSection from "@/components/blocks/hero/hero-section-4"; -import LogoCloud from "@/components/blocks/logo-cloud/logo-cloud"; -import Pricing from "@/components/blocks/pricing/pricing"; -import StatsSection from "@/components/blocks/stats/stats"; +import CallToAction3 from '@/components/blocks/call-to-action/call-to-action-3'; +import Content2 from '@/components/blocks/content/content-2'; +import FAQs from '@/components/blocks/faq/faqs'; +import FeaturesSection from '@/components/blocks/features/features-8'; +import HeroSection from '@/components/blocks/hero/hero-section-4'; +import LogoCloud from '@/components/blocks/logo-cloud/logo-cloud'; +import Pricing from '@/components/blocks/pricing/pricing'; +import StatsSection from '@/components/blocks/stats/stats'; import { getTranslations } from 'next-intl/server'; interface HomePageProps { params: Promise<{ locale: string }>; -}; +} export default async function HomePage(props: HomePageProps) { const params = await props.params; diff --git a/src/app/[locale]/(marketing)/(pages)/about/page.tsx b/src/app/[locale]/(marketing)/(pages)/about/page.tsx index e2870b3..3099d2e 100644 --- a/src/app/[locale]/(marketing)/(pages)/about/page.tsx +++ b/src/app/[locale]/(marketing)/(pages)/about/page.tsx @@ -1,15 +1,15 @@ -import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; -import { Button } from "@/components/ui/button"; -import { siteConfig } from "@/config/site"; -import { MailIcon, UserCircleIcon } from "lucide-react"; -import { getTranslations } from "next-intl/server"; -import Image from "next/image"; +import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'; +import { Button } from '@/components/ui/button'; +import { siteConfig } from '@/config/site'; +import { MailIcon, UserCircleIcon } from 'lucide-react'; +import { getTranslations } from 'next-intl/server'; +import Image from 'next/image'; /** * inspired by https://astro-nomy.vercel.app/about */ export default async function AboutPage() { - const t = await getTranslations("AboutPage"); + const t = await getTranslations('AboutPage'); return (
@@ -31,10 +31,10 @@ export default async function AboutPage() {

- {t("authorName")} + {t('authorName')}

- {t("authorBio")} + {t('authorBio')}

@@ -42,15 +42,13 @@ export default async function AboutPage() { {/* introduction */}

- {t("authorIntroduction")} + {t('authorIntroduction')}

@@ -65,14 +63,17 @@ export default async function AboutPage() { {/* Mobile view (1 column) */}
{images.map((image, index) => ( -
+
{image.alt}
@@ -83,14 +84,17 @@ export default async function AboutPage() {
{images.slice(0, 4).map((image, index) => ( -
+
{image.alt}
@@ -98,14 +102,17 @@ export default async function AboutPage() {
{images.slice(4, 8).map((image, index) => ( -
+
{image.alt}
@@ -237,50 +244,50 @@ const images: ImagesProps[] = [ // first column { image: - "https://images.pexels.com/photos/15372903/pexels-photo-15372903/free-photo-of-computer-setup-with-big-monitor-screen.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1", - alt: "setup desktop", + 'https://images.pexels.com/photos/15372903/pexels-photo-15372903/free-photo-of-computer-setup-with-big-monitor-screen.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1', + alt: 'setup desktop', }, { image: - "https://images.pexels.com/photos/1049317/pexels-photo-1049317.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1", - alt: "friends smiles", + 'https://images.pexels.com/photos/1049317/pexels-photo-1049317.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1', + alt: 'friends smiles', }, // second column { image: - "https://images.pexels.com/photos/3712095/pexels-photo-3712095.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1", - alt: "grey cat", + 'https://images.pexels.com/photos/3712095/pexels-photo-3712095.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1', + alt: 'grey cat', }, { image: - "https://images.pexels.com/photos/9293249/pexels-photo-9293249.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1", - alt: "home building", + 'https://images.pexels.com/photos/9293249/pexels-photo-9293249.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1', + alt: 'home building', }, { image: - "https://images.pexels.com/photos/375467/pexels-photo-375467.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1", - alt: "pizza laptop", + 'https://images.pexels.com/photos/375467/pexels-photo-375467.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1', + alt: 'pizza laptop', }, // third column { image: - "https://images.pexels.com/photos/1230302/pexels-photo-1230302.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1", - alt: "hike and sunset", + 'https://images.pexels.com/photos/1230302/pexels-photo-1230302.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1', + alt: 'hike and sunset', }, { image: - "https://images.pexels.com/photos/5500779/pexels-photo-5500779.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1", - alt: "chinese lantern", + 'https://images.pexels.com/photos/5500779/pexels-photo-5500779.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1', + alt: 'chinese lantern', }, // fourth column { image: - "https://images.pexels.com/photos/2090644/pexels-photo-2090644.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1", - alt: "the great wheel", + 'https://images.pexels.com/photos/2090644/pexels-photo-2090644.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1', + alt: 'the great wheel', }, { image: - "https://images.pexels.com/photos/7418632/pexels-photo-7418632.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1", - alt: "dalmatian", + 'https://images.pexels.com/photos/7418632/pexels-photo-7418632.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1', + alt: 'dalmatian', }, -]; \ No newline at end of file +]; diff --git a/src/app/[locale]/(marketing)/(pages)/changelog/page.tsx b/src/app/[locale]/(marketing)/(pages)/changelog/page.tsx index c2c09a6..46525a8 100644 --- a/src/app/[locale]/(marketing)/(pages)/changelog/page.tsx +++ b/src/app/[locale]/(marketing)/(pages)/changelog/page.tsx @@ -25,8 +25,8 @@ export async function generateMetadata( title: 'Changelog', description: 'Track all updates and improvements to our platform', type: 'article', - url: `${getBaseUrl()}/changelog` - } + url: `${getBaseUrl()}/changelog`, + }, }; } diff --git a/src/app/[locale]/(marketing)/(pages)/contact/page.tsx b/src/app/[locale]/(marketing)/(pages)/contact/page.tsx index 5f62f2c..e569840 100644 --- a/src/app/[locale]/(marketing)/(pages)/contact/page.tsx +++ b/src/app/[locale]/(marketing)/(pages)/contact/page.tsx @@ -1,4 +1,4 @@ -"use client"; +'use client'; import { Button } from '@/components/ui/button'; import { Card } from '@/components/ui/card'; @@ -35,23 +35,17 @@ export default function ContactPage() {
- +
- +
- +