add color in style badge
This commit is contained in:
@@ -35,7 +35,7 @@ const SidebarListItems = ({ menuItem, dispatch }) => {
|
||||
{menuItem.badges && (
|
||||
<Stack direction={"row"} sx={{ px: 0.5 }} spacing={0.5}>
|
||||
{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>
|
||||
)}
|
||||
|
||||
@@ -33,7 +33,7 @@ const SidebarSubitems = ({ subitem, dispatch }) => {
|
||||
{subitem.badges && (
|
||||
<Stack direction={"row"} sx={{ px: 0.5 }} spacing={0.5}>
|
||||
{subitem.badges.map((badge, i) => (
|
||||
<SidebarBadge key={i} badge={badge} />
|
||||
<SidebarBadge chipProps={{ color: badge.color || "default" }} key={badge.key} badge={badge.key} />
|
||||
))}
|
||||
</Stack>
|
||||
)}
|
||||
|
||||
@@ -95,7 +95,7 @@ export const pageMenu = [
|
||||
type: "menu",
|
||||
icon: <FactCheckIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
badges: ["roadItem.total"],
|
||||
badges: [{ key: "roadItem.total" }],
|
||||
Subitems: [
|
||||
{
|
||||
id: "roadItemManagmentSupervisor",
|
||||
@@ -103,7 +103,7 @@ export const pageMenu = [
|
||||
type: "menu",
|
||||
icon: <SpeedIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
badges: ["roadItem.supervise_cnt"],
|
||||
badges: [{ key: "roadItem.supervise_cnt" }],
|
||||
Subitems: [
|
||||
{
|
||||
id: "roadItemManagmentSupervisorCartable",
|
||||
@@ -123,7 +123,7 @@ export const pageMenu = [
|
||||
type: "menu",
|
||||
icon: <EngineeringIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
badges: ["roadItem.operation_cnt"],
|
||||
badges: [{ key: "roadItem.operation_cnt" }],
|
||||
Subitems: [
|
||||
{
|
||||
id: "roadItemManagmentOparationCartable",
|
||||
@@ -290,7 +290,7 @@ export const pageMenu = [
|
||||
type: "menu",
|
||||
icon: <RouteIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
badges: ["safetyAndPrivacy.step_one", "safetyAndPrivacy.step_two"],
|
||||
badges: [{ key: "safetyAndPrivacy.step_one", color: 'warning' }, { key: "safetyAndPrivacy.step_two", color: 'error' }],
|
||||
Subitems: [
|
||||
{
|
||||
id: "safetyAndPrivacyManagmentOparation",
|
||||
@@ -344,7 +344,7 @@ export const pageMenu = [
|
||||
type: "menu",
|
||||
icon: <ElectricBoltIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
badges: ["roadObserved.total"],
|
||||
badges: [{ key: "roadObserved.total" }],
|
||||
Subitems: [
|
||||
{
|
||||
id: "roadObservationsManagmentSupervisor",
|
||||
@@ -352,7 +352,7 @@ export const pageMenu = [
|
||||
type: "menu",
|
||||
icon: <SpeedIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
badges: ["roadObserved.supervise_cnt", "roadObserved.complaint_cnt"],
|
||||
badges: [{ key: "roadObserved.supervise_cnt" }, { key: "roadObserved.complaint_cnt" }],
|
||||
Subitems: [
|
||||
{
|
||||
id: "roadObservationsManagmentSupervisorCartable",
|
||||
@@ -369,7 +369,7 @@ export const pageMenu = [
|
||||
type: "menu",
|
||||
icon: <EngineeringIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
badges: ["roadObserved.operation_cnt", "roadObserved.complaint_cnt"],
|
||||
badges: [{ key: "roadObserved.operation_cnt" }, { key: "roadObserved.complaint_cnt" }],
|
||||
Subitems: [
|
||||
{
|
||||
id: "roadObservationsManagmentOparationCartable",
|
||||
|
||||
Reference in New Issue
Block a user