diff --git a/source/components/rule/Header.css b/source/components/rule/Header.css index a15c820c8..4ceef28dc 100644 --- a/source/components/rule/Header.css +++ b/source/components/rule/Header.css @@ -51,3 +51,10 @@ #rule pre { padding: 1em 2em; } + +#ruleHeader #PeriodSwitch { + margin: 0.3em 1em; +} +#ruleHeader #PeriodSwitch img { + display: none; +} diff --git a/source/components/rule/Header.js b/source/components/rule/Header.js index df29016a5..e386f68af 100644 --- a/source/components/rule/Header.js +++ b/source/components/rule/Header.js @@ -8,6 +8,7 @@ import { capitalise0 } from '../../utils' import Destinataire from './Destinataire' import './Header.css' import Namespace from './Namespace' +import PeriodSwitch from 'Components/PeriodSwitch' let RuleHeader = withColours( ({ @@ -20,7 +21,8 @@ let RuleHeader = withColours( name, title, icon, - colours + colours, + valuesToShow }) => (
@@ -45,19 +47,26 @@ let RuleHeader = withColours( {capitalise0(type)} )} - {flatRule['période'] && ( -
-

{emoji('⏱️')} Période :

-
- - {flatRule['période']} - + {do { + let period = flatRule['période'] + period && ( +
+

Période :

+ {valuesToShow && period === 'flexible' ? ( + + ) : ( +
+ + {period} + +
+ )}
-
- )} + ) + }}
diff --git a/source/components/rule/Rule.js b/source/components/rule/Rule.js index 0d1228606..6a7e59c4f 100644 --- a/source/components/rule/Rule.js +++ b/source/components/rule/Rule.js @@ -87,7 +87,8 @@ export default compose( flatRules, name, title, - icon + icon, + valuesToShow }} />