Skip to content

Commit

Permalink
fix(fields): make MultiZoneEditor row background white when isLight
Browse files Browse the repository at this point in the history
  • Loading branch information
ivangabriele committed Feb 8, 2023
1 parent 7f1e490 commit 96f7a00
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/fields/MultiZoneEditor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export function MultiZoneEditor({
useFieldUndefineEffect(disabled, onChange, handleDisable)

return (
<Fieldset disabled={disabled} isLegendHidden={isLabelHidden} isLight={isLight} legend={label}>
<Fieldset disabled={disabled} isLegendHidden={isLabelHidden} legend={label}>
<Button accent={Accent.SECONDARY} disabled={disabled} Icon={Plus} isFullWidth onClick={addZone}>
{addButtonLabel}
</Button>
Expand All @@ -120,7 +120,7 @@ export function MultiZoneEditor({
{zones.map((zone, index) => (
// eslint-disable-next-line react/no-array-index-key
<Row key={`zone-${index}`}>
<ZoneWrapper>
<ZoneBox $isLight={isLight}>
{zone[labelPropName]}

{/* TODO Add `Accent.LINK` accent in @mtes-mct/monitor-ui and use it here. */}
Expand All @@ -129,7 +129,7 @@ export function MultiZoneEditor({
<SelectRectangle />
<span>Centrer sur la carte</span>
</Link>
</ZoneWrapper>
</ZoneBox>

<IconButton accent={Accent.SECONDARY} Icon={Edit} onClick={() => editZone(index, zone)} />
<IconButton
Expand Down Expand Up @@ -157,8 +157,10 @@ const Row = styled.div`
}
`

const ZoneWrapper = styled.div`
background-color: ${p => p.theme.color.gainsboro};
const ZoneBox = styled.div<{
$isLight: boolean
}>`
background-color: ${p => (p.$isLight ? p.theme.color.white : p.theme.color.gainsboro)};
display: flex;
flex-grow: 1;
font-size: 13px;
Expand Down

0 comments on commit 96f7a00

Please sign in to comment.