mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: Add multiElement-edit finalize action to Desktop (currently only visible in Mobile view) (#4764)
* add finalize action to Desktop UI * Update LayerUI.tsx * add size to panel component * finzalize button style * add finalize button * changed isMobile to DeviceInfo, added isTouchScreen * cleanup * rename deviceInfo to deviceType * rename deviceInfo to deviceType * added updateObject * Update App.tsx
This commit is contained in:
parent
1cfb4dfd8b
commit
192debd829
17 changed files with 138 additions and 61 deletions
|
@ -4,7 +4,7 @@ import React, { useState, useLayoutEffect, useRef } from "react";
|
|||
import { createPortal } from "react-dom";
|
||||
import clsx from "clsx";
|
||||
import { KEYS } from "../keys";
|
||||
import { useExcalidrawContainer, useIsMobile } from "./App";
|
||||
import { useExcalidrawContainer, useDeviceType } from "./App";
|
||||
import { AppState } from "../types";
|
||||
import { THEME } from "../constants";
|
||||
|
||||
|
@ -59,17 +59,17 @@ export const Modal = (props: {
|
|||
const useBodyRoot = (theme: AppState["theme"]) => {
|
||||
const [div, setDiv] = useState<HTMLDivElement | null>(null);
|
||||
|
||||
const isMobile = useIsMobile();
|
||||
const isMobileRef = useRef(isMobile);
|
||||
isMobileRef.current = isMobile;
|
||||
const deviceType = useDeviceType();
|
||||
const isMobileRef = useRef(deviceType.isMobile);
|
||||
isMobileRef.current = deviceType.isMobile;
|
||||
|
||||
const { container: excalidrawContainer } = useExcalidrawContainer();
|
||||
|
||||
useLayoutEffect(() => {
|
||||
if (div) {
|
||||
div.classList.toggle("excalidraw--mobile", isMobile);
|
||||
div.classList.toggle("excalidraw--mobile", deviceType.isMobile);
|
||||
}
|
||||
}, [div, isMobile]);
|
||||
}, [div, deviceType.isMobile]);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
const isDarkTheme =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue