* upgrade paragon * mmp2p experiment code * mmp2p courseware triggers * mmp2p course-home triggers * mmp2p load styles * mmp2p - add missed locator docstrings * mmp2p test fixes * add lazy loading for image-bearing components * mmp2p experiment README * mmp2p add lazy loading for sidecard * generalize prices for currency options * mmp2p fix flyover mobile args * mmp2p fix lock paywall border display * mmp2 - add safety-rail around verifiedmode access
46 lines
1.0 KiB
JavaScript
46 lines
1.0 KiB
JavaScript
import React, { Suspense } from 'react';
|
|
import PropTypes from 'prop-types';
|
|
|
|
import PageLoading from '../../generic/PageLoading';
|
|
|
|
const LockPaywallContent = React.lazy(() => import('./LockPaywallContent'));
|
|
|
|
const LockPaywall = ({ options }) => {
|
|
if (!(options.meta.gradedLock || options.meta.verifiedLock)) {
|
|
return null;
|
|
}
|
|
return (
|
|
<Suspense
|
|
fallback={(<PageLoading srMessage="Loading locked content messaging..." />)}
|
|
>
|
|
<LockPaywallContent options={options} />
|
|
</Suspense>
|
|
);
|
|
};
|
|
LockPaywall.propTypes = {
|
|
options: PropTypes.shape({
|
|
access: PropTypes.shape({
|
|
upgradeUrl: PropTypes.string.isRequired,
|
|
price: PropTypes.string.isRequired,
|
|
}),
|
|
meta: PropTypes.shape({
|
|
gradedLock: PropTypes.bool.isRequired,
|
|
verifiedLock: PropTypes.bool.isRequired,
|
|
}),
|
|
}),
|
|
};
|
|
|
|
LockPaywall.defaultProps = {
|
|
options: {
|
|
access: {
|
|
upgradeUrl: '',
|
|
price: '$23',
|
|
},
|
|
meta: {
|
|
gradedLock: false,
|
|
verifiedLock: false,
|
|
},
|
|
},
|
|
};
|
|
export default LockPaywall;
|