Add an interactive method for right-swiping to pop up the TOC to the reader page.
This commit is contained in:
16
stores/useDrawerTOCState.ts
Normal file
16
stores/useDrawerTOCState.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { create } from "zustand";
|
||||
|
||||
type State = {
|
||||
isOpen: boolean;
|
||||
};
|
||||
|
||||
type Action = {
|
||||
changeDrawerTOCOpen: (open: State["isOpen"]) => void;
|
||||
};
|
||||
|
||||
const useDrawerTOCState = create<State & Action>((set) => ({
|
||||
isOpen: false,
|
||||
changeDrawerTOCOpen: (open) => set({ isOpen: open }),
|
||||
}));
|
||||
|
||||
export default useDrawerTOCState;
|
||||
Reference in New Issue
Block a user