2022-08-22 16:09:24 +05:30
|
|
|
import clsx from "clsx";
|
2023-01-06 14:32:55 +01:00
|
|
|
import { actionShortcuts } from "../../actions";
|
2022-12-21 14:29:06 +05:30
|
|
|
import { ActionManager } from "../../actions/manager";
|
2023-01-31 13:53:20 +01:00
|
|
|
import { AppState } from "../../types";
|
2022-08-22 16:09:24 +05:30
|
|
|
import {
|
|
|
|
ExitZenModeAction,
|
|
|
|
FinalizeAction,
|
|
|
|
UndoRedoActions,
|
|
|
|
ZoomActions,
|
2022-12-21 14:29:06 +05:30
|
|
|
} from "../Actions";
|
|
|
|
import { useDevice } from "../App";
|
2023-02-01 06:16:17 +01:00
|
|
|
import { useTunnels } from "../context/tunnels";
|
2023-01-06 14:32:55 +01:00
|
|
|
import { HelpButton } from "../HelpButton";
|
2022-12-21 14:29:06 +05:30
|
|
|
import { Section } from "../Section";
|
|
|
|
import Stack from "../Stack";
|
2022-08-22 16:09:24 +05:30
|
|
|
|
|
|
|
const Footer = ({
|
|
|
|
appState,
|
|
|
|
actionManager,
|
|
|
|
showExitZenModeBtn,
|
2023-01-31 13:53:20 +01:00
|
|
|
renderWelcomeScreen,
|
2022-08-22 16:09:24 +05:30
|
|
|
}: {
|
|
|
|
appState: AppState;
|
|
|
|
actionManager: ActionManager;
|
|
|
|
showExitZenModeBtn: boolean;
|
2023-01-31 13:53:20 +01:00
|
|
|
renderWelcomeScreen: boolean;
|
2022-08-22 16:09:24 +05:30
|
|
|
}) => {
|
2023-02-01 06:16:17 +01:00
|
|
|
const { footerCenterTunnel, welcomeScreenHelpHintTunnel } = useTunnels();
|
|
|
|
|
2022-08-22 16:09:24 +05:30
|
|
|
const device = useDevice();
|
|
|
|
const showFinalize =
|
|
|
|
!appState.viewModeEnabled && appState.multiElement && device.isTouchScreen;
|
2022-12-21 14:29:06 +05:30
|
|
|
|
2022-08-22 16:09:24 +05:30
|
|
|
return (
|
|
|
|
<footer
|
|
|
|
role="contentinfo"
|
|
|
|
className="layer-ui__wrapper__footer App-menu App-menu_bottom"
|
|
|
|
>
|
|
|
|
<div
|
|
|
|
className={clsx("layer-ui__wrapper__footer-left zen-mode-transition", {
|
|
|
|
"layer-ui__wrapper__footer-left--transition-left":
|
|
|
|
appState.zenModeEnabled,
|
|
|
|
})}
|
|
|
|
>
|
|
|
|
<Stack.Col gap={2}>
|
|
|
|
<Section heading="canvasActions">
|
2022-11-01 17:29:58 +01:00
|
|
|
<ZoomActions
|
|
|
|
renderAction={actionManager.renderAction}
|
|
|
|
zoom={appState.zoom}
|
|
|
|
/>
|
|
|
|
|
|
|
|
{!appState.viewModeEnabled && (
|
|
|
|
<UndoRedoActions
|
2022-08-22 16:09:24 +05:30
|
|
|
renderAction={actionManager.renderAction}
|
2022-11-01 17:29:58 +01:00
|
|
|
className={clsx("zen-mode-transition", {
|
|
|
|
"layer-ui__wrapper__footer-left--transition-bottom":
|
|
|
|
appState.zenModeEnabled,
|
|
|
|
})}
|
2022-08-22 16:09:24 +05:30
|
|
|
/>
|
|
|
|
)}
|
|
|
|
{showFinalize && (
|
|
|
|
<FinalizeAction
|
|
|
|
renderAction={actionManager.renderAction}
|
|
|
|
className={clsx("zen-mode-transition", {
|
|
|
|
"layer-ui__wrapper__footer-left--transition-left":
|
|
|
|
appState.zenModeEnabled,
|
|
|
|
})}
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
</Section>
|
|
|
|
</Stack.Col>
|
|
|
|
</div>
|
2023-01-31 13:53:20 +01:00
|
|
|
<footerCenterTunnel.Out />
|
2022-08-27 23:02:17 +02:00
|
|
|
<div
|
|
|
|
className={clsx("layer-ui__wrapper__footer-right zen-mode-transition", {
|
|
|
|
"transition-right disable-pointerEvents": appState.zenModeEnabled,
|
|
|
|
})}
|
|
|
|
>
|
2022-11-01 17:29:58 +01:00
|
|
|
<div style={{ position: "relative" }}>
|
2023-01-31 13:53:20 +01:00
|
|
|
{renderWelcomeScreen && <welcomeScreenHelpHintTunnel.Out />}
|
2023-01-06 14:32:55 +01:00
|
|
|
<HelpButton
|
|
|
|
onClick={() => actionManager.executeAction(actionShortcuts)}
|
|
|
|
/>
|
2022-11-01 17:29:58 +01:00
|
|
|
</div>
|
2022-08-27 23:02:17 +02:00
|
|
|
</div>
|
2022-08-22 16:09:24 +05:30
|
|
|
<ExitZenModeAction
|
2022-09-09 13:53:38 +02:00
|
|
|
actionManager={actionManager}
|
2022-08-22 16:09:24 +05:30
|
|
|
showExitZenModeBtn={showExitZenModeBtn}
|
|
|
|
/>
|
|
|
|
</footer>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Footer;
|
2022-12-21 14:29:06 +05:30
|
|
|
Footer.displayName = "Footer";
|