diff --git a/frontend/react/src/ui/modals/trainingmodal.tsx b/frontend/react/src/ui/modals/trainingmodal.tsx index ef55de5f..2cfe79c1 100644 --- a/frontend/react/src/ui/modals/trainingmodal.tsx +++ b/frontend/react/src/ui/modals/trainingmodal.tsx @@ -19,7 +19,7 @@ export function TrainingModal(props: { open: boolean }) { <> {step === 0 && ( -
+
{step === 1 && ( -
+
{step === 2 && ( -
+
{step === 3 && ( -
+
{step === 4 && ( -
+
{step === 5 && ( -
+
{step === 6 && ( -
+
{step === 7 && ( -
+
{step === 8 && ( -
+
{step === 9 && ( -
+
{step === 10 && ( -
+

The unit marker (2 of 2)

The unit marker has a symbol showing the unit state, i.e. what instruction it is performing. These are all the possible values:

-
+

@@ -475,7 +475,7 @@ export function TrainingModal(props: { open: boolean }) { )} {step > 0 && ( -

+
{[...Array(MAX_STEPS).keys()].map((i) => (
void; showBackButton?: boolean; children?: JSX.Element | JSX.Element[]; + autohide?: boolean; wiki?: () => JSX.Element | JSX.Element[]; }) { const [hide, setHide] = useState(true); const [wiki, setWiki] = useState(false); - if (!props.open && hide) setHide(false); - useEffect(() => { - if (window.innerWidth > 640) setHide(false); + if (props.autohide) { + if (window.innerWidth > 640) setHide(false); + if (!props.open) setHide(true); + } else { + setHide(false); + } }, [props.open]); return ( @@ -108,12 +112,16 @@ export function Menu(props: { `} /> -
+
{props.wiki ? props.wiki() :
Work in progress
} @@ -121,7 +129,6 @@ export function Menu(props: {
diff --git a/frontend/react/src/ui/panels/unitcontrolmenu.tsx b/frontend/react/src/ui/panels/unitcontrolmenu.tsx index 6e662acb..0ee452ea 100644 --- a/frontend/react/src/ui/panels/unitcontrolmenu.tsx +++ b/frontend/react/src/ui/panels/unitcontrolmenu.tsx @@ -295,6 +295,7 @@ export function UnitControlMenu(props: { open: boolean; onClose: () => void }) { open={props.open} title={selectedUnits.length > 0 ? `Units selected (x${selectedUnits.length})` : `No units selected`} onClose={props.onClose} + autohide={true} wiki={() => { return (