Skip to content

Commit

Permalink
Fix warnings in dev console
Browse files Browse the repository at this point in the history
  • Loading branch information
luisvasq committed Nov 21, 2024
1 parent 88ec565 commit b419141
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
15 changes: 10 additions & 5 deletions src/ui/views/map/Legend.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,10 @@ export const LegendPopper = ({

const [selected, handleToggleSelected] = useToggle(false)
const { anchorEl, handleOpenMenu, handleCloseMenu } = useMenu()
const {
badge: { showBadge, reactIcon, ...muiBadgeProps } = {},
...muiSlotProps
} = slotProps
return (
<ToggleButton
size="small"
Expand All @@ -375,16 +379,17 @@ export const LegendPopper = ({
<WithBadge
size={14}
color="#29b6f6"
{...{ showBadge, reactIcon }}
slotProps={{
badge: {
...slotProps.badge,
sx: [{ right: 0, top: 0 }, ...forceArray(slotProps.badge?.sx)],
...muiBadgeProps,
sx: [{ right: 0, top: 0 }, ...forceArray(muiBadgeProps?.sx)],
},
}}
>
<IconComponent
color={selected ? '#90caf9' : '#fff'}
{...slotProps.icon}
{...muiSlotProps.icon}
/>
</WithBadge>
{/* Use `MapPortal` wrapper to prevent `Popper` to overflow the map chart */}
Expand All @@ -397,7 +402,7 @@ export const LegendPopper = ({
onClick={(event) => {
event.stopPropagation()
}}
{...{ anchorEl, ...slotProps.popper }}
{...{ anchorEl, ...muiSlotProps.popper }}
sx={[
styles.popper,
{
Expand All @@ -408,7 +413,7 @@ export const LegendPopper = ({
? 'calc(100% - 164px)'
: 'calc(100% - 128px)',
},
...forceArray(slotProps.popper?.sx),
...forceArray(muiSlotProps.popper?.sx),
]}
>
{children}
Expand Down
6 changes: 1 addition & 5 deletions src/ui/views/map/MinimalLegend.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,11 +360,7 @@ const LegendRow = ({ mapId, id, mapFeaturesBy, showSettings, ...props }) => {
size: 14,
color: '#29b6f6',
reactIcon: () => <MdFilterAlt color="#4a4a4a" />,
slotProps: {
badge: {
sx: { right: 0, top: 0 },
},
},
sx: { right: 0, top: 0 },
},
popper: { sx: { width: '400px' } },
}}
Expand Down

0 comments on commit b419141

Please sign in to comment.