From 73f0d854bf9deed021cec448d1769a45c7637b83 Mon Sep 17 00:00:00 2001 From: zsviczian Date: Fri, 11 Mar 2022 13:34:42 +0100 Subject: [PATCH] Update MobileMenu.tsx --- src/components/MobileMenu.tsx | 143 +++++++++++++++------------------- 1 file changed, 63 insertions(+), 80 deletions(-) diff --git a/src/components/MobileMenu.tsx b/src/components/MobileMenu.tsx index 8821fd172..6a2d7b1ac 100644 --- a/src/components/MobileMenu.tsx +++ b/src/components/MobileMenu.tsx @@ -1,10 +1,9 @@ -import clsx from "clsx"; import React from "react"; import { AppState } from "../types"; import { ActionManager } from "../actions/manager"; import { t } from "../i18n"; import Stack from "./Stack"; -import { isTextElement, showSelectedShapeActions } from "../element"; +import { showSelectedShapeActions } from "../element"; import { NonDeletedExcalidrawElement } from "../element/types"; import { FixedSideContainer } from "./FixedSideContainer"; import { Island } from "./Island"; @@ -172,86 +171,70 @@ export const MobileMenu = ({ <> {!viewModeEnabled && renderToolbar()}
-
- - {appState.openMenu === "canvas" ? ( -
-
- - {renderCanvasActions()} - {renderCustomFooter?.(true, appState)} - {appState.collaborators.size > 0 && ( -
- {t("labels.collaborators")} - - {Array.from(appState.collaborators) - // Collaborator is either not initialized or is actually the current user. - .filter( - ([_, client]) => Object.keys(client).length !== 0, - ) - .map(([clientId, client]) => ( - - {actionManager.renderAction( - "goToCollaborator", - { - id: clientId, - }, - )} - - ))} - -
- )} -
-
-
- ) : appState.openMenu === "shape" && - !viewModeEnabled && - showSelectedShapeActions(appState, elements) ? ( -
+ {appState.openMenu === "canvas" ? ( +
+
+ + {renderCanvasActions()} + {renderCustomFooter?.(true, appState)} + {appState.collaborators.size > 0 && ( +
+ {t("labels.collaborators")} + + {Array.from(appState.collaborators) + // Collaborator is either not initialized or is actually the current user. + .filter( + ([_, client]) => Object.keys(client).length !== 0, + ) + .map(([clientId, client]) => ( + + {actionManager.renderAction("goToCollaborator", { + id: clientId, + })} + + ))} + +
+ )} +
+
+
+ ) : appState.openMenu === "shape" && + !viewModeEnabled && + showSelectedShapeActions(appState, elements) ? ( +
+ +
+ ) : null} +
+ {renderAppToolbar()} + {appState.scrolledOutside && !appState.openMenu && ( +
- ) : null} - -
-
+ {t("buttons.scrollBackToContent")} + + )} + +
);