colouring-montreal/app/src/frontend/building/data-components/user-opinion-data-entry.tsx
Mateusz Konieczny ee16977b66 Hide prominent display of likes counts
it remains accessible from map (approximate values) and from history tag of given object
removal is motivated by desire to avoid misleading "0 people likes this building" - true about database state but not true about world in general
exact phrasing is also a bit problematic in general
2022-01-31 17:56:28 +01:00

39 lines
1.1 KiB
TypeScript

import React, { Fragment } from 'react';
import { NavLink } from 'react-router-dom';
import { CopyProps } from '../data-containers/category-view-props';
import { DataTitleCopyable } from './data-title';
interface UserOpinionEntryProps {
slug: string;
title: string;
mode: 'view' | 'edit' | 'multi-edit';
userValue: boolean;
copy: CopyProps;
onChange: (key: string, value: boolean) => void;
}
const UserOpinionEntry: React.FunctionComponent<UserOpinionEntryProps> = (props) => {
return (
<>
<DataTitleCopyable
slug={props.slug}
title={props.title}
copy={props.copy}
/>
<label className="form-check-label">
<input className="form-check-input" type="checkbox"
name={props.slug}
checked={!!props.userValue}
disabled={props.mode === 'view'}
onChange={e => props.onChange(props.slug, e.target.checked)}
/> Yes
</label>
</>
);
};
export default UserOpinionEntry;