2022-08-22 16:09:24 +05:30
|
|
|
import clsx from "clsx";
|
2022-12-21 14:29:06 +05:30
|
|
|
import { ActionManager } from "../../actions/manager";
|
|
|
|
import { t } from "../../i18n";
|
2023-01-05 22:04:23 +05:30
|
|
|
import { AppState, UIChildrenComponents } 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";
|
|
|
|
import { WelcomeScreenHelpArrow } from "../icons";
|
|
|
|
import { Section } from "../Section";
|
|
|
|
import Stack from "../Stack";
|
|
|
|
import WelcomeScreenDecor from "../WelcomeScreenDecor";
|
2022-08-22 16:09:24 +05:30
|
|
|
|
|
|
|
const Footer = ({
|
|
|
|
appState,
|
|
|
|
actionManager,
|
|
|
|
showExitZenModeBtn,
|
2022-11-01 17:29:58 +01:00
|
|
|
renderWelcomeScreen,
|
2023-01-05 22:04:23 +05:30
|
|
|
footerCenter,
|
2022-08-22 16:09:24 +05:30
|
|
|
}: {
|
|
|
|
appState: AppState;
|
|
|
|
actionManager: ActionManager;
|
|
|
|
showExitZenModeBtn: boolean;
|
2022-11-01 17:29:58 +01:00
|
|
|
renderWelcomeScreen: boolean;
|
2023-01-05 22:04:23 +05:30
|
|
|
footerCenter: UIChildrenComponents["FooterCenter"];
|
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-05 22:04:23 +05:30
|
|
|
{footerCenter}
|
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" }}>
|
|
|
|
<WelcomeScreenDecor
|
|
|
|
shouldRender={renderWelcomeScreen && !appState.isLoading}
|
|
|
|
>
|
|
|
|
<div className="virgil WelcomeScreen-decor WelcomeScreen-decor--help-pointer">
|
|
|
|
<div>{t("welcomeScreen.helpHints")}</div>
|
|
|
|
{WelcomeScreenHelpArrow}
|
|
|
|
</div>
|
|
|
|
</WelcomeScreenDecor>
|
|
|
|
|
|
|
|
{actionManager.renderAction("toggleShortcuts")}
|
|
|
|
</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";
|