Commit f9381c84 authored by Matija Obreza's avatar Matija Obreza
Browse files

Helper text on CropSelector

parent 8a4d1444
......@@ -29,6 +29,11 @@
"vocabulary_plural": "Controlled vocabularies",
"metadata": "Record metadata"
},
"m": {
"crop": {
"helper": "Contact helpdesk@genesys-pgr.org to register additional crops."
}
},
"menu": {
"Accessions": "Accessions",
"Controlled vocabularies": "Controlled vocabularies",
......
import * as React from 'react';
import { translate } from 'react-i18next';
import Grid from 'material-ui/Grid';
import { FormControlLabel, FormLabel, FormControl } from 'material-ui/Form';
import { FormControlLabel, FormLabel, FormControl, FormHelperText } from 'material-ui/Form';
import Checkbox from 'material-ui/Checkbox';
import {Crop} from 'model/crop.model';
interface ICropSelectorProps extends React.ClassAttributes<any> {
t: any;
crops: Crop[];
fields: any;
onSave: () => void;
......@@ -24,9 +27,10 @@ const handleChange = (fields, onSave, code) => () => {
onSave();
};
const CropSelector = ({fields, crops, onSave, label}: ICropSelectorProps) => crops && (
const CropSelector = ({t, fields, crops, onSave, label}: ICropSelectorProps) => crops && (
<FormControl fullWidth>
<FormLabel>{ label }</FormLabel>
<FormHelperText>{ t('m.crop.helper') }</FormHelperText>
<Grid container>
{
crops.sort((a, b) => a.title.localeCompare(b.title)).map((crop: Crop) => (
......@@ -48,4 +52,4 @@ const CropSelector = ({fields, crops, onSave, label}: ICropSelectorProps) => cro
</FormControl>
);
export default CropSelector;
export default translate()(CropSelector);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment