feat: redirect banner and new domain

This commit is contained in:
trafficlunar 2025-06-10 21:53:41 +01:00
parent 62f33440f3
commit cea8d721de
2 changed files with 20 additions and 0 deletions

View file

@ -8,6 +8,7 @@ import Providers from "./provider";
import Header from "@/components/header";
import Footer from "@/components/footer";
import AdminBanner from "@/components/admin/banner";
import RedirectBanner from "@/components/redirect-banner";
const lexend = Lexend({
subsets: ["latin"],
@ -54,6 +55,7 @@ export default function RootLayout({
<Providers>
<Header />
<AdminBanner />
<RedirectBanner />
<main className="px-4 py-8 max-w-7xl w-full flex-grow flex flex-col">{children}</main>
<Footer />
</Providers>

View file

@ -0,0 +1,18 @@
import { headers } from "next/headers";
import { Icon } from "@iconify/react";
export default async function RedirectBanner() {
const headersList = await headers();
const referer = headersList.get("Referer");
if (referer !== "https://tomodachi-share.trafficlunar.net") return null;
return (
<div className="w-full h-10 bg-orange-300 border-y-2 border-y-orange-400 mt-1 shadow-md flex justify-center items-center gap-2 text-orange-900 text-nowrap overflow-x-auto font-semibold max-sm:justify-start">
<Icon icon="humbleicons:link" className="text-2xl min-w-6" />
<span>
You&apos;ve been redirected TomodachiShare is now at <strong>tomodachishare.com</strong>!
</span>
</div>
);
}