fixed grid
This commit is contained in:
@@ -290,14 +290,9 @@ const AccessDashboardV2 = () => {
|
||||
|
||||
function renderSkeletonCards(count = 6) {
|
||||
return (
|
||||
<Grid
|
||||
container
|
||||
spacing={{ xs: 1, sm: 3 }}
|
||||
justifyContent="center"
|
||||
xs={12}
|
||||
>
|
||||
<Grid container spacing={{ xs: 1, sm: 3 }} justifyContent="center">
|
||||
{Array.from({ length: count }).map((_, i) => (
|
||||
<Grid item key={i} xs={12} sm={12} lg={12}>
|
||||
<Grid item key={i} xs={12} lg={10}>
|
||||
<Card
|
||||
elevation={2}
|
||||
sx={{
|
||||
@@ -515,7 +510,6 @@ const AccessDashboardV2 = () => {
|
||||
>
|
||||
<Grid
|
||||
container
|
||||
xs={12}
|
||||
justifyContent="space-between"
|
||||
alignItems="center"
|
||||
mb={2}
|
||||
@@ -657,7 +651,7 @@ const AccessDashboardV2 = () => {
|
||||
<SlaughterBalanceStatusButton />
|
||||
)}
|
||||
</Grid>
|
||||
<Grid container xs={12} justifyContent="center" alignItems="center">
|
||||
<Grid container justifyContent="center" alignItems="center">
|
||||
{renderContent()}
|
||||
</Grid>
|
||||
</Box>
|
||||
@@ -672,7 +666,7 @@ const AccessDashboardV2 = () => {
|
||||
|
||||
if (!poultryRoles || poultryRoles.length === 0) {
|
||||
return (
|
||||
<Grid container xs={12} justifyContent="center" alignItems="center">
|
||||
<Grid container justifyContent="center" alignItems="center">
|
||||
<Card
|
||||
elevation={2}
|
||||
sx={{
|
||||
@@ -704,20 +698,9 @@ const AccessDashboardV2 = () => {
|
||||
}
|
||||
|
||||
return (
|
||||
<Grid
|
||||
container
|
||||
spacing={{ xs: 1, sm: 3 }}
|
||||
justifyContent="center"
|
||||
xs={12}
|
||||
>
|
||||
<Grid container spacing={{ xs: 1, sm: 3 }} justifyContent="center">
|
||||
{sortRoles(poultryRoles)?.map((item, i) => (
|
||||
<Grid
|
||||
item
|
||||
xs={12}
|
||||
sm={12}
|
||||
lg={poultryRoles?.length === 1 ? 12 : 6}
|
||||
key={i}
|
||||
>
|
||||
<Grid item xs={12} lg={poultryRoles?.length === 1 ? 12 : 6} key={i}>
|
||||
<Card
|
||||
elevation={2}
|
||||
sx={{
|
||||
@@ -938,7 +921,7 @@ const AccessDashboardV2 = () => {
|
||||
|
||||
if (!livestockRoles || livestockRoles.length === 0) {
|
||||
return (
|
||||
<Grid container xs={12} justifyContent="center" alignItems="center">
|
||||
<Grid container justifyContent="center" alignItems="center">
|
||||
<Card
|
||||
elevation={2}
|
||||
sx={{
|
||||
@@ -970,12 +953,7 @@ const AccessDashboardV2 = () => {
|
||||
}
|
||||
|
||||
return (
|
||||
<Grid
|
||||
container
|
||||
spacing={{ xs: 1, sm: 3 }}
|
||||
justifyContent="center"
|
||||
xs={12}
|
||||
>
|
||||
<Grid container spacing={{ xs: 1, sm: 3 }} justifyContent="center">
|
||||
{sortRoles(livestockRoles)?.map((item, i) => (
|
||||
<Grid
|
||||
item
|
||||
@@ -1201,7 +1179,7 @@ const AccessDashboardV2 = () => {
|
||||
|
||||
if (!barSquareRoles || barSquareRoles.length === 0) {
|
||||
return (
|
||||
<Grid container xs={12} justifyContent="center" alignItems="center">
|
||||
<Grid container justifyContent="center" alignItems="center">
|
||||
<Card
|
||||
elevation={2}
|
||||
sx={{
|
||||
@@ -1233,20 +1211,9 @@ const AccessDashboardV2 = () => {
|
||||
}
|
||||
|
||||
return (
|
||||
<Grid
|
||||
container
|
||||
spacing={{ xs: 1, sm: 3 }}
|
||||
justifyContent="center"
|
||||
xs={12}
|
||||
>
|
||||
<Grid container spacing={{ xs: 1, sm: 3 }} justifyContent="center">
|
||||
{sortRoles(barSquareRoles)?.map((item, i) => (
|
||||
<Grid
|
||||
item
|
||||
xs={12}
|
||||
sm={12}
|
||||
lg={barSquareRoles?.length === 1 ? 12 : 6}
|
||||
key={i}
|
||||
>
|
||||
<Grid item xs={12} lg={barSquareRoles?.length === 1 ? 12 : 6} key={i}>
|
||||
<Card
|
||||
elevation={2}
|
||||
sx={{
|
||||
|
||||
@@ -23,9 +23,14 @@ import {
|
||||
ROUTE_PROVINCE_ROUTE_MANAGE_STEWARDS_OUT_PROVINCE,
|
||||
ROUTE_PROVINCE_ROUTE_MANAGE_STEWARDS_OUT_PROVINCE_LEGAL,
|
||||
ROUTE_PROVINCE_ROUTE_MANAGE_STEWARDS_OUT_PROVINCE_TRUE,
|
||||
ROUTE_SLAUGHTER_MANAGE_STEWARDS,
|
||||
ROUTE_SLAUGHTER_MANAGE_STEWARDS_IN_PROVINCE,
|
||||
ROUTE_SLAUGHTER_MANAGE_STEWARDS_IN_PROVINCE_LEGAL,
|
||||
ROUTE_SLAUGHTER_MANAGE_STEWARDS_IN_PROVINCE_STEWARDS_REQUESTS,
|
||||
ROUTE_SLAUGHTER_MANAGE_STEWARDS_IN_PROVINCE_TRUE,
|
||||
ROUTE_SLAUGHTER_MANAGE_STEWARDS_OUT_PROVINCE,
|
||||
ROUTE_SLAUGHTER_MANAGE_STEWARDS_OUT_PROVINCE_LEGAL,
|
||||
ROUTE_SLAUGHTER_MANAGE_STEWARDS_OUT_PROVINCE_TRUE,
|
||||
ROUTE_SUPER_ADMIN_ROUTE_MANAGE_STEWARDS,
|
||||
ROUTE_SUPER_ADMIN_ROUTE_MANAGE_STEWARDS_IN_PROVINCE,
|
||||
ROUTE_SUPER_ADMIN_ROUTE_MANAGE_STEWARDS_IN_PROVINCE_LEGAL,
|
||||
@@ -82,6 +87,8 @@ const ProvinceManageStewards = () => {
|
||||
? ROUTE_SUPER_ADMIN_ROUTE_MANAGE_STEWARDS_IN_PROVINCE_TRUE
|
||||
: isProvinceOperator
|
||||
? ROUTE_PROVINCE_ROUTE_MANAGE_STEWARDS_IN_PROVINCE_TRUE
|
||||
: isSlaughter
|
||||
? ROUTE_SLAUGHTER_MANAGE_STEWARDS_IN_PROVINCE_TRUE
|
||||
: "";
|
||||
|
||||
const STEWARDS_OUT_PROVINCE_TRUE = isAdminX
|
||||
@@ -90,6 +97,8 @@ const ProvinceManageStewards = () => {
|
||||
? ROUTE_SUPER_ADMIN_ROUTE_MANAGE_STEWARDS_OUT_PROVINCE_TRUE
|
||||
: isProvinceOperator
|
||||
? ROUTE_PROVINCE_ROUTE_MANAGE_STEWARDS_OUT_PROVINCE_TRUE
|
||||
: isSlaughter
|
||||
? ROUTE_SLAUGHTER_MANAGE_STEWARDS_OUT_PROVINCE_TRUE
|
||||
: "";
|
||||
|
||||
const STEWARDS_IN_PROVINCE_LEGAL = isAdminX
|
||||
@@ -98,6 +107,8 @@ const ProvinceManageStewards = () => {
|
||||
? ROUTE_SUPER_ADMIN_ROUTE_MANAGE_STEWARDS_IN_PROVINCE_LEGAL
|
||||
: isProvinceOperator
|
||||
? ROUTE_PROVINCE_ROUTE_MANAGE_STEWARDS_IN_PROVINCE_LEGAL
|
||||
: isSlaughter
|
||||
? ROUTE_SLAUGHTER_MANAGE_STEWARDS_IN_PROVINCE_LEGAL
|
||||
: "";
|
||||
|
||||
const STEWARDS_OUT_PROVINCE_LEGAL = isAdminX
|
||||
@@ -106,6 +117,8 @@ const ProvinceManageStewards = () => {
|
||||
? ROUTE_SUPER_ADMIN_ROUTE_MANAGE_STEWARDS_OUT_PROVINCE_LEGAL
|
||||
: isProvinceOperator
|
||||
? ROUTE_PROVINCE_ROUTE_MANAGE_STEWARDS_OUT_PROVINCE_LEGAL
|
||||
: isSlaughter
|
||||
? ROUTE_SLAUGHTER_MANAGE_STEWARDS_OUT_PROVINCE_LEGAL
|
||||
: "";
|
||||
|
||||
return (
|
||||
@@ -123,7 +136,8 @@ const ProvinceManageStewards = () => {
|
||||
</Grid>
|
||||
{(ROUTE_ADMINX_ROUTE_MANAGE_STEWARDS === pathname ||
|
||||
ROUTE_SUPER_ADMIN_ROUTE_MANAGE_STEWARDS === pathname ||
|
||||
ROUTE_PROVINCE_ROUTE_MANAGE_STEWARDS === pathname) && (
|
||||
ROUTE_PROVINCE_ROUTE_MANAGE_STEWARDS === pathname ||
|
||||
ROUTE_SLAUGHTER_MANAGE_STEWARDS === pathname) && (
|
||||
<>
|
||||
<NavLink to={STEWARDS_IN_PROVINCE}>
|
||||
<LinkItem
|
||||
|
||||
Reference in New Issue
Block a user