Updated header and added not found page
This commit is contained in:
@@ -1,18 +1,10 @@
|
|||||||
import { ThemeSwitcher } from "@/components/theme-switcher"
|
import Header from "@/components/header"
|
||||||
import Link from "next/link"
|
|
||||||
import { ReactNode } from "react"
|
import { ReactNode } from "react"
|
||||||
|
|
||||||
export default function RootLayout({ children }: Readonly<{ children: ReactNode }>) {
|
export default function RootLayout({ children }: Readonly<{ children: ReactNode }>) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<header className="fixed w-screen bg-background/50 backdrop-blur-sm">
|
<Header />
|
||||||
<nav className="flex justify-between items-center px-6 border-b h-header">
|
|
||||||
<Link href="/">
|
|
||||||
<span className="text-lg font-semibold">Hypixel Stats</span>
|
|
||||||
</Link>
|
|
||||||
<ThemeSwitcher />
|
|
||||||
</nav>
|
|
||||||
</header>
|
|
||||||
<div className="pt-header">
|
<div className="pt-header">
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,20 +1,10 @@
|
|||||||
import { SearchBar } from "@/components/search-bar"
|
import Header from "@/components/header"
|
||||||
import { ThemeSwitcher } from "@/components/theme-switcher"
|
|
||||||
import Link from "next/link"
|
|
||||||
import { ReactNode } from "react"
|
import { ReactNode } from "react"
|
||||||
|
|
||||||
export default function StatsLayout({ children }: Readonly<{ children: ReactNode }>) {
|
export default function StatsLayout({ children }: Readonly<{ children: ReactNode }>) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<header className="fixed w-screen z-1000 bg-background/50 backdrop-blur-sm">
|
<Header searchBar />
|
||||||
<nav className="flex justify-between items-center px-6 border-b h-header">
|
|
||||||
<Link href="/">
|
|
||||||
<span className="text-lg font-semibold">Hypixel Stats</span>
|
|
||||||
</Link>
|
|
||||||
<SearchBar navbar />
|
|
||||||
<ThemeSwitcher />
|
|
||||||
</nav>
|
|
||||||
</header>
|
|
||||||
<div className="pb-5 pt-header min-h-content">
|
<div className="pb-5 pt-header min-h-content">
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ async function SuspendedPage({ ign: pign }: { ign: string }) {
|
|||||||
if (!player) {
|
if (!player) {
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col items-center min-h-screen">
|
<div className="flex flex-col items-center min-h-screen">
|
||||||
<h1 className="mt-25">Player not found</h1>
|
<h1 className="mt-25">Player hasn't joined hypixel</h1>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
22
src/app/not-found.tsx
Normal file
22
src/app/not-found.tsx
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import Header from "@/components/header"
|
||||||
|
import { Button } from "@/components/ui/button"
|
||||||
|
import { ArrowLeftIcon } from "lucide-react"
|
||||||
|
import Link from "next/link"
|
||||||
|
|
||||||
|
export default function NotFound() {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Header searchBar />
|
||||||
|
<main className="flex flex-col items-center pt-header">
|
||||||
|
<Button className="self-start mt-4 ml-4" variant="secondary" asChild>
|
||||||
|
<Link href="/">
|
||||||
|
<ArrowLeftIcon />
|
||||||
|
Back to Main page
|
||||||
|
</Link>
|
||||||
|
</Button>
|
||||||
|
<h1 className="pt-20 text-3xl font-bold max-w-fit">404</h1>
|
||||||
|
<h1 className="text-3xl font-bold max-w-fit">Page not found</h1>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
17
src/components/header.tsx
Normal file
17
src/components/header.tsx
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import Link from "next/link"
|
||||||
|
import { SearchBar } from "./search-bar"
|
||||||
|
import { ThemeSwitcher } from "./theme-switcher"
|
||||||
|
|
||||||
|
export default function Header({ searchBar = false }: { searchBar?: boolean }) {
|
||||||
|
return (
|
||||||
|
<header className="fixed w-screen bg-background/50 backdrop-blur-sm">
|
||||||
|
<nav className="flex justify-between items-center px-6 border-b h-header">
|
||||||
|
<Link href="/">
|
||||||
|
<span className="text-lg font-semibold">Hypixel Stats</span>
|
||||||
|
</Link>
|
||||||
|
{searchBar && <SearchBar navbar />}
|
||||||
|
<ThemeSwitcher />
|
||||||
|
</nav>
|
||||||
|
</header>
|
||||||
|
)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user