Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
feat: add subscriptions marketing url (#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
NawfalAhmed authored Jun 23, 2023
1 parent 3f5e273 commit f6f5717
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 9 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ LOGO_TRADEMARK_URL=''
LOGO_WHITE_URL=''
FAVICON_URL=''
ENABLE_B2C_SUBSCRIPTIONS=false
SUBSCRIPTIONS_MARKETING_URL=''
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ LOGO_TRADEMARK_URL=https://edx-cdn.org/v3/default/logo-trademark.svg
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
1 change: 1 addition & 0 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ LOGO_TRADEMARK_URL=https://edx-cdn.org/v3/default/logo-trademark.svg
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
1 change: 1 addition & 0 deletions src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ mergeConfig({
COMMERCE_COORDINATOR_BASE_URL: process.env.COMMERCE_COORDINATOR_BASE_URL,
ENABLE_B2C_SUBSCRIPTIONS: process.env.ENABLE_B2C_SUBSCRIPTIONS,
SUBSCRIPTIONS_BASE_URL: process.env.SUBSCRIPTIONS_BASE_URL,
SUBSCRIPTIONS_MARKETING_URL: process.env.SUBSCRIPTIONS_MARKETING_URL,
SUPPORT_URL: process.env.SUPPORT_URL,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,14 @@ exports[`<OrdersAndSubscriptions /> Renders correctly in various states renders
<span
className="pgn__action-row-spacer"
/>
<button
<a
className="text-nowrap btn btn-primary btn-sm"
disabled={false}
type="button"
href="http://localhost:18000/program-subscriptions"
onClick={[Function]}
onKeyDown={[Function]}
>
Explore subscription options
</button>
</a>
</div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/setupTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ mergeConfig({
COMMERCE_COORDINATOR_BASE_URL: process.env.COMMERCE_COORDINATOR_BASE_URL,
ENABLE_B2C_SUBSCRIPTIONS: process.env.ENABLE_B2C_SUBSCRIPTIONS,
SUBSCRIPTIONS_BASE_URL: process.env.SUBSCRIPTIONS_BASE_URL,
SUBSCRIPTIONS_MARKETING_URL: process.env.SUBSCRIPTIONS_MARKETING_URL,
SUPPORT_URL: process.env.SUPPORT_URL,
});

Expand Down
9 changes: 8 additions & 1 deletion src/subscriptions/SubscriptionUpsell.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
import React from 'react';
import { useMediaQuery } from 'react-responsive';

import { getConfig } from '@edx/frontend-platform';
import { FormattedMessage } from '@edx/frontend-platform/i18n';
import { Alert, Badge, Button } from '@edx/paragon';

const SubscriptionUpsell = () => (
<Alert
className="bg-light-200"
actions={[
<Button className="text-nowrap">
<Button
href={
getConfig().MARKETING_SITE_BASE_URL
+ getConfig().SUBSCRIPTIONS_MARKETING_URL
}
className="text-nowrap"
>
<FormattedMessage
id="ecommerce.order.history.subscription.upsell.button"
defaultMessage="Explore subscription options"
Expand Down
9 changes: 5 additions & 4 deletions src/subscriptions/__snapshots__/Subscriptions.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,14 @@ exports[`<Subscriptions /> Renders correctly in various states renders with no s
<span
className="pgn__action-row-spacer"
/>
<button
<a
className="text-nowrap btn btn-primary btn-sm"
disabled={false}
type="button"
href="http://localhost:18000/program-subscriptions"
onClick={[Function]}
onKeyDown={[Function]}
>
Explore subscription options
</button>
</a>
</div>
</div>
</div>
Expand Down

0 comments on commit f6f5717

Please sign in to comment.