Tweak style and text of user opinion aggregations

This commit is contained in:
Maciej Ziarkowski 2021-09-30 15:51:20 +01:00
parent d438dc2189
commit d3a17f2e5f
2 changed files with 23 additions and 10 deletions

View File

@ -34,15 +34,28 @@ const UserOpinionEntry: React.FunctionComponent<UserOpinionEntryProps> = (props)
onChange={e => props.onChange(props.slug, e.target.checked)} onChange={e => props.onChange(props.slug, e.target.checked)}
/> Yes /> Yes
</label> </label>
<p> <div>
<label>
<span style={{fontStyle: 'italic'}}>
{ {
(props.aggregateValue)? (props.aggregateValue)?
(props.aggregateValue === 1)? (props.aggregateValue === 1)?
`1 person ${props.aggregationDescriptions.one}` `1 person `
: `${props.aggregateValue} people ${props.aggregationDescriptions.many}` : `${props.aggregateValue} people `
: `0 people ${props.aggregationDescriptions.zero}` : `0 people so far `
} }
</p> </span>
<span>
{
(props.aggregateValue)?
(props.aggregateValue === 1)?
props.aggregationDescriptions.one
: props.aggregationDescriptions.many
: props.aggregationDescriptions.zero
}
</span>
</label>
</div>
</> </>
); );
}; };

View File

@ -522,7 +522,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
example: 100, example: 100,
tooltip: "People who like the building and think it contributes to the city.", tooltip: "People who like the building and think it contributes to the city.",
aggregationDescriptions: { aggregationDescriptions: {
zero: "like this building so far", zero: "like this building",
one: "likes this building", one: "likes this building",
many: "like this building" many: "like this building"
} }