Skip to content

Commit

Permalink
add the link for website planet interview
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-titarenko committed Jan 21, 2025
1 parent 4befb43 commit 03314ef
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
9 changes: 9 additions & 0 deletions components/home/AnnouncementBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ export function AnnouncementBadge({ announcement }: AnnouncementBadgeProps) {
</Link>
)

case 'externalLink':
return (
<Link className={ classes.announcementContainer } href={ announcement.url } target="_blank" rel="noopener">
<div className={ classes.announcementIndicator } />
<span className={ classes.announcementText }>{ announcement.title }</span>
<ArrowCircleRightIcon />
</Link>
)

case 'productHunt':
return (
<ProductHuntAnnouncementBadge
Expand Down
8 changes: 7 additions & 1 deletion data/announcement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@ const postAnnouncement: Announcement | undefined = latestPost ? {
url: Routes.blogPost(latestPost)
} : undefined

const externalLinkAnnouncement: Announcement = {
type: 'externalLink',
title: 'Interview with Website Planet',
url: 'https://www.websiteplanet.com/blog/noteshub-interview'
}

const productHuntAnnouncement: Announcement = {
type: 'productHunt',
postId: '451685',
postSlug: 'noteshub-3-3'
}

export default postAnnouncement
export default externalLinkAnnouncement
7 changes: 7 additions & 0 deletions models/Announcement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ export type PostAnnouncement = {
url: string
}

export type ExternalLinkAnnouncement = {
type: 'externalLink'
title: string
url: string
}

export type ProductHuntAnnouncement = {
type: 'productHunt'
postId: string
Expand All @@ -12,4 +18,5 @@ export type ProductHuntAnnouncement = {

export type Announcement =
| PostAnnouncement
| ExternalLinkAnnouncement
| ProductHuntAnnouncement

0 comments on commit 03314ef

Please sign in to comment.