From 8c05ad29cbe341cfa8c28547295785733f7c6eba Mon Sep 17 00:00:00 2001 From: Thatsaphorn Atchariyaphap Date: Sat, 28 Jun 2025 12:01:43 +0000 Subject: [PATCH] Refactor website to use shadcn components --- frontend/app/(root)/Home.tsx | 45 + frontend/app/(root)/layout.tsx | 37 - frontend/app/(root)/page.tsx | 10 +- .../(root)/sections}/About.tsx | 54 +- frontend/app/(root)/sections/Faq.tsx | 109 ++ frontend/app/(root)/sections/Hero.tsx | 76 + frontend/app/(root)/sections/HomeServices.tsx | 115 ++ .../app/(root)/sections/ProcessSection.tsx | 88 ++ .../app/(root)/sections/ReferralSection.tsx | 60 + frontend/app/(root)/sections/TechStack.tsx | 87 ++ frontend/app/(root)/sections/WhyUs.tsx | 69 + .../about}/Section/TeamSection.tsx | 52 +- frontend/app/about/layout.tsx | 37 - frontend/app/about/page.tsx | 12 - frontend/app/contact/layout.tsx | 37 - frontend/app/contact/page.tsx | 7 + frontend/app/globals.css | 68 + frontend/app/layout.tsx | 58 + frontend/app/legal/imprint/ImprintComp.tsx | 117 ++ frontend/app/legal/imprint/page.tsx | 11 +- frontend/app/legal/layout.tsx | 38 - frontend/app/legal/page.tsx | 64 +- .../legal/privacy}/PrivacyComp.tsx | 39 +- frontend/app/legal/privacy/page.tsx | 9 +- frontend/app/legal/revocation/page.tsx | 12 - .../app/legal/terms-of-use/TermsOfUseComp.tsx | 98 ++ frontend/app/legal/terms-of-use/page.tsx | 9 +- frontend/app/services/layout.tsx | 37 - frontend/app/services/page.tsx | 12 - frontend/components.json | 21 + frontend/components/About/AboutContent.tsx | 47 - .../components/About/Section/AboutHero.tsx | 19 - .../components/About/Section/AboutIntro.tsx | 68 - .../components/About/Section/AboutProcess.tsx | 158 -- .../About/Section/AboutTimeline.tsx | 94 -- frontend/components/CTA/DualCTA.tsx | 66 + frontend/components/Contact/Contact.tsx | 53 +- .../Contact/Section/ContactFormSection.tsx | 191 +-- .../Contact/Section/ContactHero.tsx | 19 - .../components/Cookie/CookieConsentBanner.tsx | 128 ++ frontend/components/Footer/Footer.tsx | 142 +- frontend/components/Helper/SmallHero.tsx | 53 +- frontend/components/Helper/ThemeColors.ts | 34 - frontend/components/Home/Home.tsx | 45 - .../components/Home/Sections/ContactCTA.tsx | 62 - frontend/components/Home/Sections/Hero.tsx | 100 -- .../components/Home/Sections/HomeServices.tsx | 105 -- .../components/Home/Sections/TechStack.tsx | 139 -- .../components/Legal/Imprint/ImprintComp.tsx | 131 -- frontend/components/Legal/RevocationComp.tsx | 98 -- frontend/components/Legal/TermsOfUseComp.tsx | 99 -- frontend/components/Navbar/DesktopNav.tsx | 110 -- frontend/components/Navbar/MobileNav.tsx | 62 - frontend/components/Navbar/Nav.tsx | 24 - frontend/components/Navbar/Navbar.tsx | 102 ++ frontend/components/PulsatingButton.tsx | 136 ++ .../Services/Section/OverviewTabs.tsx | 81 - .../Services/Section/ServiceHero.tsx | 19 - .../Services/Section/overview/BugFixing.tsx | 59 - .../Services/Section/overview/Consulting.tsx | 60 - .../Services/Section/overview/Development.tsx | 210 --- .../Section/overview/ManagedServices.tsx | 62 - frontend/components/Services/Services.tsx | 38 - .../components/provider/ThemeProvider.tsx | 50 - frontend/components/theme-provider.tsx | 11 + frontend/components/theme-toggle.tsx | 26 + frontend/components/ui/accordion.tsx | 57 + frontend/components/ui/button.tsx | 57 + frontend/components/ui/card.tsx | 76 + frontend/components/ui/dropdown-menu.tsx | 201 +++ frontend/components/ui/navigation-menu.tsx | 128 ++ frontend/components/ui/sheet.tsx | 140 ++ frontend/constant/TechStack.ts | 49 + frontend/lib/utils.ts | 6 + frontend/package-lock.json | 1370 +++++++++++++++-- frontend/package.json | 20 +- frontend/tailwind.config.ts | 77 +- frontend/utils/useThemeColors.ts | 10 - 78 files changed, 3858 insertions(+), 2722 deletions(-) create mode 100644 frontend/app/(root)/Home.tsx delete mode 100644 frontend/app/(root)/layout.tsx rename frontend/{components/Home/Sections => app/(root)/sections}/About.tsx (59%) create mode 100644 frontend/app/(root)/sections/Faq.tsx create mode 100644 frontend/app/(root)/sections/Hero.tsx create mode 100644 frontend/app/(root)/sections/HomeServices.tsx create mode 100644 frontend/app/(root)/sections/ProcessSection.tsx create mode 100644 frontend/app/(root)/sections/ReferralSection.tsx create mode 100644 frontend/app/(root)/sections/TechStack.tsx create mode 100644 frontend/app/(root)/sections/WhyUs.tsx rename frontend/{components/About => app/about}/Section/TeamSection.tsx (62%) delete mode 100644 frontend/app/about/layout.tsx delete mode 100644 frontend/app/about/page.tsx delete mode 100644 frontend/app/contact/layout.tsx create mode 100644 frontend/app/layout.tsx create mode 100644 frontend/app/legal/imprint/ImprintComp.tsx delete mode 100644 frontend/app/legal/layout.tsx rename frontend/{components/Legal/Privacy => app/legal/privacy}/PrivacyComp.tsx (77%) delete mode 100644 frontend/app/legal/revocation/page.tsx create mode 100644 frontend/app/legal/terms-of-use/TermsOfUseComp.tsx delete mode 100644 frontend/app/services/layout.tsx delete mode 100644 frontend/app/services/page.tsx create mode 100644 frontend/components.json delete mode 100644 frontend/components/About/AboutContent.tsx delete mode 100644 frontend/components/About/Section/AboutHero.tsx delete mode 100644 frontend/components/About/Section/AboutIntro.tsx delete mode 100644 frontend/components/About/Section/AboutProcess.tsx delete mode 100644 frontend/components/About/Section/AboutTimeline.tsx create mode 100644 frontend/components/CTA/DualCTA.tsx delete mode 100644 frontend/components/Contact/Section/ContactHero.tsx create mode 100644 frontend/components/Cookie/CookieConsentBanner.tsx delete mode 100644 frontend/components/Helper/ThemeColors.ts delete mode 100644 frontend/components/Home/Home.tsx delete mode 100644 frontend/components/Home/Sections/ContactCTA.tsx delete mode 100644 frontend/components/Home/Sections/Hero.tsx delete mode 100644 frontend/components/Home/Sections/HomeServices.tsx delete mode 100644 frontend/components/Home/Sections/TechStack.tsx delete mode 100644 frontend/components/Legal/Imprint/ImprintComp.tsx delete mode 100644 frontend/components/Legal/RevocationComp.tsx delete mode 100644 frontend/components/Legal/TermsOfUseComp.tsx delete mode 100644 frontend/components/Navbar/DesktopNav.tsx delete mode 100644 frontend/components/Navbar/MobileNav.tsx delete mode 100644 frontend/components/Navbar/Nav.tsx create mode 100644 frontend/components/Navbar/Navbar.tsx create mode 100644 frontend/components/PulsatingButton.tsx delete mode 100644 frontend/components/Services/Section/OverviewTabs.tsx delete mode 100644 frontend/components/Services/Section/ServiceHero.tsx delete mode 100644 frontend/components/Services/Section/overview/BugFixing.tsx delete mode 100644 frontend/components/Services/Section/overview/Consulting.tsx delete mode 100644 frontend/components/Services/Section/overview/Development.tsx delete mode 100644 frontend/components/Services/Section/overview/ManagedServices.tsx delete mode 100644 frontend/components/Services/Services.tsx delete mode 100644 frontend/components/provider/ThemeProvider.tsx create mode 100644 frontend/components/theme-provider.tsx create mode 100644 frontend/components/theme-toggle.tsx create mode 100644 frontend/components/ui/accordion.tsx create mode 100644 frontend/components/ui/button.tsx create mode 100644 frontend/components/ui/card.tsx create mode 100644 frontend/components/ui/dropdown-menu.tsx create mode 100644 frontend/components/ui/navigation-menu.tsx create mode 100644 frontend/components/ui/sheet.tsx create mode 100644 frontend/constant/TechStack.ts create mode 100644 frontend/lib/utils.ts delete mode 100644 frontend/utils/useThemeColors.ts diff --git a/frontend/app/(root)/Home.tsx b/frontend/app/(root)/Home.tsx new file mode 100644 index 0000000..3bb024a --- /dev/null +++ b/frontend/app/(root)/Home.tsx @@ -0,0 +1,45 @@ +'use client'; + +import React, {useEffect} from "react"; +import HomeServices from "@/app/(root)/sections/HomeServices"; +import {motion} from "framer-motion"; +import Hero from "@/app/(root)/sections/Hero"; +import About from "@/app/(root)/sections/About"; +import ProcessSection from "@/app/(root)/sections/ProcessSection"; +import WhyUs from "@/app/(root)/sections/WhyUs"; +import Faq from "@/app/(root)/sections/Faq"; +import ReferralSection from "@/app/(root)/sections/ReferralSection"; + +const Home = () => { + useEffect(() => { + const scrollToId = localStorage.getItem('scrollToId') + if (scrollToId) { + localStorage.removeItem('scrollToId') + const el = document.getElementById(scrollToId) + if (el) { + setTimeout(() => { + el.scrollIntoView({behavior: 'smooth', block: 'start'}) + }, 200) + } + } + }, []) + + return ( + + + + + + + + + + ); +}; + +export default Home; diff --git a/frontend/app/(root)/layout.tsx b/frontend/app/(root)/layout.tsx deleted file mode 100644 index 518d45e..0000000 --- a/frontend/app/(root)/layout.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import type {Metadata} from "next"; -import "../globals.css"; - -import Nav from "@/components/Navbar/Nav"; -import Footer from "@/components/Footer/Footer"; -import {ThemeProvider} from "@/components/provider/ThemeProvider"; -import React from "react"; -import {cookies} from "next/headers"; -import {themeColors} from "@/components/Helper/ThemeColors"; - -export const metadata: Metadata = { - title: "Rhein Software", - description: "Rhein Software Development", -}; - -export default async function RootLayout({ - children, - }: Readonly<{ - children: React.ReactNode; -}>) { - const cookieStore = await cookies(); - const theme = cookieStore.get("theme")?.value === "dark" ? "dark" : "light"; - const bgColor = themeColors[theme].primaryBg; - - return ( - - - - -