-
Notifications
You must be signed in to change notification settings - Fork 30
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
Reader Revenue message on US front #12593
Conversation
Size Change: +12.3 kB (+1.37%) Total Size: 914 kB
ℹ️ View Unchanged
|
@@ -45,7 +45,8 @@ function transformChoiceCardsAmountsToProduct( | |||
const useChoiceCards = ( | |||
choiceCardAmounts: SelectedAmountsVariant | undefined, | |||
countryCode: string | undefined, | |||
content: BannerTextContent, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small refactor here because now both the banner and the new front container use this hook.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Maybe it would be useful to add a story ?
@@ -306,6 +307,33 @@ export const FrontLayout = ({ front, NAV }: Props) => { | |||
return null; | |||
} | |||
|
|||
if (collection.displayName === 'US end-of-year 2024') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (collection.displayName === 'US end-of-year 2024') { | |
if (collection.displayName === 'US end-of-year 2024' && editionId === 'US') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, though it's the pageId
we need to check. Have pushed a commit
What does this change?
Adds a new component for the upcoming US end-of-year "Moment". This component is rendered in a Front container. We use the name of the container ("US end-of-year 2024") to decide when to render it. This means a container will need to be created in the fronts tool with the correct name.
Why?
In the past we've used "Thrashers" to deploy this type of message to the fronts. However, thrashers are not suitable for rich/interactive components like this. This component needs to render a ticker (based on a fetch) and interactive choice cards.
It's now much easier to build this type of thing in DCR as islands, where the relevant source components etc exist. It's also easier to line it up with the columns of the fronts.
Screenshots
Wide:
Leftcol:
Desktop:
Tablet:
Mobile: