Files
darkwave/components/blogpost.tsx
AderKonstantin 102fac4f11 feat: Enhance blog post UI and add icons
This commit introduces several improvements to the blog post UI:

- Adds new icons for tags and calendar using SVG images
- Refines the layout and styling of the blog post tags and publish date
- Adjusts the overall spacing and padding of the blog area and individual blog posts
- Increases the font size of the "Read the article" link for better readability

These changes aim to enhance the visual appeal and user experience of the blog section, making it more visually engaging and informative for the readers.
2025-03-26 13:39:53 +03:00

72 lines
3.5 KiB
TypeScript

'use client';
import tagsPic from '../public/tags.svg';
import calendarPic from '../public/calendar.svg'
import AnimatedLink from '../components/animatedLink';
import Image from 'next/image';
interface BlogPost {
label: string;
body: string;
publish: string;
get_absolute_url: string;
}
interface BlogAreaProps {
blogposts: BlogPost[];
}
export default function BlogArea({ blogposts }: BlogAreaProps) {
return (
<div className="blog-area pt-16 pb-8 border-t border-white w-full">
<div className="blogposts">
{blogposts.map((blogpost, index) => (
<div key={index} className="blogpost flex flex-row overflow-hidden mb-14">
<div className="left mr-5">
<div className="blogpost-image">
<Image
src="/images/retrofuturism.webp" // Path to the local image
alt="Retrospective Science Image"
width={384} // Set width (in pixels)
height={384} // Set height (in pixels)
className="rounded-lg"
/>
</div>
</div>
<div className="right flex flex-col w-full">
<div className="blogpost-label text-2xl mb-4">
<h2>
<AnimatedLink href={blogpost.get_absolute_url}>
{blogpost.label}
</AnimatedLink>
</h2>
</div>
<ul className="blogpost-tags inline-flex items-center flex-row space-x-4 mb-4">
<li className="tag inline px-2 py-1 rounded-full"><Image src={tagsPic} alt="lang" width={24} height={24} className='inline-flex justify-baseline filter brightness-0 invert' /></li>
<li className="tag inline border border-slate-400 px-2 py-1 rounded-full text-base">Games</li>
<li className="tag inline border border-slate-400 px-2 py-1 rounded-full text-base">Science</li>
</ul>
<div className="blogpost-description text-base mb-4">
{blogpost.body.slice(0, 512)}...
</div>
<div className="blogpost-other flex flex-row justify-between items-end mt-auto">
<ul className="text-base inline-flex justify-end items-center">
<li className="inline px-2 py-1"><Image src={calendarPic} alt="lang" width={24} height={24} className="filter brightness-0 invert"/></li>
<li className="inline"><p className='inline mx-2'>{blogpost.publish}</p></li>
</ul>
<div className="text-xl">
<AnimatedLink href={blogpost.get_absolute_url}>
Read the article
</AnimatedLink>
</div>
</div>
</div>
</div>
))}
</div>
{/* Include Pagination Component Here */}
</div>
);
}