misc: icons and titles
This commit is contained in:
@@ -2,12 +2,18 @@ import type { Metadata } from "next";
|
|||||||
import "./globals.css";
|
import "./globals.css";
|
||||||
import Celebration from "@/components/Celebration";
|
import Celebration from "@/components/Celebration";
|
||||||
import Nav from "@/components/Nav";
|
import Nav from "@/components/Nav";
|
||||||
|
import PageTitleManager from "@/components/PageTitleManager";
|
||||||
import { ConnectionProvider } from "@/lib/connection";
|
import { ConnectionProvider } from "@/lib/connection";
|
||||||
import { CHIP_DROP_SOUND_PATHS } from "@/lib/sfx";
|
import { CHIP_DROP_SOUND_PATHS } from "@/lib/sfx";
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "Connect4 Moderator",
|
title: "Connect4 RPI Minds & Machines",
|
||||||
description: "Watch matches, track tournaments, and play Connect4",
|
description: "Watch matches, track tournaments, and play Connect4",
|
||||||
|
icons: {
|
||||||
|
icon: "/favicon.ico",
|
||||||
|
shortcut: "/favicon.ico",
|
||||||
|
apple: "/icon.png",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function RootLayout({
|
export default function RootLayout({
|
||||||
@@ -30,6 +36,7 @@ export default function RootLayout({
|
|||||||
</head>
|
</head>
|
||||||
<body className="min-h-screen bg-gray-950 text-gray-100">
|
<body className="min-h-screen bg-gray-950 text-gray-100">
|
||||||
<ConnectionProvider>
|
<ConnectionProvider>
|
||||||
|
<PageTitleManager />
|
||||||
<Celebration />
|
<Celebration />
|
||||||
<Nav />
|
<Nav />
|
||||||
<main className="max-w-7xl mx-auto px-4 py-6">{children}</main>
|
<main className="max-w-7xl mx-auto px-4 py-6">{children}</main>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
import Image from "next/image";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { SubmitEvent, useEffect, useState } from "react";
|
import { SubmitEvent, useEffect, useState } from "react";
|
||||||
import { Settings, X } from "lucide-react";
|
import { Settings, X } from "lucide-react";
|
||||||
@@ -51,7 +52,13 @@ export default function Nav() {
|
|||||||
href="/"
|
href="/"
|
||||||
className="text-lg font-bold text-white flex items-center gap-2"
|
className="text-lg font-bold text-white flex items-center gap-2"
|
||||||
>
|
>
|
||||||
<span className="text-2xl">🔴</span>
|
<Image
|
||||||
|
src="/icon.png"
|
||||||
|
alt="Connect4 Observer icon"
|
||||||
|
width={32}
|
||||||
|
height={32}
|
||||||
|
className="h-8 w-8 rounded-sm"
|
||||||
|
/>
|
||||||
<span>Connect4 Observer</span>
|
<span>Connect4 Observer</span>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
|
|||||||
21
components/PageTitleManager.tsx
Normal file
21
components/PageTitleManager.tsx
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useEffect } from "react";
|
||||||
|
import { useConnection } from "@/lib/connection";
|
||||||
|
|
||||||
|
const DEFAULT_TITLE = "Connect4 RPI Minds & Machines";
|
||||||
|
|
||||||
|
export default function PageTitleManager() {
|
||||||
|
const { role, username } = useConnection();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (role === "player" && username.trim()) {
|
||||||
|
document.title = `${username.trim()} - ${DEFAULT_TITLE}`;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
document.title = DEFAULT_TITLE;
|
||||||
|
}, [role, username]);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
BIN
public/favicon.ico
Normal file
BIN
public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
BIN
public/icon.png
Normal file
BIN
public/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 266 KiB |
Reference in New Issue
Block a user