Update style, enable subtitle in legend

This commit is contained in:
Maciej Ziarkowski 2020-07-16 16:22:11 +02:00
parent 2c9335c1eb
commit e544e54583
2 changed files with 23 additions and 5 deletions

View File

@ -80,10 +80,14 @@
display: inline-block;
width: 1.3rem;
height: 1.3rem;
text-indent: -30px;
margin: 0.125rem 0.5rem 0.125rem 0;
margin-right: 0.3rem;
vertical-align: middle;
overflow: hidden;
border: solid 1px #ddd;
}
.data-legend h6 {
margin-top: 5px;
}
.map-legend .data-intro {
padding: 0 0.5rem;

View File

@ -216,14 +216,28 @@ class Legend extends React.Component<LegendProps, LegendState> {
<p className='legend-disclaimer'>{details.disclaimer}</p>
}
{
elements.map((item) => (
elements.map((item) => {
if(item.subtitle != undefined) {
return (<li key={item.subtitle}>
<h6>{item.subtitle}</h6>
</li>);
}
return (
<li key={item.color} >
<span className="key" style={ { background: item.color, border: item.border } }>-</span>
<tr>
<td>
<div className="key" style={ { background: item.color, border: item.border } }></div>
</td>
<td>
{ item.text }
</td>
</tr>
</li>
))
);
})
}
</ul>
: <p className="data-intro">Coming soon</p>