Skip to content

Commit

Permalink
fix(Flow): missing useFlowContext export added
Browse files Browse the repository at this point in the history
  • Loading branch information
MEsteves22 authored and zettca committed Oct 18, 2023
1 parent 7507556 commit e315bc2
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/lab/src/components/Flow/DroppableFlow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { ExtractNames, useUniqueId } from "@hitachivantara/uikit-react-core";

import { HvFlowNodeTypes } from "./types";
import { staticClasses, useClasses } from "./Flow.styles";
import { useFlowContext } from "./FlowContext";
import { useFlowContext } from "./hooks";
import { flowStyles } from "./base";

export { staticClasses as flowClasses };
Expand Down
3 changes: 0 additions & 3 deletions packages/lab/src/components/Flow/FlowContext/FlowContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
Dispatch,
SetStateAction,
createContext,
useContext,
useMemo,
useState,
} from "react";
Expand Down Expand Up @@ -62,5 +61,3 @@ export const HvFlowProvider = ({
<HvFlowContext.Provider value={value}>{children}</HvFlowContext.Provider>
);
};

export const useFlowContext = () => useContext(HvFlowContext);
2 changes: 1 addition & 1 deletion packages/lab/src/components/Flow/Node/Node.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
import { Down, Info, Up } from "@hitachivantara/uikit-react-icons";
import { getColor, theme } from "@hitachivantara/uikit-styles";

import { useFlowContext } from "../FlowContext/FlowContext";
import { useFlowContext } from "../hooks";
import { HvFlowDefaultAction, HvFlowNodeParam } from "../types";
import { staticClasses, useClasses } from "./Node.styles";
import ParamRenderer from "./Parameters/ParamRenderer";
Expand Down
2 changes: 1 addition & 1 deletion packages/lab/src/components/Flow/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { Add } from "@hitachivantara/uikit-react-icons";

import { staticClasses, useClasses } from "./Sidebar.styles";
import { HvFlowSidebarGroup } from "./SidebarGroup";
import { useFlowContext } from "../FlowContext";
import { useFlowContext } from "../hooks";
import { buildGroups } from "./utils";
import { HvFlowSidebarGroupItem } from "./SidebarGroup/SidebarGroupItem";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
HvFlowDraggableSidebarGroupItem,
HvFlowDraggableSidebarGroupItemProps,
} from "./SidebarGroupItem";
import { useFlowContext } from "../../FlowContext";
import { useFlowContext } from "../../hooks";

export { staticClasses as flowSidebarGroupClasses };

Expand Down
1 change: 1 addition & 0 deletions packages/lab/src/components/Flow/hooks/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from "./useFlowNode";
export * from "./useFlowContext";
5 changes: 5 additions & 0 deletions packages/lab/src/components/Flow/hooks/useFlowContext.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { useContext } from "react";

import { HvFlowContext } from "../FlowContext";

export const useFlowContext = () => useContext(HvFlowContext);

0 comments on commit e315bc2

Please sign in to comment.