From b3fff331de7eda2189637607cd7e4f66d109aac5 Mon Sep 17 00:00:00 2001 From: Diogo Soares Date: Thu, 1 Aug 2024 18:01:24 +0200 Subject: [PATCH 1/6] feat: use the latest press release post in the featured section --- src/components/Blog/BlogHome/index.tsx | 2 +- src/components/Blog/FeaturedPost/index.tsx | 4 ++-- src/components/Pressroom/index.tsx | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/Blog/BlogHome/index.tsx b/src/components/Blog/BlogHome/index.tsx index 605d79cf4..0dab2a761 100644 --- a/src/components/Blog/BlogHome/index.tsx +++ b/src/components/Blog/BlogHome/index.tsx @@ -40,7 +40,7 @@ const BlogHome = ({ blogHome, allPosts }: BlogHomeProps) => { - {isEntryTypePost(featured) && } + {isEntryTypePost(featured) && } Trending diff --git a/src/components/Blog/FeaturedPost/index.tsx b/src/components/Blog/FeaturedPost/index.tsx index cd8fa1f85..3abfbe9b4 100644 --- a/src/components/Blog/FeaturedPost/index.tsx +++ b/src/components/Blog/FeaturedPost/index.tsx @@ -10,8 +10,8 @@ import CategoryIcon from '@/public/images/Blog/category-icon.svg' import { AppRoutes } from '@/config/routes' import { containsTag, PRESS_RELEASE_TAG } from '@/lib/containsTag' -const FeaturedPost = (props: BlogPostEntry) => { - const { slug, coverImage, category, date, title, excerpt, tags, content } = props.fields +const FeaturedPost = ({ post }: { post: BlogPostEntry }) => { + const { slug, coverImage, category, date, title, excerpt, tags, content } = post.fields const isPressRelease = containsTag(tags, PRESS_RELEASE_TAG) diff --git a/src/components/Pressroom/index.tsx b/src/components/Pressroom/index.tsx index bbee567f0..29564f3e7 100644 --- a/src/components/Pressroom/index.tsx +++ b/src/components/Pressroom/index.tsx @@ -25,6 +25,7 @@ import { Container } from '@mui/material' import type { Entry } from 'contentful' import { useClientEntry } from '@/hooks/useClientEntry' import type { PostEntryCollection } from '@/config/types' +import { isPressReleasePost } from '@/lib/containsTag' export type PressRoomEntry = Entry @@ -46,12 +47,15 @@ const PressRoom = ({ pressRoom, allPosts, totalAssets }: PressRoomProps) => { const podcastsList = podcasts.filter(isEntryTypeExternalURL) const videosList = videos.filter(isEntryTypeExternalURL) + const latestPressRelease = allPosts.items.find(isPressReleasePost) + const featuredPressRelease = !!latestPressRelease ? latestPressRelease : featured + return ( <> {isEntryType(metaTags) && } - {isEntryTypePost(featured) && } + {isEntryTypePost(featuredPressRelease) && } From 05a658ea5b9ce565ed499e05db0e797e6a4d071c Mon Sep 17 00:00:00 2001 From: Diogo Soares <32431609+DiogoSoaress@users.noreply.github.com> Date: Fri, 2 Aug 2024 15:29:12 +0200 Subject: [PATCH 2/6] feat: use latest press release post and delete featured field --- src/components/Pressroom/index.tsx | 10 +++++----- src/contentful/types/TypePressRoom.ts | 2 -- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/components/Pressroom/index.tsx b/src/components/Pressroom/index.tsx index 29564f3e7..2ac8f1cb2 100644 --- a/src/components/Pressroom/index.tsx +++ b/src/components/Pressroom/index.tsx @@ -18,7 +18,6 @@ import { isEntryType, isEntryTypeBaseBlock, isEntryTypeExternalURL, - isEntryTypePost, isEntryTypeSimpleBaseBlock, } from '@/lib/typeGuards' import { Container } from '@mui/material' @@ -26,6 +25,7 @@ import type { Entry } from 'contentful' import { useClientEntry } from '@/hooks/useClientEntry' import type { PostEntryCollection } from '@/config/types' import { isPressReleasePost } from '@/lib/containsTag' +import { isDraft } from '@/lib/contentful/isDraft' export type PressRoomEntry = Entry @@ -38,7 +38,8 @@ export type PressRoomProps = { const PressRoom = ({ pressRoom, allPosts, totalAssets }: PressRoomProps) => { const { data: localPressRoom } = useClientEntry(pressRoom.sys.id, pressRoom) - const { metaTags, featured, numbers, investors, timeline, news, podcasts, videos } = localPressRoom.fields + console.log(localPressRoom.fields) + const { metaTags, numbers, investors, timeline, news, podcasts, videos } = localPressRoom.fields const numbersList = numbers.filter(isEntryTypeBaseBlock) const investorsList = investors.filter(isAsset) @@ -47,15 +48,14 @@ const PressRoom = ({ pressRoom, allPosts, totalAssets }: PressRoomProps) => { const podcastsList = podcasts.filter(isEntryTypeExternalURL) const videosList = videos.filter(isEntryTypeExternalURL) - const latestPressRelease = allPosts.items.find(isPressReleasePost) - const featuredPressRelease = !!latestPressRelease ? latestPressRelease : featured + const latestPressRelease = allPosts.items.find((post) => isPressReleasePost(post) && !isDraft(post)) return ( <> {isEntryType(metaTags) && } - {isEntryTypePost(featuredPressRelease) && } + {latestPressRelease && } diff --git a/src/contentful/types/TypePressRoom.ts b/src/contentful/types/TypePressRoom.ts index f74cde27b..cda3191a8 100644 --- a/src/contentful/types/TypePressRoom.ts +++ b/src/contentful/types/TypePressRoom.ts @@ -2,12 +2,10 @@ import type { ChainModifiers, Entry, EntryFieldTypes, EntrySkeletonType, LocaleC import type { TypeBaseBlockSkeleton } from './TypeBaseBlock' import type { TypeExternalUrlSkeleton } from './TypeExternalUrl' import type { TypeMetaTagsSkeleton } from './TypeMetaTags' -import type { TypePostSkeleton } from './TypePost' import type { TypeSimpleBaseBlockSkeleton } from './TypeSimpleBaseBlock' export interface TypePressRoomFields { metaTags: EntryFieldTypes.EntryLink - featured: EntryFieldTypes.EntryLink numbers: EntryFieldTypes.Array> investors: EntryFieldTypes.Array timeline: EntryFieldTypes.Array> From 13f2abeb96baaa67bfd7a1a913f7540013f240b7 Mon Sep 17 00:00:00 2001 From: Diogo Soares <32431609+DiogoSoaress@users.noreply.github.com> Date: Thu, 19 Sep 2024 17:14:03 +0200 Subject: [PATCH 3/6] feat: do not display draft PRs --- src/components/Pressroom/PressReleases/index.tsx | 3 ++- src/components/Pressroom/index.tsx | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/Pressroom/PressReleases/index.tsx b/src/components/Pressroom/PressReleases/index.tsx index 086161a32..d79dfaa5c 100644 --- a/src/components/Pressroom/PressReleases/index.tsx +++ b/src/components/Pressroom/PressReleases/index.tsx @@ -7,6 +7,7 @@ import SearchIcon from '@/public/images/search.svg' import CategoryFilter from '@/components/common/CategoryFilter' import { PressroomIds } from '@/components/Pressroom/ContentsNavigation' import { containsTag, isPressReleasePost } from '@/lib/containsTag' +import { isDraft } from '@/lib/contentful/isDraft' import { getPage } from '@/lib/getPage' import { useAllPosts } from '@/hooks/useAllPosts' import type { PostEntryCollection } from '@/config/types' @@ -23,7 +24,7 @@ const PressReleases = ({ allPosts }: { allPosts: PostEntryCollection }) => { const { localAllPosts } = useAllPosts(allPosts) const filteredPosts = useMemo(() => { - const pressPosts = localAllPosts.items.filter(isPressReleasePost) + const pressPosts = localAllPosts.items.filter((post) => isPressReleasePost(post) && !isDraft(post)) return !selectedTag ? pressPosts : pressPosts.filter((post) => containsTag(post.fields.tags, selectedTag)) }, [localAllPosts.items, selectedTag]) diff --git a/src/components/Pressroom/index.tsx b/src/components/Pressroom/index.tsx index 2ac8f1cb2..d9df4488a 100644 --- a/src/components/Pressroom/index.tsx +++ b/src/components/Pressroom/index.tsx @@ -49,6 +49,7 @@ const PressRoom = ({ pressRoom, allPosts, totalAssets }: PressRoomProps) => { const videosList = videos.filter(isEntryTypeExternalURL) const latestPressRelease = allPosts.items.find((post) => isPressReleasePost(post) && !isDraft(post)) + console.log('latest', latestPressRelease?.fields.title) return ( <> From 77c63616d8533a3347d6c42243c7928e11b6fb81 Mon Sep 17 00:00:00 2001 From: Diogo Soares <32431609+DiogoSoaress@users.noreply.github.com> Date: Mon, 23 Sep 2024 15:17:34 +0200 Subject: [PATCH 4/6] feat: list display localy fetched posts --- src/components/Blog/BlogHome/index.tsx | 2 ++ src/components/Pressroom/index.tsx | 6 ++++-- src/pages/blog/index.tsx | 9 +++++---- src/pages/press.tsx | 1 + 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/components/Blog/BlogHome/index.tsx b/src/components/Blog/BlogHome/index.tsx index 0dab2a761..8596482cb 100644 --- a/src/components/Blog/BlogHome/index.tsx +++ b/src/components/Blog/BlogHome/index.tsx @@ -8,6 +8,7 @@ import type { Entry } from 'contentful' import { isEntryTypePost } from '@/lib/typeGuards' import { useClientEntry } from '@/hooks/useClientEntry' import type { PostEntryCollection } from '@/config/types' +import { isDraft } from '@/lib/contentful/isDraft' const categories = ['Announcements', 'Ecosystem', 'Community', 'Insights', 'Build'] @@ -21,6 +22,7 @@ export type BlogHomeProps = { } const BlogHome = ({ blogHome, allPosts }: BlogHomeProps) => { + console.log('BlogHome', allPosts.items.filter((post) => !isDraft(post)).length) const { data: localBlogHome } = useClientEntry(blogHome.sys.id, blogHome) const { featured, metaTags, mostPopular } = localBlogHome.fields diff --git a/src/components/Pressroom/index.tsx b/src/components/Pressroom/index.tsx index d9df4488a..8e79fcec1 100644 --- a/src/components/Pressroom/index.tsx +++ b/src/components/Pressroom/index.tsx @@ -26,6 +26,7 @@ import { useClientEntry } from '@/hooks/useClientEntry' import type { PostEntryCollection } from '@/config/types' import { isPressReleasePost } from '@/lib/containsTag' import { isDraft } from '@/lib/contentful/isDraft' +import { useAllPosts } from '@/hooks/useAllPosts' export type PressRoomEntry = Entry @@ -36,9 +37,10 @@ export type PressRoomProps = { } const PressRoom = ({ pressRoom, allPosts, totalAssets }: PressRoomProps) => { + console.log('PressRoom non-drafts', allPosts.items.filter((post) => !isDraft(post)).length) const { data: localPressRoom } = useClientEntry(pressRoom.sys.id, pressRoom) + const { localAllPosts } = useAllPosts(allPosts) - console.log(localPressRoom.fields) const { metaTags, numbers, investors, timeline, news, podcasts, videos } = localPressRoom.fields const numbersList = numbers.filter(isEntryTypeBaseBlock) @@ -48,7 +50,7 @@ const PressRoom = ({ pressRoom, allPosts, totalAssets }: PressRoomProps) => { const podcastsList = podcasts.filter(isEntryTypeExternalURL) const videosList = videos.filter(isEntryTypeExternalURL) - const latestPressRelease = allPosts.items.find((post) => isPressReleasePost(post) && !isDraft(post)) + const latestPressRelease = localAllPosts.items.find((post) => isPressReleasePost(post) && !isDraft(post)) console.log('latest', latestPressRelease?.fields.title) return ( diff --git a/src/pages/blog/index.tsx b/src/pages/blog/index.tsx index b40138238..10e2c62d6 100644 --- a/src/pages/blog/index.tsx +++ b/src/pages/blog/index.tsx @@ -8,10 +8,11 @@ const Blog = (props: BlogHomeProps) => { } export const getStaticProps = async () => { - const postsEntries = await client.getEntries({ + const allPosts = await client.getEntries({ content_type: 'post', // order by date, most recent first order: ['-fields.date'], + limit: 150, }) const blogHomeEntries = await client.getEntries({ @@ -21,7 +22,7 @@ export const getStaticProps = async () => { const blogHome = blogHomeEntries.items[0] - if (!blogHome || !postsEntries) { + if (!blogHome || !allPosts) { return { notFound: true, } @@ -32,12 +33,12 @@ export const getStaticProps = async () => { delete blogHome.fields.featured.fields.relatedPosts } blogHome.fields.mostPopular.forEach((item: any) => delete item.fields.relatedPosts) - postsEntries.items.forEach((item: any) => delete item.fields.relatedPosts) + allPosts.items.forEach((item: any) => delete item.fields.relatedPosts) return { props: { blogHome, - allPosts: postsEntries, + allPosts, }, } } diff --git a/src/pages/press.tsx b/src/pages/press.tsx index c4dba3be7..813b562e6 100644 --- a/src/pages/press.tsx +++ b/src/pages/press.tsx @@ -12,6 +12,7 @@ export const getStaticProps = async () => { content_type: 'post', // order by date, most recent first order: ['-fields.date'], + limit: 150, }) const pressRoomEntries = await client.getEntries({ From a7b2a3b48764034dffd8c2c31df935ed57e8ebef Mon Sep 17 00:00:00 2001 From: Diogo Soares <32431609+DiogoSoaress@users.noreply.github.com> Date: Mon, 23 Sep 2024 15:32:00 +0200 Subject: [PATCH 5/6] chore: clean up logs --- src/components/Blog/BlogHome/index.tsx | 2 -- src/components/Pressroom/index.tsx | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/components/Blog/BlogHome/index.tsx b/src/components/Blog/BlogHome/index.tsx index 8596482cb..0dab2a761 100644 --- a/src/components/Blog/BlogHome/index.tsx +++ b/src/components/Blog/BlogHome/index.tsx @@ -8,7 +8,6 @@ import type { Entry } from 'contentful' import { isEntryTypePost } from '@/lib/typeGuards' import { useClientEntry } from '@/hooks/useClientEntry' import type { PostEntryCollection } from '@/config/types' -import { isDraft } from '@/lib/contentful/isDraft' const categories = ['Announcements', 'Ecosystem', 'Community', 'Insights', 'Build'] @@ -22,7 +21,6 @@ export type BlogHomeProps = { } const BlogHome = ({ blogHome, allPosts }: BlogHomeProps) => { - console.log('BlogHome', allPosts.items.filter((post) => !isDraft(post)).length) const { data: localBlogHome } = useClientEntry(blogHome.sys.id, blogHome) const { featured, metaTags, mostPopular } = localBlogHome.fields diff --git a/src/components/Pressroom/index.tsx b/src/components/Pressroom/index.tsx index 8e79fcec1..3cba1b96c 100644 --- a/src/components/Pressroom/index.tsx +++ b/src/components/Pressroom/index.tsx @@ -37,7 +37,6 @@ export type PressRoomProps = { } const PressRoom = ({ pressRoom, allPosts, totalAssets }: PressRoomProps) => { - console.log('PressRoom non-drafts', allPosts.items.filter((post) => !isDraft(post)).length) const { data: localPressRoom } = useClientEntry(pressRoom.sys.id, pressRoom) const { localAllPosts } = useAllPosts(allPosts) @@ -50,8 +49,8 @@ const PressRoom = ({ pressRoom, allPosts, totalAssets }: PressRoomProps) => { const podcastsList = podcasts.filter(isEntryTypeExternalURL) const videosList = videos.filter(isEntryTypeExternalURL) + // Get the most recent press release that is not a draft const latestPressRelease = localAllPosts.items.find((post) => isPressReleasePost(post) && !isDraft(post)) - console.log('latest', latestPressRelease?.fields.title) return ( <> From b9abf26d829d675e16ff6f92a15e1897dd36fe3b Mon Sep 17 00:00:00 2001 From: Diogo Soares <32431609+DiogoSoaress@users.noreply.github.com> Date: Tue, 24 Sep 2024 15:02:24 +0200 Subject: [PATCH 6/6] refactor: create an util function to identify published press releases --- .../Blog/SearchFilterResults/index.tsx | 2 +- .../Pressroom/PressReleases/index.tsx | 6 +- src/components/Pressroom/index.tsx | 5 +- src/lib/containsTag.ts | 5 +- .../__test__/isPressRelease.test.ts | 115 ++++++++++++++++++ src/lib/contentful/isPressRelease.ts | 7 ++ 6 files changed, 129 insertions(+), 11 deletions(-) create mode 100644 src/lib/contentful/__test__/isPressRelease.test.ts create mode 100644 src/lib/contentful/isPressRelease.ts diff --git a/src/components/Blog/SearchFilterResults/index.tsx b/src/components/Blog/SearchFilterResults/index.tsx index 3392fe5c0..e3da2c2b4 100644 --- a/src/components/Blog/SearchFilterResults/index.tsx +++ b/src/components/Blog/SearchFilterResults/index.tsx @@ -11,7 +11,7 @@ import ShowMoreButton from '@/components/common/ShowMoreButton' import CategoryFilter from '@/components/common/CategoryFilter' import { getPage } from '@/lib/getPage' import { useAllPosts } from '@/hooks/useAllPosts' -import { isPressReleasePost } from '@/lib/containsTag' +import { isPressReleasePost } from '@/lib/contentful/isPressRelease' import { isDraft } from '@/lib/contentful/isDraft' import { isSelectedCategory } from '@/lib/contentful/isSelectedCategory' import type { PostEntryCollection } from '@/config/types' diff --git a/src/components/Pressroom/PressReleases/index.tsx b/src/components/Pressroom/PressReleases/index.tsx index d79dfaa5c..ff123e7b6 100644 --- a/src/components/Pressroom/PressReleases/index.tsx +++ b/src/components/Pressroom/PressReleases/index.tsx @@ -6,11 +6,11 @@ import ShowMoreButton from '@/components/common/ShowMoreButton' import SearchIcon from '@/public/images/search.svg' import CategoryFilter from '@/components/common/CategoryFilter' import { PressroomIds } from '@/components/Pressroom/ContentsNavigation' -import { containsTag, isPressReleasePost } from '@/lib/containsTag' -import { isDraft } from '@/lib/contentful/isDraft' +import { containsTag } from '@/lib/containsTag' import { getPage } from '@/lib/getPage' import { useAllPosts } from '@/hooks/useAllPosts' import type { PostEntryCollection } from '@/config/types' +import { isPublishedPressRelease } from '@/lib/contentful/isPressRelease' const categories = ['Safe{Core}', 'Safe{Wallet}', 'Safe{DAO}', 'Ecosystem', 'Institutional', 'Internal'] @@ -24,7 +24,7 @@ const PressReleases = ({ allPosts }: { allPosts: PostEntryCollection }) => { const { localAllPosts } = useAllPosts(allPosts) const filteredPosts = useMemo(() => { - const pressPosts = localAllPosts.items.filter((post) => isPressReleasePost(post) && !isDraft(post)) + const pressPosts = localAllPosts.items.filter(isPublishedPressRelease) return !selectedTag ? pressPosts : pressPosts.filter((post) => containsTag(post.fields.tags, selectedTag)) }, [localAllPosts.items, selectedTag]) diff --git a/src/components/Pressroom/index.tsx b/src/components/Pressroom/index.tsx index 3cba1b96c..63203a113 100644 --- a/src/components/Pressroom/index.tsx +++ b/src/components/Pressroom/index.tsx @@ -24,8 +24,7 @@ import { Container } from '@mui/material' import type { Entry } from 'contentful' import { useClientEntry } from '@/hooks/useClientEntry' import type { PostEntryCollection } from '@/config/types' -import { isPressReleasePost } from '@/lib/containsTag' -import { isDraft } from '@/lib/contentful/isDraft' +import { isPublishedPressRelease } from '@/lib/contentful/isPressRelease' import { useAllPosts } from '@/hooks/useAllPosts' export type PressRoomEntry = Entry @@ -50,7 +49,7 @@ const PressRoom = ({ pressRoom, allPosts, totalAssets }: PressRoomProps) => { const videosList = videos.filter(isEntryTypeExternalURL) // Get the most recent press release that is not a draft - const latestPressRelease = localAllPosts.items.find((post) => isPressReleasePost(post) && !isDraft(post)) + const latestPressRelease = localAllPosts.items.find(isPublishedPressRelease) return ( <> diff --git a/src/lib/containsTag.ts b/src/lib/containsTag.ts index 1b95afb2f..209eadd60 100644 --- a/src/lib/containsTag.ts +++ b/src/lib/containsTag.ts @@ -1,11 +1,8 @@ -import { type BlogPostEntry } from '@/components/Blog/Post' -import { type TagsType } from '@/components/Blog/Tags' import { isEntryTypeTag } from '@/lib/typeGuards' +import type { TagsType } from '@/components/Blog/Tags' export const PRESS_RELEASE_TAG = 'Press' export const containsTag = (tags: TagsType, targetTag: string) => { return !!tags?.filter(isEntryTypeTag)?.some((item) => item.fields.name === targetTag) } - -export const isPressReleasePost = (post: BlogPostEntry) => containsTag(post.fields.tags, PRESS_RELEASE_TAG) diff --git a/src/lib/contentful/__test__/isPressRelease.test.ts b/src/lib/contentful/__test__/isPressRelease.test.ts new file mode 100644 index 000000000..31240d9ca --- /dev/null +++ b/src/lib/contentful/__test__/isPressRelease.test.ts @@ -0,0 +1,115 @@ +import { isPressReleasePost, isPublishedPressRelease } from '@/lib/contentful/isPressRelease' +import type { BlogPostEntry } from '@/components/Blog/Post' +import type { TypePostFields } from '@/contentful/types' + +describe('isPressReleasePost', () => { + it('should return true if the post contains the press release tag', () => { + const post = { + fields: { + tags: [ + { + fields: { name: 'Press' }, + sys: { + contentType: { + sys: { + id: 'tag', + }, + }, + }, + }, + ] as unknown as TypePostFields['tags'], + }, + } as BlogPostEntry + + expect(isPressReleasePost(post)).toBe(true) + }) + + it('should return false if the post does not contain the press release tag', () => { + const post = { + fields: { + tags: [ + { + fields: { name: 'Dummy' }, + sys: { + contentType: { + sys: { + id: 'tag', + }, + }, + }, + }, + ] as unknown as TypePostFields['tags'], + }, + } as BlogPostEntry + + expect(isPressReleasePost(post)).toBe(false) + }) +}) + +describe('isPublishedPressRelease', () => { + it('should return true if the post is a press release and is not a draft', () => { + const post = { + fields: { + isDraft: false, + tags: [ + { + fields: { name: 'Press' }, + sys: { + contentType: { + sys: { + id: 'tag', + }, + }, + }, + }, + ] as unknown as TypePostFields['tags'], + }, + } as BlogPostEntry + + expect(isPublishedPressRelease(post)).toBe(true) + }) + + it('should return false if the post is a press release but is a draft', () => { + const post = { + fields: { + isDraft: true, + tags: [ + { + fields: { name: 'Press' }, + sys: { + contentType: { + sys: { + id: 'tag', + }, + }, + }, + }, + ] as unknown as TypePostFields['tags'], + }, + } as BlogPostEntry + + expect(isPublishedPressRelease(post)).toBe(false) + }) + + it('should return false if the post is not a press release', () => { + const post = { + fields: { + isDraft: false, + tags: [ + { + fields: { name: 'Safe{Wallet}' }, + sys: { + contentType: { + sys: { + id: 'tag', + }, + }, + }, + }, + ] as unknown as TypePostFields['tags'], + }, + } as BlogPostEntry + + expect(isPublishedPressRelease(post)).toBe(false) + }) +}) diff --git a/src/lib/contentful/isPressRelease.ts b/src/lib/contentful/isPressRelease.ts new file mode 100644 index 000000000..6c49600c4 --- /dev/null +++ b/src/lib/contentful/isPressRelease.ts @@ -0,0 +1,7 @@ +import { containsTag, PRESS_RELEASE_TAG } from '@/lib/containsTag' +import { isDraft } from '@/lib/contentful/isDraft' +import type { BlogPostEntry } from '@/components/Blog/Post' + +export const isPressReleasePost = (post: BlogPostEntry) => containsTag(post.fields.tags, PRESS_RELEASE_TAG) + +export const isPublishedPressRelease = (post: BlogPostEntry) => isPressReleasePost(post) && !isDraft(post)