forked from renproject/command-center
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuiContainer.ts
31 lines (25 loc) · 884 Bytes
/
uiContainer.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { useCallback, useState } from "react";
import { createContainer } from "unstated-next";
const useUIContainer = () => {
const [mobileMenuActive, setMobileMenuActive] = useState(false);
const [selectedDarknodeID, setSelectedDarknodeID] = useState<
string | undefined
>(undefined);
const showMobileMenu = useCallback(() => {
setMobileMenuActive(true);
}, [setMobileMenuActive]);
const hideMobileMenu = useCallback(() => {
setMobileMenuActive(false);
}, [setMobileMenuActive]);
const [claimWarningShown, setClaimWarningShown] = useState(false);
return {
mobileMenuActive,
showMobileMenu,
hideMobileMenu,
selectedDarknodeID,
setSelectedDarknodeID,
claimWarningShown,
setClaimWarningShown,
};
};
export const UIContainer = createContainer(useUIContainer);