feat: getList action
This commit is contained in:
@@ -2,6 +2,7 @@ import React, { createContext, useContext, useState, ReactNode } from 'react';
|
|||||||
|
|
||||||
interface ActionContextProps {
|
interface ActionContextProps {
|
||||||
getText: boolean;
|
getText: boolean;
|
||||||
|
getList: boolean;
|
||||||
getScreenshot: boolean;
|
getScreenshot: boolean;
|
||||||
startGetText: () => void;
|
startGetText: () => void;
|
||||||
stopGetText: () => void;
|
stopGetText: () => void;
|
||||||
@@ -13,6 +14,7 @@ const ActionContext = createContext<ActionContextProps | undefined>(undefined);
|
|||||||
|
|
||||||
export const ActionProvider = ({ children }: { children: ReactNode }) => {
|
export const ActionProvider = ({ children }: { children: ReactNode }) => {
|
||||||
const [getText, setGetText] = useState<boolean>(false);
|
const [getText, setGetText] = useState<boolean>(false);
|
||||||
|
const [getList, setGetList] = useState<boolean>(false);
|
||||||
const [getScreenshot, setGetScreenshot] = useState<boolean>(false);
|
const [getScreenshot, setGetScreenshot] = useState<boolean>(false);
|
||||||
|
|
||||||
const startGetText = () => setGetText(true);
|
const startGetText = () => setGetText(true);
|
||||||
@@ -22,7 +24,7 @@ export const ActionProvider = ({ children }: { children: ReactNode }) => {
|
|||||||
const stopGetScreenshot = () => setGetScreenshot(false);
|
const stopGetScreenshot = () => setGetScreenshot(false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ActionContext.Provider value={{ getText, getScreenshot, startGetText, stopGetText, startGetScreenshot, stopGetScreenshot }}>
|
<ActionContext.Provider value={{ getText, getList, getScreenshot, startGetText, stopGetText, startGetScreenshot, stopGetScreenshot }}>
|
||||||
{children}
|
{children}
|
||||||
</ActionContext.Provider>
|
</ActionContext.Provider>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user