fixed slaughter manage guilds

This commit is contained in:
2026-01-27 10:55:17 +03:30
parent 66d71c9c25
commit d76c057f15
10 changed files with 180 additions and 103 deletions

View File

@@ -56,13 +56,13 @@ import {
ROUTE_SUPER_ADMIN_ROUTE_OUT_PROVINCE_LEGAL_GUILDS,
ROUTE_ADMINX_ROUTE_OUT_PROVINCE_LEGAL_GUILDS,
ROUTE_PROVINCE_ROUTE_OUT_PROVINCE_LEGAL_GUILDS,
ROUTE_SLAUGHTER_ROUTE_MANAGE_GUILDS,
} from "../routes/routes";
import { BackButton } from "../components/back-button/BackButton";
import { GuildsOperations } from "../features/province/components/guilds-operations/GuildsOperations";
import { ManageStewards } from "../features/province/components/manage-stewards/ManageStewards";
import { GuildsSettings } from "../features/province/components/guilds-settings/GuildsSettings";
import { GuildsOperationsCommerce } from "../features/commerce/components/guilds-operations-commerce/GuildsOperationsCommerce";
import { getRoleFromUrl } from "../utils/getRoleFromUrl";
import { ManageGuildsRequests } from "../features/province/components/manage-guilds-requests/ManageGuildsRequests";
import { GuildsOperationsCityJihad } from "../features/city-jihad/components/guilds-operations-city-jihad/GuildsOperationsCityJihad";
import { GuildRoomOperations } from "../features/guild-room/components/guild-room-operations/GuildRoomOperations";
@@ -75,6 +75,7 @@ import { ProvinceLegalGuildsOutProvince } from "../features/province/components/
const MANAGE_ROUTES = [
ROUTE_PROVINCE_ROUTE_MANAGE_GUILDS,
ROUTE_COMMERCE_ROUTE_MANAGE_GUILDS,
ROUTE_SLAUGHTER_ROUTE_MANAGE_GUILDS,
ROUTE_PROVINCE_SUPERVISOR_ROUTE_MANAGE_GUILDS,
ROUTE_GUILD_ROOM_ROUTE_MANAGE_GUILDS,
ROUTE_CITY_JIHAD_ROUTE_MANAGE_GUILDS,
@@ -93,6 +94,7 @@ const GUILDS_OPERATIONS_ROUTES = [
ROUTE_PROVINCE_ROUTE_MANAGE_GUILDS,
ROUTE_SUPER_ADMIN_ROUTE_MANAGE_GUILDS,
ROUTE_ADMINX_ROUTE_MANAGE_GUILDS,
ROUTE_SLAUGHTER_ROUTE_MANAGE_GUILDS,
ROUTE_SUPER_ADMIN_ROUTE_IN_PROVINCE_GUILDS,
ROUTE_ADMINX_ROUTE_IN_PROVINCE_GUILDS,
ROUTE_PROVINCE_ROUTE_IN_PROVINCE_GUILDS,
@@ -181,78 +183,70 @@ const isPathnameIncludes = (pathname, routes) =>
const Guilds = () => {
const { pathname } = useLocation();
const role = getRoleFromUrl();
const isKillHouse = role === "KillHouse";
return (
<>
<Box display={"flex"} justifyContent="center">
<Grid
container
direction="column"
justifyContent="center"
xs={12}
sm={12}
md={10}
lg={10}
>
{isPathnameIn(pathname, MANAGE_ROUTES) ? (
<Grid justifyContent="center" my={SPACING.MEDIUM}>
{isPathnameIn(pathname, GUILDS_OPERATIONS_ROUTES) && (
<GuildsOperations />
)}
{isPathnameIn(pathname, GUILDS_OPERATIONS_COMMERCE_ROUTES) && (
<GuildsOperationsCommerce />
)}
{isPathnameIn(pathname, GUILDS_OPERATIONS_CITY_JIHAD_ROUTES) && (
<GuildsOperationsCityJihad />
)}
{pathname === ROUTE_GUILD_ROOM_ROUTE_MANAGE_GUILDS && (
<GuildRoomOperations />
)}
</Grid>
) : (
<BackButton />
)}
<Box display={"flex"} justifyContent="center">
<Grid
container
direction="column"
justifyContent="center"
xs={12}
lg={10}
>
{isPathnameIn(pathname, MANAGE_ROUTES) ? (
<Grid justifyContent="center" my={SPACING.MEDIUM}>
{isPathnameIn(pathname, GUILDS_OPERATIONS_ROUTES) && (
<GuildsOperations />
)}
{isPathnameIn(pathname, GUILDS_OPERATIONS_COMMERCE_ROUTES) && (
<GuildsOperationsCommerce />
)}
{isPathnameIn(pathname, GUILDS_OPERATIONS_CITY_JIHAD_ROUTES) && (
<GuildsOperationsCityJihad />
)}
{pathname === ROUTE_GUILD_ROOM_ROUTE_MANAGE_GUILDS && (
<GuildRoomOperations />
)}
</Grid>
) : (
<BackButton />
)}
<Grid container justifyContent="space-between" gap={SPACING.SMALL}>
<Grid xs={12}>
{(isPathnameIn(pathname, MANAGE_TAB_ROUTES) || isKillHouse) && (
<ManageTab />
)}
<Grid container justifyContent="space-between" gap={SPACING.SMALL}>
<Grid xs={12}>
{isPathnameIn(pathname, MANAGE_TAB_ROUTES) && <ManageTab />}
{isPathnameIncludes(pathname, STEWARDS_ROUTES) && (
<ManageStewards />
)}
{isPathnameIncludes(pathname, STEWARDS_ROUTES) && (
<ManageStewards />
)}
{isPathnameIn(pathname, GUILDS_SETTINGS_ROUTES) && (
<GuildsSettings />
)}
{isPathnameIn(pathname, GUILDS_SETTINGS_ROUTES) && (
<GuildsSettings />
)}
{isPathnameIn(pathname, GUILDS_REQUESTS_ROUTES) && (
<ManageGuildsRequests />
)}
{isPathnameIn(pathname, GUILDS_REQUESTS_ROUTES) && (
<ManageGuildsRequests />
)}
{isPathnameIn(pathname, GUILDS_DISTRIBUTIONS_ROUTES) && (
<ManageGuildDistributions />
)}
{isPathnameIn(pathname, GUILDS_DISTRIBUTIONS_ROUTES) && (
<ManageGuildDistributions />
)}
{isPathnameIn(pathname, TRUE_GUILDS_OUT_PROVINCE_ROUTES) && (
<ProvinceTrueGuildsOutProvince />
)}
{isPathnameIn(pathname, TRUE_GUILDS_OUT_PROVINCE_ROUTES) && (
<ProvinceTrueGuildsOutProvince />
)}
{isPathnameIn(pathname, LEGAL_GUILDS_IN_PROVINCE_ROUTES) && (
<ProvinceLegalGuildsInProvince />
)}
{isPathnameIn(pathname, LEGAL_GUILDS_IN_PROVINCE_ROUTES) && (
<ProvinceLegalGuildsInProvince />
)}
{isPathnameIn(pathname, LEGAL_GUILDS_OUT_PROVINCE_ROUTES) && (
<ProvinceLegalGuildsOutProvince />
)}
</Grid>
{isPathnameIn(pathname, LEGAL_GUILDS_OUT_PROVINCE_ROUTES) && (
<ProvinceLegalGuildsOutProvince />
)}
</Grid>
</Grid>
</Box>
</>
</Grid>
</Box>
);
};