From 51b0956ad17f39fbeeae2247436fc7da3b1e2b92 Mon Sep 17 00:00:00 2001 From: Dada878 Date: Thu, 28 Nov 2024 16:08:52 +0800 Subject: [PATCH] refactor: move SHOW_EARLY_BIRD constant to lib/const and update imports --- app/cfp/(submission)/_components/early-bird.tsx | 2 +- app/cfp/(submission)/normal/page.tsx | 2 +- app/cfp/(submission)/poster/page.tsx | 2 +- app/cfp/(submission)/undefined/page.tsx | 2 +- app/layout.tsx | 2 -- lib/const.ts | 1 + 6 files changed, 5 insertions(+), 6 deletions(-) create mode 100644 lib/const.ts diff --git a/app/cfp/(submission)/_components/early-bird.tsx b/app/cfp/(submission)/_components/early-bird.tsx index f7d8a2ee..de518c00 100644 --- a/app/cfp/(submission)/_components/early-bird.tsx +++ b/app/cfp/(submission)/_components/early-bird.tsx @@ -1,6 +1,6 @@ "use client"; -import { SHOW_EARLY_BIRD } from "@/app/layout"; +import { SHOW_EARLY_BIRD } from "@/lib/const"; import { AnimatePresence, motion } from "framer-motion"; import { useState } from "react"; diff --git a/app/cfp/(submission)/normal/page.tsx b/app/cfp/(submission)/normal/page.tsx index a94a2178..f586cf76 100644 --- a/app/cfp/(submission)/normal/page.tsx +++ b/app/cfp/(submission)/normal/page.tsx @@ -9,7 +9,7 @@ import Link from "next/link"; import Image from "next/image"; import { ReactNode } from "react"; import EarlyBird from "../_components/early-bird"; -import { SHOW_EARLY_BIRD } from "@/app/layout"; +import { SHOW_EARLY_BIRD } from "@/lib/const"; function PresentationBlock(presentation: { title: string; id: string }) { return ( diff --git a/app/cfp/(submission)/poster/page.tsx b/app/cfp/(submission)/poster/page.tsx index 0024580b..eaff6956 100644 --- a/app/cfp/(submission)/poster/page.tsx +++ b/app/cfp/(submission)/poster/page.tsx @@ -6,7 +6,7 @@ import TableOfContent from "../_components/table-of-content"; import FAQ from "../../_components/faq"; import { InformationField } from "../normal/page"; import EarlyBird from "../_components/early-bird"; -import { SHOW_EARLY_BIRD } from "@/app/layout"; +import { SHOW_EARLY_BIRD } from "@/lib/const"; export default function Page() { const sections = [ diff --git a/app/cfp/(submission)/undefined/page.tsx b/app/cfp/(submission)/undefined/page.tsx index 5a1862d3..c500d72c 100644 --- a/app/cfp/(submission)/undefined/page.tsx +++ b/app/cfp/(submission)/undefined/page.tsx @@ -6,7 +6,7 @@ import FAQ from "../../_components/faq"; import Link from "next/link"; import { InformationField } from "../normal/page"; import EarlyBird from "../_components/early-bird"; -import { SHOW_EARLY_BIRD } from "@/app/layout"; +import { SHOW_EARLY_BIRD } from "@/lib/const"; export default function Page() { const sections = [ diff --git a/app/layout.tsx b/app/layout.tsx index 0567404e..96ff63e9 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -7,8 +7,6 @@ import { config } from "@fortawesome/fontawesome-svg-core"; import "@fortawesome/fontawesome-svg-core/styles.css"; config.autoAddCss = false; -export const SHOW_EARLY_BIRD = false; - const inter = Inter({ subsets: ["latin"] }); export default function Layout({ children }: { children: ReactNode }) { const jsonLd = { diff --git a/lib/const.ts b/lib/const.ts new file mode 100644 index 00000000..b983a82d --- /dev/null +++ b/lib/const.ts @@ -0,0 +1 @@ +export const SHOW_EARLY_BIRD = false;