Skip to content

Commit

Permalink
Merge pull request #4950 from thematters/fix/campaign-featured-tag
Browse files Browse the repository at this point in the history
[hotfix] fix(campaign): show featured label for stage feeds
  • Loading branch information
gitwoz authored Nov 20, 2024
2 parents 6f55cf7 + e025a73 commit e7a667d
Showing 1 changed file with 16 additions and 24 deletions.
40 changes: 16 additions & 24 deletions src/views/CampaignDetail/ArticleFeeds/MainFeed/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@ const getArticleStageName = (
]
}

const FeaturedLabel = () => (
<TextIcon
icon={<Icon icon={IconStar} size={12} style={{ opacity: 0.5 }} />}
spacing={2}
color="freeWriteGreenLabel"
size={12}
>
<FormattedMessage defaultMessage="Featured" id="CnPG8j" />
</TextIcon>
)

const MainFeed = ({ feedType, camapign }: MainFeedProps) => {
const viewer = useContext(ViewerContext)
const { lang } = useContext(LanguageContext)
Expand Down Expand Up @@ -212,8 +223,8 @@ const MainFeed = ({ feedType, camapign }: MainFeedProps) => {
<ArticleDigestFeed
article={node}
label={
(isAll || isFeatured) && (
<>
<>
{(isAll || isFeatured) && (
<span
className={[
styles.articleLabel,
Expand All @@ -222,28 +233,9 @@ const MainFeed = ({ feedType, camapign }: MainFeedProps) => {
>
{getArticleStageName(node, lang)}
</span>

{isAll && featured && (
<TextIcon
icon={
<Icon
icon={IconStar}
size={12}
style={{ opacity: 0.5 }}
/>
}
spacing={2}
color="freeWriteGreenLabel"
size={12}
>
<FormattedMessage
defaultMessage="Featured"
id="CnPG8j"
/>
</TextIcon>
)}
</>
)
)}
{!isFeatured && featured && <FeaturedLabel />}
</>
}
onClick={() => {
analytics.trackEvent('click_feed', {
Expand Down

0 comments on commit e7a667d

Please sign in to comment.