changed sideBarDraggableComponent to forwardRef
This commit is contained in:
parent
7d04a98f68
commit
bacab7dbc1
1 changed files with 128 additions and 124 deletions
|
|
@ -1,12 +1,12 @@
|
||||||
import { DragEventHandler, useContext, useRef, useState } from "react";
|
import { DragEventHandler, forwardRef, useRef, useState } from "react";
|
||||||
import IconComponent from "../../../../../components/genericIconComponent";
|
import IconComponent from "../../../../../components/genericIconComponent";
|
||||||
import {
|
import {
|
||||||
Select,
|
Select,
|
||||||
SelectContent,
|
SelectContent,
|
||||||
SelectItem,
|
SelectItem,
|
||||||
SelectTrigger,
|
|
||||||
} from "../../../../../components/ui/select-custom";
|
} from "../../../../../components/ui/select-custom";
|
||||||
import { AuthContext } from "../../../../../contexts/authContext";
|
import { useDarkStore } from "../../../../../stores/darkStore";
|
||||||
|
import useFlowsManagerStore from "../../../../../stores/flowsManagerStore";
|
||||||
import { APIClassType } from "../../../../../types/api";
|
import { APIClassType } from "../../../../../types/api";
|
||||||
import {
|
import {
|
||||||
createFlowComponent,
|
createFlowComponent,
|
||||||
|
|
@ -14,10 +14,10 @@ import {
|
||||||
getNodeId,
|
getNodeId,
|
||||||
} from "../../../../../utils/reactflowUtils";
|
} from "../../../../../utils/reactflowUtils";
|
||||||
import { removeCountFromString } from "../../../../../utils/utils";
|
import { removeCountFromString } from "../../../../../utils/utils";
|
||||||
import { useDarkStore } from "../../../../../stores/darkStore";
|
|
||||||
import useFlowsManagerStore from "../../../../../stores/flowsManagerStore";
|
|
||||||
|
|
||||||
export default function SidebarDraggableComponent({
|
export const SidebarDraggableComponent = forwardRef(
|
||||||
|
(
|
||||||
|
{
|
||||||
sectionName,
|
sectionName,
|
||||||
display_name,
|
display_name,
|
||||||
itemName,
|
itemName,
|
||||||
|
|
@ -35,7 +35,9 @@ export default function SidebarDraggableComponent({
|
||||||
color: string;
|
color: string;
|
||||||
onDragStart: DragEventHandler<HTMLDivElement>;
|
onDragStart: DragEventHandler<HTMLDivElement>;
|
||||||
official: boolean;
|
official: boolean;
|
||||||
}) {
|
},
|
||||||
|
ref
|
||||||
|
) => {
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
const deleteComponent = useFlowsManagerStore(
|
const deleteComponent = useFlowsManagerStore(
|
||||||
(state) => state.deleteComponent
|
(state) => state.deleteComponent
|
||||||
|
|
@ -115,7 +117,6 @@ export default function SidebarDraggableComponent({
|
||||||
name="Menu"
|
name="Menu"
|
||||||
className="side-bar-components-icon "
|
className="side-bar-components-icon "
|
||||||
/>
|
/>
|
||||||
<SelectTrigger></SelectTrigger>
|
|
||||||
<SelectContent
|
<SelectContent
|
||||||
position="popper"
|
position="popper"
|
||||||
side="bottom"
|
side="bottom"
|
||||||
|
|
@ -154,3 +155,6 @@ export default function SidebarDraggableComponent({
|
||||||
</Select>
|
</Select>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
export default SidebarDraggableComponent;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue