-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix category mapping that was breaking rendering (#47)
Why: - archive button wasn't correctly typed and as such was breaking in some situations; How: - fixed contentType mapping to correct the mentioned errors;
- Loading branch information
Showing
7 changed files
with
44 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { BlogpostIcon, CaseStudiesIcon, PodcastIcon, TalksIcon } from '@/app/_icons/icons' | ||
|
||
const iconMap = { | ||
blogposts: <BlogpostIcon width={'20'} />, | ||
'podcast-episodes': <PodcastIcon width={'20'} />, | ||
'case-studies': <CaseStudiesIcon width={'20'} />, | ||
'talks-and-roundtables': <TalksIcon width={'20'} />, | ||
} | ||
|
||
import styles from './styles.module.css' | ||
|
||
function formatTitle(text: string) { | ||
return text | ||
.replace(/\band\b/g, '&') | ||
.split('-') | ||
.map(word => word.charAt(0).toUpperCase() + word.slice(1)) | ||
.join(' ') | ||
} | ||
|
||
interface ArchiveButtonProps { | ||
collection: 'blogposts' | 'podcast-episodes' | 'case-studies' | 'talks-and-roundtables' | ||
color?: string | ||
} | ||
|
||
export default function ArchiveButton({ collection, color }: ArchiveButtonProps) { | ||
return ( | ||
<a href={`/${collection}`} style={{ color: color || 'var(--dark-rock-800)' }}> | ||
<div className={styles.container}> | ||
{iconMap[collection]} {formatTitle(collection)} | ||
</div> | ||
</a> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.container { | ||
display: flex; | ||
gap: 10px; | ||
align-items: center; | ||
padding-top: 10px; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters