Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Rex Dri
Rex Dri
Commits
cd89a8cc
Commit
cd89a8cc
authored
Apr 24, 2020
by
Estelle Veisemburger
Browse files
feat(Legend): change color for light and dark mode
parent
86b295b8
Changes
2
Hide whitespace changes
Inline
Side-by-side
frontend/src/components/map/BaseMap.jsx
View file @
cd89a8cc
...
...
@@ -27,8 +27,8 @@ const useStyles = makeStyles(theme => ({
position
:
"
absolute
"
,
top
:
0
,
left
:
0
,
zIndex
:
9999999999
,
padding
:
theme
.
spacing
(
0.5
)
zIndex
:
1
,
padding
:
theme
.
spacing
(
1
)
}
}));
...
...
frontend/src/components/map/Legend.jsx
View file @
cd89a8cc
...
...
@@ -22,14 +22,21 @@ function LegendItem({ color, opacity, label }) {
const
size
=
theme
.
typography
.
caption
.
fontSize
;
return
(
<
div
style
=
{
{
display
:
"
flex
"
,
alignItems
:
"
center
"
}
}
>
<
div
style
=
{
{
display
:
"
flex
"
,
alignItems
:
"
center
"
,
padding
:
theme
.
spacing
(
0.5
)
}
}
>
<
div
style
=
{
{
backgroundColor
:
color
,
borderRadius
:
size
,
width
:
size
,
height
:
size
,
marginRight
:
theme
.
spacing
(
0.5
)
marginRight
:
theme
.
spacing
(
0.5
),
opacity
:
opacity
}
}
/>
<
Typography
variant
=
"caption"
>
{
label
}
</
Typography
>
...
...
@@ -45,7 +52,7 @@ LegendItem.propTypes = {
LegendItem
.
defaultProps
=
{
opacity
:
1
,
label
:
"
toto
"
label
:
"
actif
"
};
/**
...
...
@@ -57,9 +64,15 @@ function Legend({}) {
const
color2
=
theme
.
palette
.
action
.
disabled
;
return
(
<
div
style
=
{
{
padding
:
theme
.
spacing
(
1
),
backgroundColor
:
"
white
"
}
}
>
<
LegendItem
color
=
{
color
}
label
=
"actif"
/>
<
LegendItem
color
=
{
color2
}
label
=
"inactif"
/>
<
div
style
=
{
{
padding
:
theme
.
spacing
(
1
),
backgroundColor
:
theme
.
palette
.
background
.
default
,
borderRadius
:
theme
.
spacing
(
1
)
}
}
>
<
LegendItem
color
=
{
color
}
label
=
"Actif"
opacity
=
"0.8"
/>
<
LegendItem
color
=
{
color2
}
label
=
"Inactif"
opacity
=
"0.5"
/>
</
div
>
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment