Commit 1da99dcb authored by Nina Willems's avatar Nina Willems

[client/timeserie] map legend classNames

parent 5eea0b7c
import { DIV, H2 } from 'sdi/components/elements';
import tr from 'sdi/locale';
import { nameToString } from 'sdi/components/button/names';
import { getLevel } from 'timeserie/src/queries/timeserie';
import { Level } from 'timeserie/src/events/route';
const isSelected = (legendLevel: Level) =>
getLevel().fold('selected', level =>
(level === legendLevel) ? 'selected' : 'unselected'
)
const renderSurface = () =>
DIV(
{ className: 'legend-item' },
{ className: `legend-item--${isSelected('surface')}` },
DIV(
{
className: 'item-style',
......@@ -20,7 +28,7 @@ const renderSurface = () =>
const renderGroundQuality = () =>
DIV(
{ className: 'legend-item' },
{ className: `legend-item--${isSelected('ground')}` },
DIV(
{
className: 'item-style',
......@@ -36,7 +44,7 @@ const renderGroundQuality = () =>
const renderGroundQuantity = () =>
DIV(
{ className: 'legend-item' },
{ className: `legend-item--${isSelected('ground')}` },
DIV(
{
className: 'item-style',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment