Simplify tab check
This commit is contained in:
1 parent
6fc06ab9b6
commit
00074e039e
1 file changed
+6
-6
@@ -24,18 +24,18 @@ const Account = ({ open = "profile" }) => {
|
||||
};
|
||||
const { user } = useSelector((state) => state.auth);
|
||||
|
||||
let tabList = ["Profile", "Team", "Password"];
|
||||
|
||||
// Remove passwrod for demo
|
||||
if (user.role.includes("demo")) {
|
||||
tabList = tabList.filter((tab) => tab !== "Password");
|
||||
}
|
||||
const requiredRoles = ["superadmin", "admin"];
|
||||
let tabList = ["Profile", "Team", "Password"];
|
||||
const hideTeams = !requiredRoles.some((role) => user.role.includes(role));
|
||||
if (hideTeams) {
|
||||
tabList = ["Profile", "Password"];
|
||||
}
|
||||
|
||||
// Remove passwrod for demo
|
||||
if (user.role.includes("demo")) {
|
||||
tabList = ["Profile"];
|
||||
}
|
||||
|
||||
return (
|
||||
<Box
|
||||
className="account"
|
||||
|
||||
Reference in new issue
Block a user