Add an interactive method for right-swiping to pop up the TOC to the reader page.

This commit is contained in:
PrinOrange
2024-01-04 12:30:29 +08:00
parent cc7e71ff1b
commit 200ea30bbd
4 changed files with 35 additions and 9 deletions

View 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;