feat: stop pagination mode

This commit is contained in:
karishmas6
2024-09-05 22:42:57 +05:30
parent 8ea44ebab0
commit f8361c25fd

View File

@@ -12,6 +12,7 @@ interface ActionContextProps {
stopGetList: () => void; stopGetList: () => void;
startGetScreenshot: () => void; startGetScreenshot: () => void;
stopGetScreenshot: () => void; stopGetScreenshot: () => void;
stopPaginationMode: () => void;
} }
const ActionContext = createContext<ActionContextProps | undefined>(undefined); const ActionContext = createContext<ActionContextProps | undefined>(undefined);
@@ -23,6 +24,7 @@ export const ActionProvider = ({ children }: { children: ReactNode }) => {
const [paginationMode, setPaginationMode] = useState<boolean>(false); const [paginationMode, setPaginationMode] = useState<boolean>(false);
const startPaginationMode = () => setPaginationMode(true); const startPaginationMode = () => setPaginationMode(true);
const stopPaginationMode = () => setPaginationMode(false);
const startGetText = () => setGetText(true); const startGetText = () => setGetText(true);
const stopGetText = () => setGetText(false); const stopGetText = () => setGetText(false);
@@ -33,8 +35,10 @@ export const ActionProvider = ({ children }: { children: ReactNode }) => {
const startGetScreenshot = () => setGetScreenshot(true); const startGetScreenshot = () => setGetScreenshot(true);
const stopGetScreenshot = () => setGetScreenshot(false); const stopGetScreenshot = () => setGetScreenshot(false);
return ( return (
<ActionContext.Provider value={{ getText, getList, getScreenshot, paginationMode, startGetText, stopGetText, startGetList, stopGetList, startGetScreenshot, stopGetScreenshot, startPaginationMode }}> <ActionContext.Provider value={{ getText, getList, getScreenshot, paginationMode, startGetText, stopGetText, startGetList, stopGetList, startGetScreenshot, stopGetScreenshot, startPaginationMode, stopPaginationMode }}>
{children} {children}
</ActionContext.Provider> </ActionContext.Provider>
); );