feat: add NoScript component

This commit is contained in:
Dorian Niemiec 2024-09-08 06:33:47 +02:00
parent 810bb823b4
commit a177f423e2
3 changed files with 15 additions and 2 deletions

View file

@ -1,6 +1,7 @@
import Footer from "@/components/shared/Footer"; import Footer from "@/components/shared/Footer";
import Navbar from "@/components/shared/Navbar"; import Navbar from "@/components/shared/Navbar";
import Banner from "@/components/widgets/Banner"; import Banner from "@/components/widgets/Banner";
import NoScript from "@/components/shared/NoScript";
import { Home } from "lucide-react"; import { Home } from "lucide-react";
import { Metadata } from "next"; import { Metadata } from "next";
@ -52,6 +53,7 @@ export default function PageLayout({
buttonText="Read more" buttonText="Read more"
/> />
<Navbar /> <Navbar />
<NoScript />
<div className="flex-grow flex-1 overflow-x-hidden">{children}</div> <div className="flex-grow flex-1 overflow-x-hidden">{children}</div>
<Footer /> <Footer />
</div> </div>

View file

@ -2,6 +2,7 @@ import type { Metadata } from "next";
import Footer from "@/components/shared/Footer"; import Footer from "@/components/shared/Footer";
import Navbar from "@/components/shared/Navbar"; import Navbar from "@/components/shared/Navbar";
import Link from "next/link"; import Link from "next/link";
import NoScript from "@/components/shared/NoScript";
export const metadata: Metadata = { export const metadata: Metadata = {
title: "404 Not Found - SVR.JS", title: "404 Not Found - SVR.JS",
@ -16,8 +17,9 @@ export const metadata: Metadata = {
const NotFound = () => { const NotFound = () => {
return ( return (
<> <>
<main className="flex flex-col min-h-screen"> <div className="flex flex-col min-h-screen">
<Navbar /> <Navbar />
<NoScript />
<section <section
id="404error" id="404error"
className="flex-center flex-col wrapper container flex-1 flex-grow" className="flex-center flex-col wrapper container flex-1 flex-grow"
@ -33,7 +35,7 @@ const NotFound = () => {
</p> </p>
</section> </section>
<Footer /> <Footer />
</main> </div>
</> </>
); );
}; };

View file

@ -0,0 +1,9 @@
const NoScript = () => {
return (
<noscript className="bg-orange-500 text-white p-1 font-bold text-lg">
Turn on JavaScript for a better experience.
</noscript>
);
};
export default NoScript;