Skip to content

Commit

Permalink
feat: custom not-found page
Browse files Browse the repository at this point in the history
  • Loading branch information
tarcisioandrade committed Sep 28, 2023
1 parent 0627c4e commit 016c469
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 12 deletions.
16 changes: 16 additions & 0 deletions src/app/(home)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Footer from "@/components/footer";
import Header from "@/components/header";

export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<>
<Header />
{children}
<Footer />
</>
);
}
File renamed without changes.
16 changes: 16 additions & 0 deletions src/app/(post-page)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Footer from "@/components/footer";
import Header from "@/components/header";

export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<>
<Header />
{children}
<Footer />
</>
);
}
16 changes: 16 additions & 0 deletions src/app/category/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Footer from "@/components/footer";
import Header from "@/components/header";

export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<>
<Header />
{children}
<Footer />
</>
);
}
8 changes: 4 additions & 4 deletions src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
}

mark {
@apply dark:bg-slate-800 bg-gray-200 text-black dark:text-white rounded py-[4.5px] px-[6px];
@apply rounded bg-gray-200 px-[6px] py-[4.5px] text-black dark:bg-slate-800 dark:text-white;
}

iframe {
@apply sm:w-full w-[calc(100%+16px*2)] h-[500px] border-none rounded overflow-hidden relative z-10 sm:m-0 m-[calc(16px*-1)];
@apply relative z-10 m-[calc(16px*-1)] h-[500px] w-[calc(100%+16px*2)] overflow-hidden rounded border-none sm:m-0 sm:w-full;
}
}

Expand All @@ -36,7 +36,7 @@ body {
}

.main-container {
@apply px-4 max-w-[1100px] mx-auto;
@apply mx-auto max-w-[1100px] px-4;
}

.post-paragraph,
Expand Down Expand Up @@ -71,5 +71,5 @@ body {
}

.list {
@apply pl-8 mb-9 [&>li]:mb-4 [&>li]:pl-2 text-lg tracking-wide;
@apply mb-9 pl-8 text-lg tracking-wide [&>li]:mb-4 [&>li]:pl-2;
}
6 changes: 1 addition & 5 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Footer from "@/components/footer";
import Header from "@/components/header";
import { ThemeProvider } from "@/components/theme-provider";
import type { Metadata } from "next";
import { Outfit } from "next/font/google";
Expand All @@ -9,7 +7,7 @@ import "./globals.css";
const outfit = Outfit({ subsets: ["latin"] });

export const metadata: Metadata = {
description: "Artigos sobre react, typescript, testes e etc.",
description: "Artigos e tutorias sobre react, typescript, testes e etc.",
metadataBase: new URL(process.env.DOMAIN_URL as string),
openGraph: {
description: "Artigos e tutoriais sobre react, typescript, testes e etc.",
Expand Down Expand Up @@ -39,9 +37,7 @@ export default function RootLayout({
<html lang="pt-BR" suppressHydrationWarning>
<body className={outfit.className}>
<ThemeProvider attribute="class" defaultTheme="system" enableSystem>
<Header />
{children}
<Footer />
</ThemeProvider>
</body>
</html>
Expand Down
26 changes: 26 additions & 0 deletions src/app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { ArrowRight } from "lucide-react";
import { Metadata } from "next";
import Link from "next/link";

export const metadata: Metadata = {
title: "Not Found",
};

export default function NotFound() {
return (
<main className="main-container mt-[150px] flex h-screen w-full justify-center md:mt-0 md:items-center">
<div>
<h1 className="mb-9 text-5xl font-bold md:mb-14 md:text-6xl">
Página não encontrada ☹️
</h1>
<Link
className="flex items-center gap-2 text-lg text-blue-600 md:text-4xl"
href="/"
>
Voltar a página inicial
<ArrowRight />
</Link>
</div>
</main>
);
}
6 changes: 3 additions & 3 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import type { Config } from "tailwindcss";

const config: Config = {
darkMode: ["class"],
content: [
"./src/pages/**/*.{js,ts,jsx,tsx,mdx}",
"./src/components/**/*.{js,ts,jsx,tsx,mdx}",
"./src/app/**/*.{js,ts,jsx,tsx,mdx}",
],
darkMode: ["class"],
plugins: [],
theme: {
extend: {
backgroundImage: {
"gradient-radial": "radial-gradient(var(--tw-gradient-stops))",
"gradient-conic":
"conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
"gradient-radial": "radial-gradient(var(--tw-gradient-stops))",
},
colors: {
background: "#0e141b",
},
},
},
plugins: [],
};
export default config;

0 comments on commit 016c469

Please sign in to comment.