Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change network #328

Closed
wants to merge 15 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
create context for network modal
tyirenkyi committed Feb 17, 2022
commit fad6caf16e507ce64a23d2378413b7357cd5eaf1
12 changes: 12 additions & 0 deletions packages/ui/react-ui/src/useNetworkModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { createContext, useContext } from "react";

export interface NetworkModalContextState {
modalVisible: boolean;
setModalVisible: (open: boolean) => void;
}

export const NetworkModalContext = createContext<NetworkModalContextState>({} as NetworkModalContextState);

export function useNetworkModal(): NetworkModalContextState {
return useContext(NetworkModalContext);
}