Use GlobalContext instead of FeaturesContext

[MAILPOET-2388]
This commit is contained in:
Amine Ben hammou
2019-09-27 17:10:22 +01:00
committed by Jack Kitterhing
parent a5c5e99383
commit e39d56a826

View File

@@ -1,10 +1,10 @@
import React from 'react';
import PropTypes from 'prop-types';
import { GlobalContext } from 'context';
import MSSUserSuccess from './success_for_mss_users.jsx';
import PitchMss from './success_pitch_mss.jsx';
import FeaturesContext from '../../../features/context.jsx';
function SuccessContent(props) {
if (!window.has_mss_key_specified && props.isSupported('display-mss-pitch')) {
@@ -28,15 +28,12 @@ function SuccessContent(props) {
}
function Success(props) {
const { features } = React.useContext(GlobalContext);
return (
<FeaturesContext.Consumer>
{(FeaturesController) => (
<SuccessContent
{...props}
isSupported={FeaturesController.isSupported}
/>
)}
</FeaturesContext.Consumer>
<SuccessContent
{...props}
isSupported={features.isSupported}
/>
);
}