From 893607eb621044efa586a6121288a80cd5740fde Mon Sep 17 00:00:00 2001 From: Johan Girod Date: Wed, 20 Apr 2022 16:28:16 +0200 Subject: [PATCH] =?UTF-8?q?Quelques=20am=C3=A9liorations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Simulation/SimulationGoal.tsx | 1 + .../components/conversation/Conversation.tsx | 5 +- .../components/conversation/RuleInput.tsx | 5 +- site/source/components/ui/WarningBlock.tsx | 69 ++++++++++--------- site/source/design-system/global-style.ts | 2 +- 5 files changed, 45 insertions(+), 37 deletions(-) diff --git a/site/source/components/Simulation/SimulationGoal.tsx b/site/source/components/Simulation/SimulationGoal.tsx index 864d6d118..c8abbd585 100644 --- a/site/source/components/Simulation/SimulationGoal.tsx +++ b/site/source/components/Simulation/SimulationGoal.tsx @@ -113,6 +113,7 @@ export function SimulationGoal({ onFocus={() => setFocused(true)} onBlur={() => setFocused(false)} onChange={onChange} + missing={dottedName in evaluation.missingVariables} small={small} formatOptions={{ maximumFractionDigits: 0, diff --git a/site/source/components/conversation/Conversation.tsx b/site/source/components/conversation/Conversation.tsx index 8deee2c7a..9f74dfea6 100644 --- a/site/source/components/conversation/Conversation.tsx +++ b/site/source/components/conversation/Conversation.tsx @@ -20,6 +20,7 @@ import React, { useContext, useEffect } from 'react' import { Trans } from 'react-i18next' import { useDispatch, useSelector } from 'react-redux' import { TrackPage } from '../../ATInternetTracking' +import { FromTop } from '../ui/animate' import AnswerList from './AnswerList' import { ExplicableRule } from './Explicable' import SeeAnswersButton from './SeeAnswersButton' @@ -66,7 +67,7 @@ export default function Conversation({
{currentQuestion ? ( - <> + {Object.keys(situation).length !== 0 && ( )} @@ -134,7 +135,7 @@ export default function Conversation({ - + ) : (
diff --git a/site/source/components/conversation/RuleInput.tsx b/site/source/components/conversation/RuleInput.tsx index 0a5e913b9..369fffc70 100644 --- a/site/source/components/conversation/RuleInput.tsx +++ b/site/source/components/conversation/RuleInput.tsx @@ -72,6 +72,7 @@ export default function RuleInput({ showSuggestions = true, onSubmit = () => null, showDefaultDateValue = false, + missing, modifiers = {}, ...props }: Props) { @@ -82,7 +83,9 @@ export default function RuleInput({ const commonProps: InputProps = { dottedName, value, - missing: !showDefaultDateValue && !isEmpty(evaluation.missingVariables), + missing: + missing ?? + (!showDefaultDateValue && !isEmpty(evaluation.missingVariables)), onChange: (value: PublicodesExpression | undefined) => onChange(value, dottedName), title: rule.title, diff --git a/site/source/components/ui/WarningBlock.tsx b/site/source/components/ui/WarningBlock.tsx index aba7f912b..091d3015c 100644 --- a/site/source/components/ui/WarningBlock.tsx +++ b/site/source/components/ui/WarningBlock.tsx @@ -6,7 +6,7 @@ import { Link } from '@/design-system/typography/link' import { Intro } from '@/design-system/typography/paragraphs' import { ReactNode } from 'react' import { Trans } from 'react-i18next' -import { Appear } from './animate' +import { FromTop } from './animate' type WarningProps = { localStorageKey: string @@ -19,40 +19,43 @@ export default function Warning({ localStorageKey, children }: WarningProps) { return ( <> - - - Avant de commencer... - {' '} - {folded && ( - fold(false)} - aria-expanded={false} - aria-controls="warning-text" - > - - Lire les précisions - - - )} - - {!folded && ( - -
{children}
-
- - -
-
- )} + + Lire les précisions + + + )} + + {!folded && ( + +
{children}
+
+ + +
+
+ )} +
+
{children}
diff --git a/site/source/design-system/global-style.ts b/site/source/design-system/global-style.ts index af2f967db..9cb4eb08c 100644 --- a/site/source/design-system/global-style.ts +++ b/site/source/design-system/global-style.ts @@ -145,7 +145,7 @@ button:enabled { } @media print { .print-only { - display: block; + display: initial; } }