Show global notices in all pages

[MAILPOET-2390]
This commit is contained in:
Amine Ben hammou
2019-12-12 14:23:15 +01:00
committed by Jack Kitterhing
parent 3660271fad
commit 3fc48006c2
13 changed files with 56 additions and 19 deletions

View File

@@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react';
import ReactDOM from 'react-dom';
import MailPoet from 'mailpoet';
import { GlobalContext, useGlobalContextValue } from 'context/index.jsx';
import Notices from 'notices/notices.jsx';
const ExperimentalFeatures = () => {
const [flags, setFlags] = useState(null);
@@ -61,24 +62,27 @@ const ExperimentalFeatures = () => {
return (
<GlobalContext.Provider value={contextValue}>
{ Object.values(flags).map((flag) => {
const id = `experimental-feature-${flag.name}`;
return (
<div key={flag.name}>
<label htmlFor={id}>
<input
id={id}
type="checkbox"
name={flag.name}
defaultChecked={flag.value}
onChange={handleChange}
/>
{' '}
{flag.name}
</label>
</div>
);
})}
<>
<Notices />
{ Object.values(flags).map((flag) => {
const id = `experimental-feature-${flag.name}`;
return (
<div key={flag.name}>
<label htmlFor={id}>
<input
id={id}
type="checkbox"
name={flag.name}
defaultChecked={flag.value}
onChange={handleChange}
/>
{' '}
{flag.name}
</label>
</div>
);
})}
</>
</GlobalContext.Provider>
);
};