Reformat like data entry

This commit is contained in:
Maciej Ziarkowski 2021-08-12 21:11:00 +01:00
parent 806e1f6e74
commit a0da41fa92

View File

@ -15,18 +15,27 @@ interface LikeDataEntryProps {
const LikeDataEntry: React.FunctionComponent<LikeDataEntryProps> = (props) => { const LikeDataEntry: React.FunctionComponent<LikeDataEntryProps> = (props) => {
const data_string = JSON.stringify({like: true}); const data_string = JSON.stringify({like: true});
return ( return (
<Fragment> <>
<div className="data-title"> <div className="data-title">
<Tooltip text="People who like the building and think it contributes to the city." /> <div className="data-title-actions icon-buttons">
<div className="icon-buttons">
<NavLink <NavLink
to={`/multi-edit/${Category.Community}?data=${data_string}`} to={`/multi-edit/${Category.Community}?data=${data_string}`}
className="icon-button like"> className="icon-button like">
Like more Like more
</NavLink> </NavLink>
<Tooltip text="People who like the building and think it contributes to the city." />
</div> </div>
<label>Number of likes</label> <label>Like</label>
</div> </div>
<label className="form-check-label">
<input className="form-check-input" type="checkbox"
name="like"
checked={!!props.userLike}
disabled={props.mode === 'view'}
onChange={e => props.onLike(e.target.checked)}
/>
I like this building and think it contributes to the city
</label>
<p> <p>
{ {
(props.totalLikes != null)? (props.totalLikes != null)?
@ -36,16 +45,7 @@ const LikeDataEntry: React.FunctionComponent<LikeDataEntryProps> = (props) => {
: "0 people like this building so far - you could be the first!" : "0 people like this building so far - you could be the first!"
} }
</p> </p>
<label className="form-check-label"> </>
<input className="form-check-input" type="checkbox"
name="like"
checked={!!props.userLike}
disabled={props.mode === 'view'}
onChange={e => props.onLike(e.target.checked)}
/>
I like this building and think it contributes to the city!
</label>
</Fragment>
); );
}; };