-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement subscription page using paragon components
- Loading branch information
Showing
17 changed files
with
456 additions
and
153 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
39 changes: 14 additions & 25 deletions
39
src/components/subscriptions/MultipleSubscriptionPicker.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 |
---|---|---|
@@ -1,57 +1,46 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { | ||
CardGrid, | ||
Row, | ||
Col, | ||
} from '@edx/paragon'; | ||
|
||
import SubscriptionCard from './SubscriptionCard'; | ||
import { DEFAULT_LEAD_TEXT } from './data/constants'; | ||
import { ROUTE_NAMES } from '../EnterpriseApp/constants'; | ||
|
||
const MultipleSubscriptionsPicker = ({ | ||
enterpriseSlug, leadText, buttonText, redirectPage, subscriptions, | ||
leadText, subscriptions, createActions, | ||
}) => ( | ||
<> | ||
<Row> | ||
<Col> | ||
<h2>Cohorts</h2> | ||
<Col xs="12"> | ||
<h2>Plans</h2> | ||
<p className="lead"> | ||
{leadText} | ||
</p> | ||
</Col> | ||
<Col lg="10"> | ||
{subscriptions.map(subscription => ( | ||
<SubscriptionCard | ||
key={subscription.uuid} | ||
subscription={subscription} | ||
createActions={createActions} | ||
/> | ||
))} | ||
</Col> | ||
</Row> | ||
<CardGrid> | ||
{subscriptions.map(subscription => ( | ||
<SubscriptionCard | ||
key={subscription?.uuid} | ||
uuid={subscription?.uuid} | ||
title={subscription?.title} | ||
enterpriseSlug={enterpriseSlug} | ||
startDate={subscription?.startDate} | ||
expirationDate={subscription?.expirationDate} | ||
licenses={subscription?.licenses || {}} | ||
redirectPage={redirectPage} | ||
buttonText={buttonText} | ||
/> | ||
))} | ||
</CardGrid> | ||
</> | ||
); | ||
|
||
MultipleSubscriptionsPicker.defaultProps = { | ||
redirectPage: ROUTE_NAMES.subscriptionManagement, | ||
leadText: DEFAULT_LEAD_TEXT, | ||
buttonText: null, | ||
createActions: null, | ||
}; | ||
|
||
MultipleSubscriptionsPicker.propTypes = { | ||
buttonText: PropTypes.string, | ||
enterpriseSlug: PropTypes.string.isRequired, | ||
leadText: PropTypes.string, | ||
redirectPage: PropTypes.string, | ||
subscriptions: PropTypes.arrayOf(PropTypes.shape()).isRequired, | ||
createActions: PropTypes.func, | ||
}; | ||
|
||
export default MultipleSubscriptionsPicker; |
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
Oops, something went wrong.