Grégoire Delattre 0f0594f2c4 Add a button to show the modules statuses
It's really annoying to wait for the modules to be loaded while visiting
the user profile or admin panel.
2021-08-22 11:33:36 -10:00

31 lines
747 B
JavaScript

import React from "react";
import { useDispatch, useSelector } from "react-redux";
import { PolochonList } from "../polochons/list";
import { UserEdit } from "./edit";
import { getUserModules } from "../../actions/users";
import Modules from "../modules/modules";
export const UserProfile = () => {
const dispatch = useDispatch();
const modules = useSelector((state) => state.user.modules);
const modulesLoading = useSelector((state) => state.user.modulesLoading);
const fetchModules = () => {
dispatch(getUserModules());
};
return (
<div>
<UserEdit />
<PolochonList />
<Modules
modules={modules}
isLoading={modulesLoading}
fetchModules={fetchModules}
/>
</div>
);
};