From 42299abf82634df1ce5077605d0b974d0c0a6166 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20der=20Winden?= Date: Thu, 1 Aug 2024 11:46:11 +0200 Subject: [PATCH] Added styling for accent colours on Tiers and Offers (#20696) fixes https://linear.app/tryghost/issue/DES-81/misleading-hardcoded-tier-preview-title-colors Tiers and Offers in Admin were shown with hardcoded pink titles. This changes that. They are now shown with black titles, and only in the preview will they render with the site's accent colour. --------- Co-authored-by: Princi Vershwal --- apps/admin-x-design-system/styles.css | 3 ++- apps/admin-x-design-system/tailwind.config.cjs | 1 + .../src/components/settings/growth/Offers.tsx | 2 +- .../settings/membership/tiers/TierDetailPreview.tsx | 6 +++--- .../src/components/settings/membership/tiers/TiersList.tsx | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/admin-x-design-system/styles.css b/apps/admin-x-design-system/styles.css index 1842f304c2..5ba0b87bf7 100644 --- a/apps/admin-x-design-system/styles.css +++ b/apps/admin-x-design-system/styles.css @@ -96,4 +96,5 @@ /* Prose classes are for formatting arbitrary HTML that comes from the API */ .gh-prose-links a { color: #30CF43; -} \ No newline at end of file +} + diff --git a/apps/admin-x-design-system/tailwind.config.cjs b/apps/admin-x-design-system/tailwind.config.cjs index 7a614ce4f6..59a302365e 100644 --- a/apps/admin-x-design-system/tailwind.config.cjs +++ b/apps/admin-x-design-system/tailwind.config.cjs @@ -18,6 +18,7 @@ module.exports = { colors: { transparent: 'transparent', current: 'currentColor', + accent: 'var(--accent-color, #ff0095)', white: '#FFF', black: '#15171A', grey: { diff --git a/apps/admin-x-settings/src/components/settings/growth/Offers.tsx b/apps/admin-x-settings/src/components/settings/growth/Offers.tsx index dedcc9daaa..75b07ffff6 100644 --- a/apps/admin-x-settings/src/components/settings/growth/Offers.tsx +++ b/apps/admin-x-settings/src/components/settings/growth/Offers.tsx @@ -13,7 +13,7 @@ const OfferContainer: React.FC<{offerTitle: string, tier: Tier, cadence: string, {offerTitle, tier, cadence, redemptions, type, amount, currency, offerId, offerCode, goToOfferEdit}) => { const {discountOffer} = getOfferDiscount(type, amount, cadence, currency || 'USD', tier); return
goToOfferEdit(offerId)}> - {offerTitle} + {offerTitle}
{discountOffer}
diff --git a/apps/admin-x-settings/src/components/settings/membership/tiers/TierDetailPreview.tsx b/apps/admin-x-settings/src/components/settings/membership/tiers/TierDetailPreview.tsx index ae5c115087..ced9678a6d 100644 --- a/apps/admin-x-settings/src/components/settings/membership/tiers/TierDetailPreview.tsx +++ b/apps/admin-x-settings/src/components/settings/membership/tiers/TierDetailPreview.tsx @@ -22,8 +22,8 @@ export const TrialDaysLabel: React.FC<{size?: 'sm' | 'md'; trialDays: number;}> return ( - - {trialDays} days free + + {trialDays} days free ); }; @@ -96,7 +96,7 @@ const TierDetailPreview: React.FC = ({tier, isFreeTier})
-

{name || (isFreeTier ? 'Free' : 'Bronze')}

+

{name || (isFreeTier ? 'Free' : 'Bronze')}

{currencySymbol} diff --git a/apps/admin-x-settings/src/components/settings/membership/tiers/TiersList.tsx b/apps/admin-x-settings/src/components/settings/membership/tiers/TiersList.tsx index 28c5c6dca1..3aa1b36a08 100644 --- a/apps/admin-x-settings/src/components/settings/membership/tiers/TiersList.tsx +++ b/apps/admin-x-settings/src/components/settings/membership/tiers/TiersList.tsx @@ -30,7 +30,7 @@ const TierCard: React.FC = ({tier}) => {
{ updateRoute({route: `tiers/${tier.id}`}); }}> -
{tier.name}
+
{tier.name}
{currencySymbol} {numberWithCommas(currencyToDecimal(tier.monthly_price || 0))}