Moved infobox to modal

This commit is contained in:
ari committed 2022-07-15 22:53:51 -04:00
1 parent 1719148c58
commit 0e4e4783fa
16 files changed
+222 -182

No files matched your search

@@ -1,10 +1,7 @@
.dag-graphboard {
min-height: 100%;
min-width: 100%;
}
.dag-graphboard.loading {
position: relative;
min-height: 100%;
min-width: 100%;
}
.dag-graphboard.loading span {
@@ -22,6 +22,7 @@ export const DAGGraphBoardInner: FC<DAGGraphBoardProps> = ({
modalState,
state,
closeModal,
additionalControls,
}) => {
// render unready or errored states
if (!state.ready) {
@@ -69,7 +70,9 @@ export const DAGGraphBoardInner: FC<DAGGraphBoardProps> = ({
nodesDraggable={false}
{...elements}
>
<Controls showInteractive={false} showFitView />
<Controls showInteractive={false} showFitView>
{additionalControls}
</Controls>
</ReactFlow>
</>
);
@@ -21,6 +21,7 @@ export type DAGGraphBoardProps = {
state: DAGGraphBoardState;
modalState?: ModalState;
closeModal: () => void;
additionalControls?: ReactNode;
};
export type ModalState<
+4 -1
View File
@@ -1,4 +1,4 @@
import { FC, useState } from "react";
import { FC, useState, ReactNode } from "react";
import { AutomationSequenceNode } from "types/automations";
import { useHA } from "haService";
import { ModalState } from "./board/types";
@@ -17,7 +17,9 @@ export const DAGAutomationGraph: FC<{
onTriggerUpdate: (t: AutomationTrigger[]) => void;
onConditionUpdate: (c: AutomationCondition[]) => void;
isFlipped: boolean;
additionalControls?: ReactNode;
}> = (props) => {
console.log({ props });
const { namer } = useHA();
const [modalState, setModalState] =
useState<ModalState | undefined>(undefined);
@@ -62,6 +64,7 @@ export const DAGAutomationGraph: FC<{
elements: elementData,
},
}}
additionalControls={props.additionalControls}
/>
);
};