Open
Conversation
e68e927 to
1049011
Compare
abeddow91
commented
Feb 3, 2026
Comment on lines
+260
to
+268
| {isVideoArticle ? ( | ||
| <Pill | ||
| content={ | ||
| <time>{secondsToDuration(duration ?? 0)}</time> | ||
| } | ||
| prefix="Video" | ||
| icon={<SvgMediaControlsPlay width={18} />} | ||
| /> | ||
| ) : ( |
Contributor
Author
There was a problem hiding this comment.
We have to use Pill directly here, rather than letting CardFooter decide, as we do not have access main media.
|
Hello 👋! When you're ready to run Chromatic, please apply the You will need to reapply the label each time you want to run Chromatic. |
# Conflicts: # dotcom-rendering/src/components/Card/Card.tsx
…ll should be shown
4b18e81 to
786c993
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this change?
This refactor centralises all pill decision logic into a single CardPill component, which is now reused across card types.
The card footer has been reworked so that almost all pill-related logic lives inside the footer, co-locating the pill with other metadata such as age and comment count. This reduces duplication and makes the pill behaviour consistent across cards.
Why?
Pill logic was previously scattered across multiple card implementations, making it hard to reason about, update, or extend safely.
By introducing a shared CardPill component and moving responsibility into the card footer it ensures pill behaviour is consistent across card types and the decision logic is easier to maintain and test.
Screenshots
There are no visual changes as a consequence of this refactor.