Show list of fields in overview

This commit is contained in:
Tom Russell 2019-04-04 13:16:04 +01:00
parent 07904e354d
commit 9217a21282

View File

@ -1,4 +1,4 @@
import React from 'react';
import React, { Fragment } from 'react';
import { NavLink, Redirect } from 'react-router-dom';
import Sidebar from './sidebar';
@ -33,6 +33,8 @@ const Overview = (props) => {
const OverviewSection = (props) => {
const match = props.data_layer === props.slug;
const inactive = props.inactive;
console.log(props.fields);
return (
<section className={(inactive? "inactive ": "") + "data-section legend"}>
<header className={`section-header ${props.mode} ${props.slug} ${(match? "active" : "")}`}>
@ -64,7 +66,18 @@ const OverviewSection = (props) => {
</header>
{
(match && props.intro)?
(<p className="data-intro">{props.intro}</p>)
(
<Fragment>
<p className="data-intro">{props.intro}</p>
<ul>
{
props.fields.map((field) => {
return (<li>{field.title}</li>)
})
}
</ul>
</Fragment>
)
: null
}
</section>