Skip to content

Commit

Permalink
maps
Browse files Browse the repository at this point in the history
  • Loading branch information
chrstinalin committed Dec 2, 2024
1 parent 009582f commit a3b7f64
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
8 changes: 6 additions & 2 deletions src/amo/components/AddonBadges/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@ export class AddonBadgesBase extends React.Component<InternalProps> {

return (
<div className="AddonBadges">
{promotedCategories.forEach((category) => (
<PromotedBadge category={category} size="large" />
{promotedCategories.map((category) => (
<PromotedBadge
key={`${addon.name}-${category}`}
category={category}
size="large"
/>
))}
{addon.is_experimental ? (
<Badge type="experimental" label={i18n.gettext('Experimental')} />
Expand Down
7 changes: 3 additions & 4 deletions src/amo/components/InstallWarning/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,9 @@ export class InstallWarningBase extends React.Component<InternalProps> {
!correctedLocation &&
isFirefox({ userAgentInfo }) &&
addon.type === ADDON_TYPE_EXTENSION &&
(!promotedCategories ||
promotedCategories.some(
(promoted) => !EXCLUDE_WARNING_CATEGORIES.includes(promoted),
))
promotedCategories.some(
(promoted) => !EXCLUDE_WARNING_CATEGORIES.includes(promoted),
)
);
};

Expand Down
7 changes: 4 additions & 3 deletions src/amo/components/SearchSuggestion/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,15 @@ export const SearchSuggestionBase = ({
<span className="SearchSuggestion-name">
{loading ? <LoadingText minWidth={20} /> : name}
</span>
{promotedCategories.forEach((category) => {
{promotedCategories.map((category) => (
<IconPromotedBadge
key={`${suggestion.name}-${category}`}
category={category}
className="SearchSuggestion-icon-promoted"
showAlt
size="small"
/>;
})}
/>
))}
<Icon
alt={arrowAlt}
className="SearchSuggestion-icon-arrow"
Expand Down

0 comments on commit a3b7f64

Please sign in to comment.