mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: render unknown supplied children to UI (#6096)
This commit is contained in:
parent
699897f71b
commit
0982da38fe
3 changed files with 45 additions and 24 deletions
|
@ -15,11 +15,7 @@ import {
|
|||
BinaryFiles,
|
||||
UIChildrenComponents,
|
||||
} from "../types";
|
||||
import {
|
||||
isShallowEqual,
|
||||
muteFSAbortError,
|
||||
ReactChildrenToObject,
|
||||
} from "../utils";
|
||||
import { isShallowEqual, muteFSAbortError, getReactChildren } from "../utils";
|
||||
import { SelectedShapeActions, ShapesSwitcher } from "./Actions";
|
||||
import CollabButton from "./CollabButton";
|
||||
import { ErrorDialog } from "./ErrorDialog";
|
||||
|
@ -111,8 +107,11 @@ const LayerUI = ({
|
|||
}: LayerUIProps) => {
|
||||
const device = useDevice();
|
||||
|
||||
const childrenComponents =
|
||||
ReactChildrenToObject<UIChildrenComponents>(children);
|
||||
const [childrenComponents, restChildren] =
|
||||
getReactChildren<UIChildrenComponents>(children, {
|
||||
Menu: true,
|
||||
FooterCenter: true,
|
||||
});
|
||||
|
||||
const renderJSONExportDialog = () => {
|
||||
if (!UIOptions.canvasActions.export) {
|
||||
|
@ -390,6 +389,7 @@ const LayerUI = ({
|
|||
|
||||
return (
|
||||
<>
|
||||
{restChildren}
|
||||
{appState.isLoading && <LoadingMessage delay={250} />}
|
||||
{appState.errorMessage && (
|
||||
<ErrorDialog
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue