From 19a8da8a3fdda75c3378156f62c54f4ec7f671d8 Mon Sep 17 00:00:00 2001 From: Johan Girod Date: Fri, 24 Apr 2020 16:05:29 +0200 Subject: [PATCH] :art: correction de styles pour les simulateurs - Corrige l'alignement des questions sur chrome (fix #967) - Corrige l'affichage de l'aide sur mobile (fix #992) --- .../components/Documentation/References.css | 3 ++- source/components/StackedBarChart.tsx | 2 +- source/components/TargetSelection.css | 4 ++-- source/components/conversation/AnswerList.tsx | 1 - source/components/conversation/DateInput.tsx | 12 +++++------ source/components/conversation/Input.js | 11 ++++------ .../conversation/InputSuggestions.tsx | 21 +++++++++++++------ .../components/conversation/conversation.css | 16 +++++++++----- source/locales/rules-en.yaml | 8 +++---- source/rules/salarié.yaml | 4 ++-- .../mon-entreprise.fr/pages/Coronavirus.tsx | 6 +++--- .../pages/Simulateurs/ArtisteAuteur.tsx | 2 +- 12 files changed, 50 insertions(+), 40 deletions(-) diff --git a/source/components/Documentation/References.css b/source/components/Documentation/References.css index 511940ab2..dcaaebc3d 100644 --- a/source/components/Documentation/References.css +++ b/source/components/Documentation/References.css @@ -4,6 +4,7 @@ } .references a { flex: 1; + min-width: 45%; text-decoration: underline; } @@ -18,7 +19,7 @@ font-style: italic; } .references .imageWrapper { - width: 6rem; + width: 4.5rem; height: 3rem; display: flex; align-items: center; diff --git a/source/components/StackedBarChart.tsx b/source/components/StackedBarChart.tsx index eb1bf3110..cee6f01a8 100644 --- a/source/components/StackedBarChart.tsx +++ b/source/components/StackedBarChart.tsx @@ -123,7 +123,7 @@ export function StackedBarChart({ data }: StackedBarChartProps) { {dataWithPercentage.map(({ key, percentage, color, legend }) => ( - {legend} + {legend} {percentage} % ))} diff --git a/source/components/TargetSelection.css b/source/components/TargetSelection.css index 2b7fde3c5..d9ff00859 100644 --- a/source/components/TargetSelection.css +++ b/source/components/TargetSelection.css @@ -69,7 +69,7 @@ text-decoration: underline; } -@media (min-width: 800px) { +@media (min-width: 660px) { #targetSelection { font-size: 115%; } @@ -132,7 +132,7 @@ } .light #targetSelection .optionTitle { - color: var(--darkestColor); + color: var(--darkColor); } #targetSelection .editableTarget { diff --git a/source/components/conversation/AnswerList.tsx b/source/components/conversation/AnswerList.tsx index 3ce6972d1..12dcae1a4 100644 --- a/source/components/conversation/AnswerList.tsx +++ b/source/components/conversation/AnswerList.tsx @@ -91,7 +91,6 @@ function StepsTable({ -
+
+
{ @@ -51,17 +51,15 @@ export default function DateInput({ }} onSecondClick={() => onSubmit?.('suggestion')} /> -
-
- {onSubmit && }
- + {onSubmit && } +
) } diff --git a/source/components/conversation/Input.js b/source/components/conversation/Input.js index 64a846358..2e268c480 100644 --- a/source/components/conversation/Input.js +++ b/source/components/conversation/Input.js @@ -26,7 +26,7 @@ export default function Input({ return (
-
+
{ @@ -35,9 +35,6 @@ export default function Input({ onSecondClick={() => onSubmit && onSubmit('suggestion')} unit={unit} /> -
- -
{serializeUnit(unit, value, language)} - {onSubmit && ( - - )}
+ {onSubmit && ( + + )}
) } diff --git a/source/components/conversation/InputSuggestions.tsx b/source/components/conversation/InputSuggestions.tsx index 75290bdcc..a90c036e8 100644 --- a/source/components/conversation/InputSuggestions.tsx +++ b/source/components/conversation/InputSuggestions.tsx @@ -11,19 +11,23 @@ type InputSuggestionsProps = { } export default function InputSuggestions({ - suggestions, + suggestions = {}, onSecondClick = x => x, onFirstClick, unit }: InputSuggestionsProps) { const [suggestion, setSuggestion] = useState() const { t } = useTranslation() - if (!suggestions) return null return ( -
- Suggestions : - +
{toPairs(suggestions).map(([text, value]: [string, number]) => { const valueWithUnit: string = `${value} ${ unit ? serializeUnit(unit)?.replace(' / ', '/') : '' @@ -32,7 +36,12 @@ export default function InputSuggestions({