Skip to content

Commit

Permalink
ThemeTierBadge: Return null whene there is no badge (#86659)
Browse files Browse the repository at this point in the history
  • Loading branch information
xavier-lc authored Jan 22, 2024
1 parent 3d36563 commit e210eef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 7 additions & 1 deletion client/components/theme-tier/theme-tier-badge/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,20 @@ export default function ThemeTierBadge( {
return <ThemeTierUpgradeBadge />;
};

const badge = getBadge();

if ( ! badge ) {
return null;
}

return (
<div className={ classNames( 'theme-tier-badge', className ) }>
<ThemeTierBadgeContextProvider
canGoToCheckout={ canGoToCheckout }
showUpgradeBadge={ showUpgradeBadge }
themeId={ themeId }
>
{ getBadge() }
{ badge }
</ThemeTierBadgeContextProvider>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -583,10 +583,6 @@ $design-button-primary-color: rgb(17, 122, 201);

.design-picker-design-title__theme-tier-badge {
gap: 8px;

&:empty {
display: none;
}
}

.step-container__navigation {
Expand Down

0 comments on commit e210eef

Please sign in to comment.