Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hotfix] fix(campaign): show featured label for stage feeds #4950

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading