Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const cardRow = (feed, index, cardButton) => ({
href: feed.buttonLink,
},
],
cardLink: feed.eventButtonUrl || feed?.buttonLink,
});

/**
Expand All @@ -42,7 +43,7 @@ const CarouselTemplate = ({ cardButton }) => {
<NewsWrapper>
<CardCarousel
width="auto"
cardType="story"
cardType="news"
perView="3"
cardItems={cardItems || []}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const gridRow = (feed, cardButton, hideTags) => (
key={feed.id}
>
<Card
type="default"
type="news"
eventFormat="inline"
eventLocation={feed.location}
clickable={!!feed.buttonLink}
Expand All @@ -41,6 +41,7 @@ const gridRow = (feed, cardButton, hideTags) => (
},
]}
tags={hideTags ? [] : parseInterests(feed?.interests)}
cardLink={feed.eventButtonUrl || feed?.buttonLink}
/>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import PropTypes from "prop-types";
const listRow = (feed, cardButton, hideTags) => (
<div className="card card-hover cards-items-container" key={feed.id}>
<Card
type="story"
type="news"
horizontal
eventFormat="inline"
eventLocation={feed.location}
Expand All @@ -38,6 +38,7 @@ const listRow = (feed, cardButton, hideTags) => (
},
]}
tags={hideTags ? [] : parseInterests(feed?.interests)}
cardLink={feed.eventButtonUrl || feed?.buttonLink}
/>
</div>
);
Expand Down
1 change: 1 addition & 0 deletions packages/unity-react-core/src/components/Card/Card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ const BaseCard = ({
[`card-degree`]: type === "degree",
[`card-event`]: type === "event",
[`card-story`]: type === "story",
[`card-news`]: type === "news",
[`w-${width.replace("%", "")}`]: width !== "100%",
[`card-horizontal`]: horizontal,
[`borderless`]: !showBorders,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const htmlTemplate = (
linkLabel={linkLabel}
linkUrl={linkUrl || buttons?.[0]?.href}
tags={tags}
cardLink={linkUrl || buttons?.[0]?.href}
Comment on lines 69 to +71
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably happened over time where we added one feature (prop) at a time, but this component is asking for things it already has. I do not have any problems with the code change, but these extra props made me take more time because I wanted to make sure it wasn't a mistake.

/>
),
});
Expand Down