Use GlobalContext instead of FeaturesContext
[MAILPOET-2388]
This commit is contained in:
committed by
Jack Kitterhing
parent
a5c5e99383
commit
e39d56a826
@@ -1,10 +1,10 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
|
import { GlobalContext } from 'context';
|
||||||
import MSSUserSuccess from './success_for_mss_users.jsx';
|
import MSSUserSuccess from './success_for_mss_users.jsx';
|
||||||
import PitchMss from './success_pitch_mss.jsx';
|
import PitchMss from './success_pitch_mss.jsx';
|
||||||
|
|
||||||
import FeaturesContext from '../../../features/context.jsx';
|
|
||||||
|
|
||||||
function SuccessContent(props) {
|
function SuccessContent(props) {
|
||||||
if (!window.has_mss_key_specified && props.isSupported('display-mss-pitch')) {
|
if (!window.has_mss_key_specified && props.isSupported('display-mss-pitch')) {
|
||||||
@@ -28,15 +28,12 @@ function SuccessContent(props) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Success(props) {
|
function Success(props) {
|
||||||
|
const { features } = React.useContext(GlobalContext);
|
||||||
return (
|
return (
|
||||||
<FeaturesContext.Consumer>
|
|
||||||
{(FeaturesController) => (
|
|
||||||
<SuccessContent
|
<SuccessContent
|
||||||
{...props}
|
{...props}
|
||||||
isSupported={FeaturesController.isSupported}
|
isSupported={features.isSupported}
|
||||||
/>
|
/>
|
||||||
)}
|
|
||||||
</FeaturesContext.Consumer>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user