feat(layout): load announcement bar content from site settings
This commit is contained in:
+25
-18
@@ -2,6 +2,7 @@ import type { Metadata } from "next";
|
||||
import "./globals.css";
|
||||
|
||||
import { SiteNavbar } from "@/components/site-navbar";
|
||||
import { ANNOUNCEMENT_ITEMS } from "@/data/site-settings";
|
||||
import { Icon } from "@iconify/react";
|
||||
import Link from "next/link";
|
||||
import { AnnouncementBar } from "poyraz-ui/organisms";
|
||||
@@ -10,7 +11,7 @@ export const metadata: Metadata = {
|
||||
title:
|
||||
"Poyraz Avsever | Portfolyo | Freelancer | Full-stack Geliştirici | Web Geliştirici",
|
||||
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: {
|
||||
icon: "/favicon.ico",
|
||||
},
|
||||
@@ -46,28 +47,34 @@ export default function RootLayout({
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
const announcement = ANNOUNCEMENT_ITEMS[0];
|
||||
|
||||
return (
|
||||
<html lang="tr">
|
||||
<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">
|
||||
<SiteNavbar />
|
||||
<AnnouncementBar
|
||||
variant="branded"
|
||||
dismissible={false}
|
||||
icon={<Icon icon="mdi:sparkles" width={16} height={16} />}
|
||||
action={
|
||||
<Link
|
||||
href="https://ui.poyrazavsever.com"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="text-xs font-bold underline"
|
||||
>
|
||||
İncele ->
|
||||
</Link>
|
||||
}
|
||||
>
|
||||
Bu hafta yeni bileşenler eklendi!
|
||||
</AnnouncementBar>
|
||||
{announcement ? (
|
||||
<AnnouncementBar
|
||||
variant="branded"
|
||||
dismissible={false}
|
||||
icon={<Icon icon="mdi:sparkles" width={16} height={16} />}
|
||||
action={
|
||||
announcement.actionLabel && announcement.actionHref ? (
|
||||
<Link
|
||||
href={announcement.actionHref}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="text-xs font-bold underline"
|
||||
>
|
||||
{announcement.actionLabel}
|
||||
</Link>
|
||||
) : null
|
||||
}
|
||||
>
|
||||
{announcement.text}
|
||||
</AnnouncementBar>
|
||||
) : null}
|
||||
<main className="flex-1 overflow-hidden py-4">{children}</main>
|
||||
</div>
|
||||
</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