removed from-store
This commit is contained in:
parent
dcde9b7ae3
commit
68dc2fa53d
3 changed files with 0 additions and 60 deletions
|
|
@ -1,44 +0,0 @@
|
||||||
import { useContext, useEffect, useState } from "react";
|
|
||||||
import CardsWrapComponent from "../../../../components/cardsWrapComponent";
|
|
||||||
import { alertContext } from "../../../../contexts/alertContext";
|
|
||||||
import { getStoreComponents } from "../../../../controllers/API";
|
|
||||||
import { storeComponent } from "../../../../types/store";
|
|
||||||
import { MarketCardComponent } from "../../../StorePage/components/market-card";
|
|
||||||
|
|
||||||
export default function FromStore(): JSX.Element {
|
|
||||||
const [data, setData] = useState<storeComponent[]>([]);
|
|
||||||
const [loading, setLoading] = useState(false);
|
|
||||||
const { setErrorData } = useContext(alertContext);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
handleGetComponents();
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const handleGetComponents = () => {
|
|
||||||
setLoading(true);
|
|
||||||
getStoreComponents({
|
|
||||||
sort: "name",
|
|
||||||
filterByUser: true,
|
|
||||||
})
|
|
||||||
.then((res) => {
|
|
||||||
setLoading(false);
|
|
||||||
setData(res?.results ?? []);
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
setData([]);
|
|
||||||
setLoading(false);
|
|
||||||
setErrorData({
|
|
||||||
title: "Error to get components.",
|
|
||||||
list: [err["response"]["data"]["detail"]],
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<CardsWrapComponent isLoading={loading}>
|
|
||||||
{data.map((item, idx) => (
|
|
||||||
<MarketCardComponent key={idx} data={item} installable />
|
|
||||||
))}
|
|
||||||
</CardsWrapComponent>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -41,13 +41,6 @@ export default function HomePage(): JSX.Element {
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
// if (hasStore) {
|
|
||||||
// sidebarNavItems.push({
|
|
||||||
// title: "From Store",
|
|
||||||
// href: "/from-store",
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Set a null id
|
// Set a null id
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setTabId("");
|
setTabId("");
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ import FlowPage from "./pages/FlowPage";
|
||||||
import HomePage from "./pages/MainPage";
|
import HomePage from "./pages/MainPage";
|
||||||
import ComponentsComponent from "./pages/MainPage/components/components";
|
import ComponentsComponent from "./pages/MainPage/components/components";
|
||||||
import FlowsComponent from "./pages/MainPage/components/flows";
|
import FlowsComponent from "./pages/MainPage/components/flows";
|
||||||
import FromStore from "./pages/MainPage/components/from-store";
|
|
||||||
import ProfileSettingsPage from "./pages/ProfileSettingsPage";
|
import ProfileSettingsPage from "./pages/ProfileSettingsPage";
|
||||||
import StorePage from "./pages/StorePage";
|
import StorePage from "./pages/StorePage";
|
||||||
import ViewPage from "./pages/ViewPage";
|
import ViewPage from "./pages/ViewPage";
|
||||||
|
|
@ -41,14 +40,6 @@ const Router = () => {
|
||||||
>
|
>
|
||||||
<Route path="flows" element={<FlowsComponent />} />
|
<Route path="flows" element={<FlowsComponent />} />
|
||||||
<Route path="components" element={<ComponentsComponent />} />
|
<Route path="components" element={<ComponentsComponent />} />
|
||||||
<Route
|
|
||||||
path="from-store"
|
|
||||||
element={
|
|
||||||
<StoreGuard>
|
|
||||||
<FromStore />
|
|
||||||
</StoreGuard>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</Route>
|
</Route>
|
||||||
<Route
|
<Route
|
||||||
path="/community"
|
path="/community"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue