feat(layout): load announcement bar content from site settings
This commit is contained in:
+11
-4
@@ -2,6 +2,7 @@ import type { Metadata } from "next";
|
|||||||
import "./globals.css";
|
import "./globals.css";
|
||||||
|
|
||||||
import { SiteNavbar } from "@/components/site-navbar";
|
import { SiteNavbar } from "@/components/site-navbar";
|
||||||
|
import { ANNOUNCEMENT_ITEMS } from "@/data/site-settings";
|
||||||
import { Icon } from "@iconify/react";
|
import { Icon } from "@iconify/react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { AnnouncementBar } from "poyraz-ui/organisms";
|
import { AnnouncementBar } from "poyraz-ui/organisms";
|
||||||
@@ -10,7 +11,7 @@ export const metadata: Metadata = {
|
|||||||
title:
|
title:
|
||||||
"Poyraz Avsever | Portfolyo | Freelancer | Full-stack Geliştirici | Web Geliştirici",
|
"Poyraz Avsever | Portfolyo | Freelancer | Full-stack Geliştirici | Web Geliştirici",
|
||||||
description:
|
description:
|
||||||
"Poyraz Avsever'in projelerini, yetkinliklerini ve hizmetlerini sergilediği kişisel portfolyo sitesi. Yazılıma ve teknolojiye tutkuyla bağlı genç bir geliştirici.",
|
"Poyraz Avsever'in projelerini, yetkinliklerini ve hizmetlerini sergilediği kişisel portfolyo sitesi.",
|
||||||
icons: {
|
icons: {
|
||||||
icon: "/favicon.ico",
|
icon: "/favicon.ico",
|
||||||
},
|
},
|
||||||
@@ -46,28 +47,34 @@ export default function RootLayout({
|
|||||||
}: Readonly<{
|
}: Readonly<{
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}>) {
|
}>) {
|
||||||
|
const announcement = ANNOUNCEMENT_ITEMS[0];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<html lang="tr">
|
<html lang="tr">
|
||||||
<body className="min-h-dvh bg-background text-foreground antialiased">
|
<body className="min-h-dvh bg-background text-foreground antialiased">
|
||||||
<div className="mx-auto flex w-full max-w-4xl flex-col overflow-hidden px-4 py-4 sm:px-6">
|
<div className="mx-auto flex w-full max-w-4xl flex-col overflow-hidden px-4 py-4 sm:px-6">
|
||||||
<SiteNavbar />
|
<SiteNavbar />
|
||||||
|
{announcement ? (
|
||||||
<AnnouncementBar
|
<AnnouncementBar
|
||||||
variant="branded"
|
variant="branded"
|
||||||
dismissible={false}
|
dismissible={false}
|
||||||
icon={<Icon icon="mdi:sparkles" width={16} height={16} />}
|
icon={<Icon icon="mdi:sparkles" width={16} height={16} />}
|
||||||
action={
|
action={
|
||||||
|
announcement.actionLabel && announcement.actionHref ? (
|
||||||
<Link
|
<Link
|
||||||
href="https://ui.poyrazavsever.com"
|
href={announcement.actionHref}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer"
|
rel="noreferrer"
|
||||||
className="text-xs font-bold underline"
|
className="text-xs font-bold underline"
|
||||||
>
|
>
|
||||||
İncele ->
|
{announcement.actionLabel}
|
||||||
</Link>
|
</Link>
|
||||||
|
) : null
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
Bu hafta yeni bileşenler eklendi!
|
{announcement.text}
|
||||||
</AnnouncementBar>
|
</AnnouncementBar>
|
||||||
|
) : null}
|
||||||
<main className="flex-1 overflow-hidden py-4">{children}</main>
|
<main className="flex-1 overflow-hidden py-4">{children}</main>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
export type AnnouncementItem = {
|
||||||
|
id: string;
|
||||||
|
text: string;
|
||||||
|
actionLabel: string;
|
||||||
|
actionHref: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const ANNOUNCEMENT_ITEMS: AnnouncementItem[] = [
|
||||||
|
{
|
||||||
|
id: "main-announcement",
|
||||||
|
text: "Bu hafta yeni bileşenler eklendi!",
|
||||||
|
actionLabel: "İncele ->",
|
||||||
|
actionHref: "https://ui.poyrazavsever.com",
|
||||||
|
},
|
||||||
|
];
|
||||||
Reference in New Issue
Block a user