Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 59 additions & 51 deletions examples/nextjs-simple-blog-template/components/blog/detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,65 +13,73 @@ export function BlogPageDetail({
writer?: Writer;
}) {
return (
<div className="container max-w-[1440px] px-32 mx-auto flex flex-col items-start relative">
<div className="flex flex-col items-center gap-12 pt-16 pb-32 px-32 relative self-stretch w-full flex-[0_0_auto]">
<div className="flex flex-col w-[784px] items-center gap-12 relative flex-[0_0_auto]">
<div className="flex flex-col items-center gap-8 relative self-stretch w-full flex-[0_0_auto]">
<div className="relative self-stretch mt-[-1.00px] [font-family:'Selecta_VF_Trial-Light',Helvetica] font-light text-zinc-400 text-sm text-center leading-[normal]">
{new Date(
page.properties.created_at ?? Date.now()
).toLocaleDateString()}
</div>
<p className="relative self-stretch [font-family:'Selecta_VF_Trial-Regular',Helvetica] font-normal text-white text-5xl text-center leading-[normal]">
{page.title}
</p>
<div className="flex w-[115px] items-center gap-1.5 pl-[3px] pr-2.5 py-[3px] relative flex-[0_0_auto] bg-[#ffffff0a] rounded-[40px] border-[0.5px] border-solid border-[#ffffff1f]">
<Image
className="relative size-[18px] object-cover rounded-full"
width={18}
height={18}
alt="Writer Profile"
src={writer?.properties.images?.[0] ?? "/img/404.png"}
/>
<div className="relative w-fit [font-family:'Selecta_VF_Trial-Light',Helvetica] font-light text-white text-[15px] leading-[normal] whitespace-nowrap">
{writer?.title}
</div>
</div>
<div className="w-screen max-w-full overflow-hidden">
<div className="w-full max-w-2xl mx-auto px-4 sm:px-6 md:px-8">
<div className="flex flex-col items-center py-8">
<div className="w-full text-center text-zinc-400 text-sm mb-6">
{new Date(
page.properties.created_at ?? Date.now()
).toLocaleDateString()}
</div>

<h1 className="w-full text-white text-2xl md:text-4xl text-center font-normal mb-6 px-4">
{page.title}
</h1>

<div className="flex items-center gap-1.5 px-3 py-1 bg-white/5 rounded-full border border-white/20 mb-8">
<Image
className="w-[18px] h-[18px] rounded-full"
width={18}
height={18}
alt="Writer Profile"
src={writer?.properties.images?.[0] ?? "/img/404.png"}
/>
<span className="text-white text-sm">{writer?.title}</span>
</div>

<div className="w-full aspect-[16/9] relative mb-8">
<Image
className="rounded-lg object-cover"
fill
sizes="(max-width: 768px) 100vw, 768px"
alt="Key Visual"
src={page.properties.thumbnails?.[0] ?? "/img/404.png"}
/>
</div>

<div className="w-full prose prose-invert max-w-none">
<MainContent content={page.content} />
</div>
<Image
className="relative self-stretch w-full h-[422px] mb-[-0.50px] ml-[-0.50px] mr-[-0.50px] bg-black rounded-[10px] border-[0.5px] border-solid border-[#ffffff1f] shadow-[0px_2px_2px_-1px_#000000,0px_4px_4px_-2px_#000000] object-cover"
width={784}
height={422}
alt="Key Visual"
src={page.properties.thumbnails?.[0] ?? "/img/404.png"}
/>
</div>
<MainContent content={page.content} />

{writer && <WriterProfileCard writer={writer} />}
{writer && (
<div className="w-full mt-8">
<WriterProfileCard writer={writer} />
</div>
)}
</div>
</div>
</div>
);
}

function WriterProfileCard({ writer }: { writer: Writer }) {
return (
<div
className="w-[600px] p-6 bg-white/1 rounded-[20px] border-white border-[0.5px] border-opacity-10 justify-start items-start gap-6 inline-flex
shadow-[inset_0px_-40px_48px_0px_rgba(255,255,255,0.08)]"
>
<Image
width={56}
height={56}
className="Image w-14 h-14 rounded-full border border-black/10"
alt={`${writer.title}'s Profile`}
src={writer.properties.images?.[0] ?? "/img/404.png"}
/>
<div className="grow shrink basis-0 flex-col justify-start items-start gap-4 inline-flex">
<div className="self-stretch text-white text-lg font-medium leading-[18px]">
{writer.title}
</div>
<div className="self-stretch opacity-70 text-white text-base font-normal leading-snug">
{writer.content}
<div className="w-full p-4 bg-white/5 rounded-lg border border-white/10">
<div className="flex gap-4 items-start">
<Image
width={56}
height={56}
className="w-14 h-14 rounded-full shrink-0"
alt={`${writer.title}'s Profile`}
src={writer.properties.images?.[0] ?? "/img/404.png"}
/>
<div className="min-w-0 flex-1">
<h3 className="text-white text-lg font-medium mb-2">
{writer.title}
</h3>
<p className="text-white/70 text-sm leading-relaxed">
{writer.content}
</p>
</div>
</div>
</div>
Expand Down
Loading