Skip to content

Commit

Permalink
feat: move subscription upsell values behind env (#314)
Browse files Browse the repository at this point in the history
  • Loading branch information
NawfalAhmed committed Jul 18, 2023
1 parent ffdebc3 commit 9fca857
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ LOGO_WHITE_URL=''
FAVICON_URL=''
ENABLE_B2C_SUBSCRIPTIONS=false
SUBSCRIPTIONS_MARKETING_URL=''
SUBSCRIPTIONS_MINIMUM_PRICE=''
2 changes: 2 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ LOGO_WHITE_URL=https://edx-cdn.org/v3/default/logo-white.svg
FAVICON_URL=https://edx-cdn.org/v3/default/favicon.ico
ENABLE_B2C_SUBSCRIPTIONS=true
SUBSCRIPTIONS_MARKETING_URL=/program-subscriptions
SUBSCRIPTIONS_MINIMUM_PRICE=$39
SUBSCRIPTIONS_TRIAL_LENGTH=7
2 changes: 2 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ LOGO_WHITE_URL=https://edx-cdn.org/v3/default/logo-white.svg
FAVICON_URL=https://edx-cdn.org/v3/default/favicon.ico
ENABLE_B2C_SUBSCRIPTIONS=true
SUBSCRIPTIONS_MARKETING_URL=/program-subscriptions
SUBSCRIPTIONS_MINIMUM_PRICE=$39
SUBSCRIPTIONS_TRIAL_LENGTH=7
2 changes: 2 additions & 0 deletions src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ mergeConfig({
ENABLE_B2C_SUBSCRIPTIONS: process.env.ENABLE_B2C_SUBSCRIPTIONS,
SUBSCRIPTIONS_BASE_URL: process.env.SUBSCRIPTIONS_BASE_URL,
SUBSCRIPTIONS_MARKETING_URL: process.env.SUBSCRIPTIONS_MARKETING_URL,
SUBSCRIPTIONS_MINIMUM_PRICE: process.env.SUBSCRIPTIONS_MINIMUM_PRICE,
SUBSCRIPTIONS_TRIAL_LENGTH: process.env.SUBSCRIPTIONS_TRIAL_LENGTH,
SUPPORT_URL: process.env.SUPPORT_URL,
});

Expand Down
2 changes: 2 additions & 0 deletions src/setupTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ mergeConfig({
ENABLE_B2C_SUBSCRIPTIONS: process.env.ENABLE_B2C_SUBSCRIPTIONS,
SUBSCRIPTIONS_BASE_URL: process.env.SUBSCRIPTIONS_BASE_URL,
SUBSCRIPTIONS_MARKETING_URL: process.env.SUBSCRIPTIONS_MARKETING_URL,
SUBSCRIPTIONS_MINIMUM_PRICE: process.env.SUBSCRIPTIONS_MINIMUM_PRICE,
SUBSCRIPTIONS_TRIAL_LENGTH: process.env.SUBSCRIPTIONS_TRIAL_LENGTH,
SUPPORT_URL: process.env.SUPPORT_URL,
});

Expand Down
4 changes: 2 additions & 2 deletions src/subscriptions/SubscriptionUpsell.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ const SubscriptionUpsell = () => (
defaultMessage="Now available for many popular programs, affordable monthly subscription pricing can help you manage your budget more effectively. Subscriptions start at {minSubscriptionPrice}/month USD per program, after a {trialLength}-day full access free trial. Cancel at any time."
description="Message body for subscription upsell"
values={{
minSubscriptionPrice: '$39',
trialLength: 7,
minSubscriptionPrice: getConfig().SUBSCRIPTIONS_MINIMUM_PRICE,
trialLength: getConfig().SUBSCRIPTIONS_TRIAL_LENGTH,
}}
/>
</Alert>
Expand Down

0 comments on commit 9fca857

Please sign in to comment.