add color in style badge

This commit is contained in:
AmirHossein Mahmoodi
2025-04-08 11:18:23 +03:30
parent a7efd9648c
commit 20d4746e66
3 changed files with 9 additions and 9 deletions

View File

@@ -35,7 +35,7 @@ const SidebarListItems = ({ menuItem, dispatch }) => {
{menuItem.badges && ( {menuItem.badges && (
<Stack direction={"row"} sx={{ px: 0.5 }} spacing={0.5}> <Stack direction={"row"} sx={{ px: 0.5 }} spacing={0.5}>
{menuItem.badges.map((badge, i) => ( {menuItem.badges.map((badge, i) => (
<SidebarBadge chipProps={{ color: "primary" }} key={i} badge={badge} /> <SidebarBadge chipProps={{ color: badge.color || "primary" }} key={badge.key} badge={badge.key} />
))} ))}
</Stack> </Stack>
)} )}

View File

@@ -33,7 +33,7 @@ const SidebarSubitems = ({ subitem, dispatch }) => {
{subitem.badges && ( {subitem.badges && (
<Stack direction={"row"} sx={{ px: 0.5 }} spacing={0.5}> <Stack direction={"row"} sx={{ px: 0.5 }} spacing={0.5}>
{subitem.badges.map((badge, i) => ( {subitem.badges.map((badge, i) => (
<SidebarBadge key={i} badge={badge} /> <SidebarBadge chipProps={{ color: badge.color || "default" }} key={badge.key} badge={badge.key} />
))} ))}
</Stack> </Stack>
)} )}

View File

@@ -95,7 +95,7 @@ export const pageMenu = [
type: "menu", type: "menu",
icon: <FactCheckIcon sx={{ width: "inherit", height: "inherit" }} />, icon: <FactCheckIcon sx={{ width: "inherit", height: "inherit" }} />,
hasSubitems: true, hasSubitems: true,
badges: ["roadItem.total"], badges: [{ key: "roadItem.total" }],
Subitems: [ Subitems: [
{ {
id: "roadItemManagmentSupervisor", id: "roadItemManagmentSupervisor",
@@ -103,7 +103,7 @@ export const pageMenu = [
type: "menu", type: "menu",
icon: <SpeedIcon sx={{ width: "inherit", height: "inherit" }} />, icon: <SpeedIcon sx={{ width: "inherit", height: "inherit" }} />,
hasSubitems: true, hasSubitems: true,
badges: ["roadItem.supervise_cnt"], badges: [{ key: "roadItem.supervise_cnt" }],
Subitems: [ Subitems: [
{ {
id: "roadItemManagmentSupervisorCartable", id: "roadItemManagmentSupervisorCartable",
@@ -123,7 +123,7 @@ export const pageMenu = [
type: "menu", type: "menu",
icon: <EngineeringIcon sx={{ width: "inherit", height: "inherit" }} />, icon: <EngineeringIcon sx={{ width: "inherit", height: "inherit" }} />,
hasSubitems: true, hasSubitems: true,
badges: ["roadItem.operation_cnt"], badges: [{ key: "roadItem.operation_cnt" }],
Subitems: [ Subitems: [
{ {
id: "roadItemManagmentOparationCartable", id: "roadItemManagmentOparationCartable",
@@ -290,7 +290,7 @@ export const pageMenu = [
type: "menu", type: "menu",
icon: <RouteIcon sx={{ width: "inherit", height: "inherit" }} />, icon: <RouteIcon sx={{ width: "inherit", height: "inherit" }} />,
hasSubitems: true, hasSubitems: true,
badges: ["safetyAndPrivacy.step_one", "safetyAndPrivacy.step_two"], badges: [{ key: "safetyAndPrivacy.step_one", color: 'warning' }, { key: "safetyAndPrivacy.step_two", color: 'error' }],
Subitems: [ Subitems: [
{ {
id: "safetyAndPrivacyManagmentOparation", id: "safetyAndPrivacyManagmentOparation",
@@ -344,7 +344,7 @@ export const pageMenu = [
type: "menu", type: "menu",
icon: <ElectricBoltIcon sx={{ width: "inherit", height: "inherit" }} />, icon: <ElectricBoltIcon sx={{ width: "inherit", height: "inherit" }} />,
hasSubitems: true, hasSubitems: true,
badges: ["roadObserved.total"], badges: [{ key: "roadObserved.total" }],
Subitems: [ Subitems: [
{ {
id: "roadObservationsManagmentSupervisor", id: "roadObservationsManagmentSupervisor",
@@ -352,7 +352,7 @@ export const pageMenu = [
type: "menu", type: "menu",
icon: <SpeedIcon sx={{ width: "inherit", height: "inherit" }} />, icon: <SpeedIcon sx={{ width: "inherit", height: "inherit" }} />,
hasSubitems: true, hasSubitems: true,
badges: ["roadObserved.supervise_cnt", "roadObserved.complaint_cnt"], badges: [{ key: "roadObserved.supervise_cnt" }, { key: "roadObserved.complaint_cnt" }],
Subitems: [ Subitems: [
{ {
id: "roadObservationsManagmentSupervisorCartable", id: "roadObservationsManagmentSupervisorCartable",
@@ -369,7 +369,7 @@ export const pageMenu = [
type: "menu", type: "menu",
icon: <EngineeringIcon sx={{ width: "inherit", height: "inherit" }} />, icon: <EngineeringIcon sx={{ width: "inherit", height: "inherit" }} />,
hasSubitems: true, hasSubitems: true,
badges: ["roadObserved.operation_cnt", "roadObserved.complaint_cnt"], badges: [{ key: "roadObserved.operation_cnt" }, { key: "roadObserved.complaint_cnt" }],
Subitems: [ Subitems: [
{ {
id: "roadObservationsManagmentOparationCartable", id: "roadObservationsManagmentOparationCartable",