Skip to content

Commit

Permalink
feat: Primary button colour override
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-daniel-dempsey committed Feb 3, 2025
1 parent 1872036 commit ef49dd0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ const getButtonAppearance = (
index: number,
isFeature?: boolean,
hierarchy?: string,
primary?: boolean,
) => {
if (primary) {
return 'primary';
}
if (isFeature && index === 0) {
return 'primary';
} else if (isFeature && index > 0) {
Expand Down Expand Up @@ -66,7 +70,12 @@ function SubscriptionsProductDescription({
<AnchorButton
href={button.link}
onClick={button.analyticsTracking}
appearance={getButtonAppearance(index, isFeature, button.hierarchy)}
appearance={getButtonAppearance(
index,
isFeature,
button.hierarchy,
button.primary,
)}
modifierClasses={[
button.modifierClasses ?? '',
'subscriptions__product-button',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export type ProductButton = {
analyticsTracking: () => void;
hierarchy?: string;
modifierClasses?: string;
primary?: boolean;
};

type ProductCopy = {
Expand Down Expand Up @@ -165,6 +166,7 @@ function digitalCheckout(
componentType: 'ACQUISITIONS_BUTTON',
}),
modifierClasses: 'digital',
primary: true,
},
],
benefits: productCatalogDescription['DigitalSubscription'].benefits,
Expand Down

0 comments on commit ef49dd0

Please sign in to comment.