feat: render unknown supplied children to UI (#6096)
This commit is contained in:
src
@ -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
|
||||
|
Reference in New Issue
Block a user