feat: add Atatürk quote widget modal to app shell and initialize home page layout
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { HomeHero } from "@/components/home-hero";
|
||||
import { HomeVideosSection } from "@/components/home-videos-section";
|
||||
import { ReferencesSection } from "@/components/references-section";
|
||||
import { HomeFooterSection } from "@/components/home-footer-section";
|
||||
import { getHomeBlogNews } from "@/data/blog";
|
||||
|
||||
export default async function Home() {
|
||||
@@ -12,7 +11,6 @@ export default async function Home() {
|
||||
<HomeHero news={homeNews} />
|
||||
<ReferencesSection />
|
||||
<HomeVideosSection />
|
||||
<HomeFooterSection />
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import { usePathname } from "next/navigation";
|
||||
import { AnnouncementBar } from "poyraz-ui/organisms";
|
||||
import { SiteNavbar } from "@/components/site-navbar";
|
||||
import { NekoFollower } from "@/components/neko-follower";
|
||||
import { AtaturkWidgetModal } from "@/components/ataturk-widget-modal";
|
||||
import { ANNOUNCEMENT_ITEMS, ENABLE_NEKO_FOLLOWER } from "@/data/site-settings";
|
||||
|
||||
type AppShellProps = {
|
||||
@@ -24,6 +25,7 @@ export function AppShell({ children }: AppShellProps) {
|
||||
|
||||
return (
|
||||
<>
|
||||
<AtaturkWidgetModal />
|
||||
{ENABLE_NEKO_FOLLOWER ? <NekoFollower /> : null}
|
||||
<div className="mx-auto flex w-full max-w-4xl flex-col px-4 py-4 sm:px-6">
|
||||
<SiteNavbar />
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import Script from "next/script";
|
||||
import Image from "next/image";
|
||||
import { Modal, ModalContent, ModalTrigger, ModalTitle } from "poyraz-ui/molecules";
|
||||
import { Skeleton } from "poyraz-ui/atoms";
|
||||
|
||||
export function AtaturkWidgetModal() {
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
return (
|
||||
<Modal>
|
||||
<ModalTrigger asChild>
|
||||
<button
|
||||
type="button"
|
||||
title="Bugünün Atatürk Sözü"
|
||||
className="fixed bottom-4 left-4 z-50 flex h-14 w-14 items-center justify-center overflow-hidden rounded-full border-2 border-red-600 bg-background shadow-lg transition-transform hover:scale-110 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
|
||||
aria-label="Bugünün Atatürk Sözü"
|
||||
>
|
||||
<div className="relative h-full w-full">
|
||||
<Image
|
||||
src="/ataturk.png"
|
||||
alt="Mustafa Kemal Atatürk"
|
||||
fill
|
||||
sizes="56px"
|
||||
className="object-cover"
|
||||
/>
|
||||
</div>
|
||||
</button>
|
||||
</ModalTrigger>
|
||||
|
||||
<ModalContent className="flex flex-col justify-center p-6 sm:max-w-[425px] min-h-[160px] transition-all duration-300">
|
||||
<ModalTitle className="sr-only">Bugünün Atatürk Sözü</ModalTitle>
|
||||
|
||||
{isLoading && (
|
||||
<div className="flex w-full flex-col space-y-3">
|
||||
<Skeleton className="h-4 w-3/4 rounded-sm" />
|
||||
<Skeleton className="h-4 w-full rounded-sm" />
|
||||
<Skeleton className="h-4 w-5/6 rounded-sm" />
|
||||
<div className="pt-2">
|
||||
<Skeleton className="h-3 w-1/4 rounded-sm" />
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className={`w-full ${isLoading ? "hidden" : "block"}`}>
|
||||
<div data-ataturk-quote-widget data-language="tr" data-theme="light"></div>
|
||||
<Script
|
||||
src="https://ataturk-kronolojisi.org/widget/quote.js"
|
||||
strategy="lazyOnload"
|
||||
data-language="tr"
|
||||
data-theme="light"
|
||||
onReady={() => setIsLoading(false)}
|
||||
/>
|
||||
</div>
|
||||
</ModalContent>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import Script from "next/script";
|
||||
|
||||
export function HomeFooterSection() {
|
||||
return (
|
||||
<div className="mt-auto flex w-full flex-col items-center justify-center pt-4">
|
||||
<div data-ataturk-quote-widget data-language="tr" data-theme="light"></div>
|
||||
<Script
|
||||
src="https://ataturk-kronolojisi.org/widget/quote.js"
|
||||
strategy="lazyOnload"
|
||||
data-language="tr"
|
||||
data-theme="light"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.4 MiB |
Reference in New Issue
Block a user