Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance Blog Post Tile Component with New Hover Effect #64

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
10 changes: 7 additions & 3 deletions src/components/BlogPostTile/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
import {PostMeta} from '@/lib/posts';
import { PostMeta } from '@/lib/posts';

interface Props {
post: PostMeta;
}

export const BlogPostTile = ({
post: {title, date, slug, authorPic, author, authorTwitterUrl, description},
post: { title, date, slug, authorPic, author, authorTwitterUrl, description },
}: Props) => {
const href = `/blog/${slug}`;
const publishDate = new Date(date);

return (
<article key={href} className="flex max-w-xl flex-col items-start justify-between">
<article
key={href}
className="flex max-w-xl flex-col items-start justify-between p-4 rounded-lg transition-transform duration-300 ease-in-out hover:shadow-lg hover:scale-105 hover:bg-[rgba(255,255,255,0.2)]"
>
<div className="flex items-center gap-x-4 text-xs">
<time dateTime={publishDate.toString()} className="text-gray-500">
{publishDate.toLocaleDateString('en-US', {
Expand Down