Use Fragment instead of dl wrapper

This commit is contained in:
Tom Russell 2019-08-23 14:09:23 +01:00
parent 51d8ac3ed7
commit 7d3e59a0ed
6 changed files with 16 additions and 16 deletions

View File

@ -1,4 +1,4 @@
import React from 'react';
import React, { Fragment } from 'react';
import withCopyEdit from '../data-container';
import DataEntry from '../data-components/data-entry';
@ -7,7 +7,7 @@ import DataEntry from '../data-components/data-entry';
* Age view/edit section
*/
const AgeView = (props) => (
<dl className="data-list">
<Fragment>
<DataEntry
title="Year built (best estimate)"
slug="date_year"
@ -76,7 +76,7 @@ const AgeView = (props) => (
tooltip="URL for age and date reference"
// "placeholder": "https://..."
/>
</dl>
</Fragment>
)
const AgeContainer = withCopyEdit(AgeView);

View File

@ -1,4 +1,4 @@
import React from 'react';
import React, { Fragment } from 'react';
import withCopyEdit from '../data-container';
import LikeDataEntry from '../data-components/like-data-entry';
@ -7,12 +7,12 @@ import LikeDataEntry from '../data-components/like-data-entry';
* Like view/edit section
*/
const LikeView = (props) => (
<dl className="data-list">
<Fragment>
<LikeDataEntry
value={props.building.likes_total}
user_building_like={props.building_like}
/>
</dl>
</Fragment>
)
const LikeContainer = withCopyEdit(LikeView);

View File

@ -8,7 +8,7 @@ import InfoBox from '../../components/info-box';
const LocationView = (props) => (
<Fragment>
<InfoBox msg="Text-based address fields are disabled at the moment. We're looking into how best to collect this data." />
<dl className="data-list">
<Fragment>
<DataEntry
title="Building Name"
slug="location_name"
@ -122,7 +122,7 @@ const LocationView = (props) => (
// "step": 0.0001,
// "placeholder": 0
}
</dl>
</Fragment>
</Fragment>
)
const LocationContainer = withCopyEdit(LocationView);

View File

@ -1,4 +1,4 @@
import React from 'react';
import React, { Fragment } from 'react';
import withCopyEdit from '../data-container';
import DataEntry from '../data-components/data-entry';
@ -7,7 +7,7 @@ import DataEntry from '../data-components/data-entry';
* Planning view/edit section
*/
const PlanningView = (props) => (
<dl className="data-list">
<Fragment>
<DataEntry
title="Planning portal link"
slug="planning_portal_link"
@ -213,7 +213,7 @@ const PlanningView = (props) => (
{
// "type": "text"
}
</dl>
</Fragment>
)
const PlanningContainer = withCopyEdit(PlanningView);

View File

@ -1,4 +1,4 @@
import React from 'react';
import React, { Fragment } from 'react';
import withCopyEdit from '../data-container';
import DataEntry from '../data-components/data-entry';
@ -7,7 +7,7 @@ import DataEntry from '../data-components/data-entry';
* Size view/edit section
*/
const SizeView = (props) => (
<dl className="data-list">
<Fragment>
<DataEntry
title="Core storeys"
slug="size_storeys_core"
@ -145,7 +145,7 @@ const SizeView = (props) => (
// "Other"
// ]
}
</dl>
</Fragment>
)
const SizeContainer = withCopyEdit(SizeView);

View File

@ -41,14 +41,14 @@ const MultiEdit = (props) => {
<header className={`section-header view ${cat} active`}>
<a><h3 className="h3">{title}</h3></a>
</header>
<dl className='data-list'>
<Fragment>
{
Object.keys(data).map((key => {
const label = fieldTitleFromSlug(key);
return <DataEntry key={key} label={label} value={data[key]}/>
}))
}
</dl>
</Fragment>
<form className='buttons-container'>
<InfoBox msg='Click buildings to colour using the data above' />