-
Notifications
You must be signed in to change notification settings - Fork 9
feat(component-news): added hideTags prop that defaults to true #1584
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
base: dev
Are you sure you want to change the base?
Conversation
Tags are hidden by default on conponent-news cards
|
Storybook deployed at https://unity-uds-staging.s3.us-west-2.amazonaws.com/pr-1584/index.html |
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.
Pull Request Overview
This PR adds a hideTags prop to the component-news package that allows hiding tags on news cards, with tags hidden by default. The change standardizes the behavior across different news display formats by making tags optional and providing consistent control over their visibility.
- Added
hideTagsprop with default value oftrueto hide tags by default - Updated prop types to accept both boolean and string values for the
hideTagsprop - Modified rendering logic to conditionally display tags based on the
hideTagsprop value
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/component-news/src/core/types/news-types.js | Added TypeScript definition for the new hideTags prop |
| packages/component-news/src/components/CardListlNews/index.jsx | Implemented hideTags functionality in list view with prop validation |
| packages/component-news/src/components/CardGridNews/index.jsx | Implemented hideTags functionality in grid view |
| packages/component-news/src/components/CardCarouselNews/index.jsx | Removed unnecessary blank line |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| * @param {FeedType} props | ||
| */ | ||
| const CardGridNews = ({ cardButton, ...props }) => { | ||
| const CardGridNews = ({ cardButton, hideTags = true, ...props }) => { |
Copilot
AI
Sep 29, 2025
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.
Missing PropTypes validation for the hideTags prop. Should include the same validation as CardListlNews: hideTags: PropTypes.oneOf([\"true\", \"false\", true, false])
| /** | ||
| * | ||
| * @param {Object} feed | ||
| * @param {import("../../core/types/news-types").CardButton} cardButton |
Copilot
AI
Sep 29, 2025
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.
Missing JSDoc parameter documentation for the new hideTags parameter. Should add @param {boolean} hideTags to match the pattern used in CardListlNews.
| * @param {import("../../core/types/news-types").CardButton} cardButton | |
| * @param {import("../../core/types/news-types").CardButton} cardButton | |
| * @param {boolean} hideTags |
Tags are hidden by default on conponent-news cards.
Tags already do not appear on the news carousel by default so no change was needed there
Description
Checklist
Important Reminders
Links