mirror of
https://github.com/lemeow125/Ivy-Frontend.git
synced 2025-05-14 18:41:06 +08:00
Separated all the widgets in the dashboard into their own components
This commit is contained in:
parent
6619163abe
commit
3b5fb87099
12 changed files with 405 additions and 133 deletions
|
@ -9,6 +9,8 @@ import ViewManager from "../../Components/ProductsPage/ViewManager";
|
|||
import { useQuery } from "react-query";
|
||||
import { GetProducts } from "../../Components/Api/Api";
|
||||
import LoginChecker from "../../Components/LoginChecker/LoginChecker";
|
||||
import { useSelector } from "react-redux";
|
||||
import { OldSessionState } from "../../Interfaces/Interfaces";
|
||||
|
||||
export default function Products() {
|
||||
const navigate = useNavigate();
|
||||
|
@ -17,7 +19,10 @@ export default function Products() {
|
|||
isLoading,
|
||||
error,
|
||||
} = useQuery("products", GetProducts, { retry: 0 });
|
||||
if (isLoading) {
|
||||
const old_session_checked = useSelector(
|
||||
(state: OldSessionState) => state.old_session_checked.value
|
||||
);
|
||||
if (isLoading || !old_session_checked) {
|
||||
return (
|
||||
<div>
|
||||
<LoginChecker />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue