diff --git a/source/components/Controls.css b/source/components/Controls.css index 554a23c36..b1fd17506 100644 --- a/source/components/Controls.css +++ b/source/components/Controls.css @@ -16,7 +16,7 @@ font-size: 90%; } -p#controlExplanation { +#controlExplanation { margin: 0.3em 0 0.6em; display: flex; justify-content: center; diff --git a/source/components/Controls.js b/source/components/Controls.js index c9a42acd1..b2c5a0016 100644 --- a/source/components/Controls.js +++ b/source/components/Controls.js @@ -7,54 +7,52 @@ import { animated, Spring } from 'react-spring' import { makeJsx } from 'Engine/evaluation' function Controls({ blockingInputControls, controls, startConversation }) { + let control = !blockingInputControls && controls?.[0] return (
{blockingInputControls && (

{blockingInputControls[0].message}

)} - {!blockingInputControls && ( - - {styles => - controls?.length ? ( - -
- {do { - let { level, solution, evaluated } = controls[0] - ;<> -

- {level === 'avertissement' - ? 'Attention' - : 'Information'} -

-

{makeJsx(evaluated)}

- {solution && ( -
- {emoji('💡')} - -
- )} - - }} -
-
- ) : null - } -
- )} + + {styles => + !control ? null : ( + +
+ {do { + let { level, solution, evaluated } = control + ;<> +

+ {level === 'avertissement' ? 'Attention' : 'Information'} +

+
{makeJsx(evaluated)}
+ {solution && ( +
+ {emoji('💡')} + +
+ )} + + }} +
+
+ ) + } +
) }