-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: design changes for subscriptions
- Loading branch information
1 parent
1ef0847
commit 3e0a498
Showing
16 changed files
with
417 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import React, { useEffect } from 'react'; | ||
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n'; | ||
|
||
import Subscriptions from '../subscriptions'; | ||
import Payments from '../order-history'; | ||
|
||
import messages from './OrderAndSubscriptionsPage.messages'; | ||
|
||
const OrderAndSubscriptionsPage = ({ intl }) => { | ||
const isB2CSubsEnabled = true; | ||
|
||
const message = (id) => intl.formatMessage(messages[id]); | ||
|
||
useEffect(() => { | ||
if (isB2CSubsEnabled) { | ||
document.title = 'Orders and Subscriptions | edX'; | ||
} | ||
}, [isB2CSubsEnabled]); | ||
|
||
if (!isB2CSubsEnabled) { | ||
return ( | ||
<div className="page__order-and-subscriptions container-fluid py-5"> | ||
<Payments isB2CSubsEnabled={false} /> | ||
</div> | ||
); | ||
} | ||
|
||
return ( | ||
<div className="page__order-and-subscriptions container-fluid py-4.5"> | ||
<div className="section"> | ||
<h1 className="text-primary-700"> | ||
{message('ecommerce.order.history.main.heading')} | ||
</h1> | ||
<span className="text-dark-900"> | ||
{message('ecommerce.order.history.main.subtitle')} | ||
</span> | ||
</div> | ||
<Subscriptions /> | ||
<Payments isB2CSubsEnabled /> | ||
</div> | ||
); | ||
}; | ||
|
||
OrderAndSubscriptionsPage.propTypes = { | ||
intl: intlShape.isRequired, | ||
}; | ||
|
||
export default injectIntl(OrderAndSubscriptionsPage); |
17 changes: 17 additions & 0 deletions
17
src/order-and-subscriptions/OrderAndSubscriptionsPage.messages.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { defineMessages } from '@edx/frontend-platform/i18n'; | ||
|
||
const messages = defineMessages({ | ||
'ecommerce.order.history.main.heading': { | ||
id: 'ecommerce.order.history.main.heading', | ||
defaultMessage: 'My orders and subscriptions', | ||
description: 'Heading for orders and subscriptions page.', | ||
}, | ||
'ecommerce.order.history.main.subtitle': { | ||
id: 'ecommerce.order.history.main.subtitle', | ||
defaultMessage: | ||
'Manage your program subscriptions and view your order history.', | ||
description: 'Subtitle of Heading for orders and subscriptions page.', | ||
}, | ||
}); | ||
|
||
export default messages; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.page__order-and-subscriptions { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 2.5rem; | ||
|
||
section, .section { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
|
||
.section-gap-sm { | ||
gap: 0.75rem; | ||
} | ||
|
||
h1, h2 { | ||
margin-bottom: 0; | ||
} | ||
} | ||
|
||
.subscription-scrollable { | ||
max-height: 295px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// eslint-disable-next-line import/prefer-default-export | ||
export { default as OrderAndSubscriptionsPage } from './OrderAndSubscriptionsPage'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
166 changes: 84 additions & 82 deletions
166
src/order-history/__snapshots__/OrderHistoryPage.test.jsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,96 +1,98 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`<OrderHistoryPage /> Renders correctly in various states renders orders table with pagination 1`] = ` | ||
<div | ||
className="page__order-history container-fluid py-5" | ||
<section | ||
className="page__order-history" | ||
> | ||
<h1> | ||
Order History | ||
</h1> | ||
<nav | ||
aria-label="pagination navigation" | ||
className="pagination-default" | ||
> | ||
<div | ||
aria-atomic={true} | ||
aria-live="polite" | ||
aria-relevant="text" | ||
className="sr-only" | ||
<div> | ||
<nav | ||
aria-label="pagination navigation" | ||
className="pagination-default" | ||
> | ||
Page 2, Current Page, of 10 | ||
</div> | ||
<ul | ||
className="pagination" | ||
> | ||
<li | ||
className="page-item" | ||
<div | ||
aria-atomic={true} | ||
aria-live="polite" | ||
aria-relevant="text" | ||
className="sr-only" | ||
> | ||
Page 2, Current Page, of 10 | ||
</div> | ||
<ul | ||
className="pagination" | ||
> | ||
<button | ||
aria-label="Previous, Page 1" | ||
className="previous page-link btn btn-primary" | ||
disabled={false} | ||
onClick={[Function]} | ||
type="button" | ||
<li | ||
className="page-item" | ||
> | ||
<div> | ||
<span | ||
className="pgn__icon" | ||
> | ||
<svg | ||
aria-hidden={true} | ||
fill="none" | ||
focusable={false} | ||
height={24} | ||
role="img" | ||
viewBox="0 0 24 24" | ||
width={24} | ||
xmlns="http://www.w3.org/2000/svg" | ||
<button | ||
aria-label="Previous, Page 1" | ||
className="previous page-link btn btn-primary" | ||
disabled={false} | ||
onClick={[Function]} | ||
type="button" | ||
> | ||
<div> | ||
<span | ||
className="pgn__icon" | ||
> | ||
<path | ||
d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12l4.58-4.59z" | ||
fill="currentColor" | ||
/> | ||
</svg> | ||
</span> | ||
Previous | ||
</div> | ||
</button> | ||
</li> | ||
<li | ||
className="page-item" | ||
> | ||
<button | ||
aria-label="Next, Page 3" | ||
className="next page-link btn btn-primary" | ||
disabled={false} | ||
onClick={[Function]} | ||
type="button" | ||
<svg | ||
aria-hidden={true} | ||
fill="none" | ||
focusable={false} | ||
height={24} | ||
role="img" | ||
viewBox="0 0 24 24" | ||
width={24} | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12l4.58-4.59z" | ||
fill="currentColor" | ||
/> | ||
</svg> | ||
</span> | ||
Previous | ||
</div> | ||
</button> | ||
</li> | ||
<li | ||
className="page-item" | ||
> | ||
<div> | ||
Next | ||
<span | ||
className="pgn__icon" | ||
> | ||
<svg | ||
aria-hidden={true} | ||
fill="none" | ||
focusable={false} | ||
height={24} | ||
role="img" | ||
viewBox="0 0 24 24" | ||
width={24} | ||
xmlns="http://www.w3.org/2000/svg" | ||
<button | ||
aria-label="Next, Page 3" | ||
className="next page-link btn btn-primary" | ||
disabled={false} | ||
onClick={[Function]} | ||
type="button" | ||
> | ||
<div> | ||
Next | ||
<span | ||
className="pgn__icon" | ||
> | ||
<path | ||
d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z" | ||
fill="currentColor" | ||
/> | ||
</svg> | ||
</span> | ||
</div> | ||
</button> | ||
</li> | ||
</ul> | ||
</nav> | ||
</div> | ||
<svg | ||
aria-hidden={true} | ||
fill="none" | ||
focusable={false} | ||
height={24} | ||
role="img" | ||
viewBox="0 0 24 24" | ||
width={24} | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z" | ||
fill="currentColor" | ||
/> | ||
</svg> | ||
</span> | ||
</div> | ||
</button> | ||
</li> | ||
</ul> | ||
</nav> | ||
</div> | ||
</section> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
import ConnectedOrderHistoryPage from './OrderHistoryPage'; | ||
import OrderHistoryPage from './OrderHistoryPage'; | ||
import reducer from './reducer'; | ||
import saga from './saga'; | ||
import { storeName } from './selectors'; | ||
|
||
export { | ||
ConnectedOrderHistoryPage, | ||
reducer, | ||
saga, | ||
storeName, | ||
}; | ||
export default OrderHistoryPage; | ||
export { reducer, saga, storeName }; |
Oops, something went wrong.