From e652279b41f9457ff68f02ef2a8cb1427a1060bd Mon Sep 17 00:00:00 2001 From: nthanhtoan61 Date: Sat, 16 May 2026 10:02:11 +0700 Subject: [PATCH] feat: configure basePath from env and update font strategy --- .env.example | 3 +- app/components/home/PartnersCarousel.tsx | 9 +---- app/globals.css | 16 ++++---- app/layout.tsx | 15 +++++++- next.config.ts | 6 ++- package-lock.json | 46 +++++++++++++++++++++++ public/assets/img/tech-logo.png | Bin 0 -> 117908 bytes 7 files changed, 74 insertions(+), 21 deletions(-) create mode 100644 public/assets/img/tech-logo.png diff --git a/.env.example b/.env.example index 9480ce3..b845899 100644 --- a/.env.example +++ b/.env.example @@ -1,3 +1,4 @@ PORT=3000 # MongoDB — summit request queue (registration + feedback) -MONGODB_URI=mongodb://localhost:27017/ipv6_summit \ No newline at end of file +MONGODB_URI=mongodb://localhost:27017/ipv6_summit +NEXT_PUBLIC_BASE_PATH=/ipv6 \ No newline at end of file diff --git a/app/components/home/PartnersCarousel.tsx b/app/components/home/PartnersCarousel.tsx index 2092c72..88bc246 100644 --- a/app/components/home/PartnersCarousel.tsx +++ b/app/components/home/PartnersCarousel.tsx @@ -1,7 +1,5 @@ "use client"; -import { useEffect, useState } from "react"; - // Tên file chính xác trong public/assets/img/carousel/ const ROW_1 = [ { name: "NVIDIA", file: "Nvidia_logo.svg.png" }, @@ -76,12 +74,7 @@ function CarouselRow({ } export default function PartnersCarousel() { - const [base, setBase] = useState(""); - - useEffect(() => { - const match = window.location.pathname.match(/^(\/ipv6)/); - setBase(match ? match[1] : ""); - }, []); + const base = process.env.NEXT_PUBLIC_BASE_PATH || ""; return (
diff --git a/app/globals.css b/app/globals.css index 5929ff5..f1dd48e 100644 --- a/app/globals.css +++ b/app/globals.css @@ -1,12 +1,6 @@ @import "tailwindcss"; -@font-face { - font-family: "Nasalization"; - src: url("/assets/webfonts/Nasalization Rg.otf") format("opentype"); - font-weight: normal; - font-style: normal; - font-display: swap; -} +/* @font-face Nasalization được inject qua layout.tsx để hỗ trợ basePath động */ @theme { /* IPV6 Summit design tokens */ @@ -24,7 +18,7 @@ --color-on-surface-variant: #e0e0e0; --color-outline: #c5a059; - --font-body-base: "Nasalization", system-ui, sans-serif; + --font-body-base: "Roboto", system-ui, sans-serif; --font-display-lg: "Nasalization", system-ui, sans-serif; --font-label-caps: "Nasalization", system-ui, sans-serif; --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", @@ -45,10 +39,14 @@ html { body { background-color: var(--color-background); color: var(--color-on-surface-variant); - font-family: "Nasalization", system-ui, sans-serif; + font-family: "Roboto", system-ui, sans-serif; overflow-x: hidden; } +h1, h2, h3, h4, h5, h6 { + font-family: "Nasalization", system-ui, sans-serif; +} + input::placeholder, textarea::placeholder { color: rgba(224, 224, 224, 0.4); diff --git a/app/layout.tsx b/app/layout.tsx index c6867ba..306c146 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -3,6 +3,8 @@ import "../public/assets/css/all.min.css"; import "./globals.css"; import { LanguageProvider } from "@/app/context/LanguageContext"; +const basePath = process.env.NEXT_PUBLIC_BASE_PATH || ""; + export const metadata: Metadata = { metadataBase: new URL(process.env.NEXT_PUBLIC_BASE_URL || "http://localhost:3000"), title: "IPv6 Summit 2026 | Infrastructure for AI", @@ -14,14 +16,25 @@ export default function RootLayout({ children }: { children: React.ReactNode }) return ( + {/* Nasalization font — path prefixed with basePath for subdirectory deployments */} +