remove dates from blog/learn

This commit is contained in:
saml33 2024-03-10 14:07:21 +11:00
parent 71c32d6d49
commit df079a5994
4 changed files with 28 additions and 16 deletions

View File

@ -1,10 +1,8 @@
'use client'
import Link from 'next/link'
import { BlogPost } from '../../../contentful/blogPost'
import CardImage from '../shared/CardImage'
import dayjs from 'dayjs'
import { LearnPost } from '../../../contentful/learnPost'
import { UserCircleIcon } from '@heroicons/react/20/solid'
const PostCard = ({
blogPost,
@ -13,7 +11,14 @@ const PostCard = ({
blogPost: BlogPost | LearnPost
type: 'blog' | 'learn'
}) => {
const { author, createdAt, postDescription, postTitle, slug } = blogPost
const {
author,
authorProfileImage,
// createdAt,
postDescription,
postTitle,
slug,
} = blogPost
const customImagePath =
type === 'blog'
? `/images/blog/${slug}-small.webp`
@ -28,11 +33,20 @@ const PostCard = ({
<CardImage customImagePath={customImagePath} />
</div>
<div className="p-6">
<p className="text-th-fgd-2 text-lg font-display mb-1">{postTitle}</p>
<h2 className="text-th-fgd-2 text-2xl mb-2">{postTitle}</h2>
<p>{postDescription}</p>
<div className="mt-3">
<p className="text-th-fgd-2">{author}</p>
<p className="text-sm">{dayjs(createdAt).format('D MMM YYYY')}</p>
<div className="mt-3 flex items-center">
{authorProfileImage?.src ? (
<img
className="rounded-full w-6 h-6"
src={authorProfileImage.src}
alt={authorProfileImage?.alt}
/>
) : (
<UserCircleIcon className="w-6 h-6 text-th-fgd-4" />
)}
<p className="ml-2 text-th-fgd-2">{author}</p>
{/* <p className="text-sm">{dayjs(createdAt).format('D MMM YYYY')}</p> */}
</div>
</div>
</Link>

View File

@ -1,9 +1,6 @@
'use client'
import { CalendarIcon, UserCircleIcon } from '@heroicons/react/20/solid'
import { UserCircleIcon } from '@heroicons/react/20/solid'
import { BlogPost } from '../../../contentful/blogPost'
import ShareButtonPanel from './ShareButtonPanel'
import dayjs from 'dayjs'
import { LearnPost } from '../../../contentful/learnPost'
const PostDetails = ({
@ -16,7 +13,7 @@ const PostDetails = ({
const {
author,
authorProfileImage,
createdAt,
// createdAt,
postDescription,
postTitle,
seoTitle,
@ -44,10 +41,10 @@ const PostDetails = ({
)}
<div>
<p className="text-th-fgd-2 font-bold">{author}</p>
<div className="flex items-center space-x-1.5">
{/* <div className="flex items-center space-x-1.5">
<CalendarIcon className="h-4 w-4 text-th-fgd-4" />
<p>{dayjs(createdAt).format('DD MMM YYYY')}</p>
</div>
</div> */}
</div>
</div>
) : null}

View File

@ -1,3 +1,4 @@
'use client'
import {
FacebookShareButton,
LinkedInShareButton,

File diff suppressed because one or more lines are too long