hide stats and scrollToContent-button when mobile menus open (#2509)
This commit is contained in:
parent
0efa62cf7c
commit
ae15380a9f
@ -154,7 +154,7 @@ export const MobileMenu = ({
|
|||||||
)}
|
)}
|
||||||
{actionManager.renderAction("deleteSelectedElements")}
|
{actionManager.renderAction("deleteSelectedElements")}
|
||||||
</div>
|
</div>
|
||||||
{appState.scrolledOutside && (
|
{appState.scrolledOutside && !appState.openMenu && (
|
||||||
<button
|
<button
|
||||||
className="scroll-back-to-content"
|
className="scroll-back-to-content"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
@ -6,6 +6,7 @@ import {
|
|||||||
getTotalStorageSize,
|
getTotalStorageSize,
|
||||||
} from "../excalidraw-app/data/localStorage";
|
} from "../excalidraw-app/data/localStorage";
|
||||||
import { t } from "../i18n";
|
import { t } from "../i18n";
|
||||||
|
import useIsMobile from "../is-mobile";
|
||||||
import { getTargetElements } from "../scene";
|
import { getTargetElements } from "../scene";
|
||||||
import { AppState } from "../types";
|
import { AppState } from "../types";
|
||||||
import { debounce, nFormatter } from "../utils";
|
import { debounce, nFormatter } from "../utils";
|
||||||
@ -27,6 +28,7 @@ export const Stats = (props: {
|
|||||||
elements: readonly NonDeletedExcalidrawElement[];
|
elements: readonly NonDeletedExcalidrawElement[];
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
}) => {
|
}) => {
|
||||||
|
const isMobile = useIsMobile();
|
||||||
const [storageSizes, setStorageSizes] = useState<StorageSizes>({
|
const [storageSizes, setStorageSizes] = useState<StorageSizes>({
|
||||||
scene: 0,
|
scene: 0,
|
||||||
total: 0,
|
total: 0,
|
||||||
@ -44,6 +46,10 @@ export const Stats = (props: {
|
|||||||
const selectedElements = getTargetElements(props.elements, props.appState);
|
const selectedElements = getTargetElements(props.elements, props.appState);
|
||||||
const selectedBoundingBox = getCommonBounds(selectedElements);
|
const selectedBoundingBox = getCommonBounds(selectedElements);
|
||||||
|
|
||||||
|
if (isMobile && props.appState.openMenu) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="Stats">
|
<div className="Stats">
|
||||||
<Island padding={2}>
|
<Island padding={2}>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user