-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat/json-schema' into fix/bug-bash-minor
- Loading branch information
Showing
132 changed files
with
7,614 additions
and
1,073 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,6 @@ const nextConfig = { | |
"project", | ||
"contract-list", | ||
"past-tx", | ||
"my-code", | ||
"pool", | ||
]; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from "./app"; | ||
export * from "./nav"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import type { Dispatch, ReactNode, SetStateAction } from "react"; | ||
import { useContext, createContext, useMemo } from "react"; | ||
|
||
import { useLocalStorage } from "lib/hooks/useLocalStorage"; | ||
import type { Option } from "lib/types"; | ||
|
||
interface NavContextInterface { | ||
isExpand: boolean; | ||
isDevMode: Option<boolean>; | ||
setIsExpand: Dispatch<SetStateAction<boolean>>; | ||
setIsDevMode: Dispatch<SetStateAction<Option<boolean>>>; | ||
} | ||
const NavContext = createContext<NavContextInterface>({ | ||
isExpand: false, | ||
isDevMode: undefined, | ||
setIsExpand: () => {}, | ||
setIsDevMode: () => {}, | ||
}); | ||
|
||
export const NavProvider = ({ children }: { children: ReactNode }) => { | ||
const [isDevMode, setIsDevMode] = useLocalStorage<Option<boolean>>( | ||
"devMode", | ||
undefined | ||
); | ||
const [isExpand, setIsExpand] = useLocalStorage("navbar", false); | ||
|
||
const states = useMemo<NavContextInterface>( | ||
() => ({ | ||
isDevMode, | ||
isExpand, | ||
setIsDevMode, | ||
setIsExpand, | ||
}), | ||
[isDevMode, isExpand, setIsDevMode, setIsExpand] | ||
); | ||
|
||
return <NavContext.Provider value={states}>{children}</NavContext.Provider>; | ||
}; | ||
|
||
export const useNavContext = (): NavContextInterface => { | ||
return useContext(NavContext); | ||
}; |
Oops, something went wrong.