Skip to content

Commit

Permalink
šŸ› don't render tags section in datapage header if no tags are presentā€¦
Browse files Browse the repository at this point in the history
ā€¦ after filtering
  • Loading branch information
ikesau committed Feb 5, 2025
1 parent 4ac3177 commit e6bd9b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 5 additions & 7 deletions site/DataPageV2Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,11 @@ export const DataPageV2Content = ({
{titleFragments}
</div>
</div>
{!!datapageData.topicTagsLinks?.length && (
<TopicTags
className="header__right col-start-10 span-cols-4 col-sm-start-2 span-sm-cols-12"
topicTagsLinks={datapageData.topicTagsLinks}
tagToSlugMap={tagToSlugMap}
/>
)}
<TopicTags
className="header__right col-start-10 span-cols-4 col-sm-start-2 span-sm-cols-12"
topicTagsLinks={datapageData.topicTagsLinks}
tagToSlugMap={tagToSlugMap}
/>
</div>
</div>
<nav className="sticky-nav sticky-nav--dark span-cols-14 grid grid-cols-12-full-width">
Expand Down
4 changes: 3 additions & 1 deletion site/TopicTags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ export default function TopicTags({
tagToSlugMap,
}: {
className?: string
topicTagsLinks: string[]
topicTagsLinks?: string[]
tagToSlugMap: Record<string, string>
}) {
// TODO (DB): mark topic pages
const tags = topicTagsLinks
?.map((name) => ({ name, slug: tagToSlugMap[name] }))
.filter((tag) => !!tag.slug)
if (!tags?.length) return null

return (
<div className={className}>
<div className="topic-tags__label">
Expand Down

0 comments on commit e6bd9b4

Please sign in to comment.