refactor(flows): update import statement in FlowsComponent to use FlowsContext instead of TabsContext
refactor(market-card): update import statement in MarketCardComponent to use FlowsContext instead of TabsContext refactor(store-page): remove unused setTabId function from StorePage component
This commit is contained in:
parent
60f6d08fc3
commit
a81ed4df52
3 changed files with 4 additions and 9 deletions
|
|
@ -5,10 +5,10 @@ import CardsWrapComponent from "../../../../components/cardsWrapComponent";
|
||||||
import IconComponent from "../../../../components/genericIconComponent";
|
import IconComponent from "../../../../components/genericIconComponent";
|
||||||
import { Button } from "../../../../components/ui/button";
|
import { Button } from "../../../../components/ui/button";
|
||||||
import { alertContext } from "../../../../contexts/alertContext";
|
import { alertContext } from "../../../../contexts/alertContext";
|
||||||
import { TabsContext } from "../../../../contexts/tabsContext";
|
import { FlowsContext } from "../../../../contexts/flowsContext";
|
||||||
|
|
||||||
export default function FlowsComponent() {
|
export default function FlowsComponent() {
|
||||||
const { uploadFlow, removeFlow, flows, isLoading } = useContext(TabsContext);
|
const { uploadFlow, removeFlow, flows, isLoading } = useContext(FlowsContext);
|
||||||
const { setErrorData } = useContext(alertContext);
|
const { setErrorData } = useContext(alertContext);
|
||||||
|
|
||||||
const onFileDrop = (e) => {
|
const onFileDrop = (e) => {
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,8 @@ import {
|
||||||
CardTitle,
|
CardTitle,
|
||||||
} from "../../../components/ui/card";
|
} from "../../../components/ui/card";
|
||||||
import { alertContext } from "../../../contexts/alertContext";
|
import { alertContext } from "../../../contexts/alertContext";
|
||||||
|
import { FlowsContext } from "../../../contexts/flowsContext";
|
||||||
import { StoreContext } from "../../../contexts/storeContext";
|
import { StoreContext } from "../../../contexts/storeContext";
|
||||||
import { TabsContext } from "../../../contexts/tabsContext";
|
|
||||||
import {
|
import {
|
||||||
getComponent,
|
getComponent,
|
||||||
postLikeComponent,
|
postLikeComponent,
|
||||||
|
|
@ -38,7 +38,7 @@ export const MarketCardComponent = ({
|
||||||
const [added, setAdded] = useState(savedFlows.has(data.id) ? true : false);
|
const [added, setAdded] = useState(savedFlows.has(data.id) ? true : false);
|
||||||
const [installed, setInstalled] = useState(false);
|
const [installed, setInstalled] = useState(false);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const { addFlow } = useContext(TabsContext);
|
const { addFlow } = useContext(FlowsContext);
|
||||||
const [loadingLike, setLoadingLike] = useState(false);
|
const [loadingLike, setLoadingLike] = useState(false);
|
||||||
const { setSuccessData, setErrorData } = useContext(alertContext);
|
const { setSuccessData, setErrorData } = useContext(alertContext);
|
||||||
const [liked_by_user, setLiked_by_user] = useState(data.liked_by_user);
|
const [liked_by_user, setLiked_by_user] = useState(data.liked_by_user);
|
||||||
|
|
|
||||||
|
|
@ -16,17 +16,12 @@ import {
|
||||||
} from "../../components/ui/select";
|
} from "../../components/ui/select";
|
||||||
import { alertContext } from "../../contexts/alertContext";
|
import { alertContext } from "../../contexts/alertContext";
|
||||||
import { StoreContext } from "../../contexts/storeContext";
|
import { StoreContext } from "../../contexts/storeContext";
|
||||||
import { TabsContext } from "../../contexts/tabsContext";
|
|
||||||
import { getStoreComponents, getStoreTags } from "../../controllers/API";
|
import { getStoreComponents, getStoreTags } from "../../controllers/API";
|
||||||
import StoreApiKeyModal from "../../modals/StoreApiKeyModal";
|
import StoreApiKeyModal from "../../modals/StoreApiKeyModal";
|
||||||
import { storeComponent } from "../../types/store";
|
import { storeComponent } from "../../types/store";
|
||||||
import { cn } from "../../utils/utils";
|
import { cn } from "../../utils/utils";
|
||||||
import { MarketCardComponent } from "./components/market-card";
|
import { MarketCardComponent } from "./components/market-card";
|
||||||
export default function StorePage(): JSX.Element {
|
export default function StorePage(): JSX.Element {
|
||||||
const { setTabId } = useContext(TabsContext);
|
|
||||||
useEffect(() => {
|
|
||||||
setTabId("");
|
|
||||||
}, []);
|
|
||||||
const { errorApiKey, hasApiKey } = useContext(StoreContext);
|
const { errorApiKey, hasApiKey } = useContext(StoreContext);
|
||||||
const { setErrorData } = useContext(alertContext);
|
const { setErrorData } = useContext(alertContext);
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue