From e6f906dbb565abdb29297ec67db3c922135c628c Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 2 Sep 2021 23:20:12 -0700 Subject: Migrate components --- modern/src/attributes/AddAttributeDialog.js | 4 +++- modern/src/attributes/EditAttributesView.js | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'modern/src/attributes') diff --git a/modern/src/attributes/AddAttributeDialog.js b/modern/src/attributes/AddAttributeDialog.js index 3d392fd..4669ba0 100644 --- a/modern/src/attributes/AddAttributeDialog.js +++ b/modern/src/attributes/AddAttributeDialog.js @@ -4,9 +4,11 @@ import { } from '@material-ui/core'; import { Autocomplete, createFilterOptions } from '@material-ui/lab'; -import t from '../LocalizationProvider'; +import { useTranslation } from '../LocalizationProvider'; const AddAttributeDialog = ({ open, onResult, definitions }) => { + const t = useTranslation(); + const filter = createFilterOptions({ stringify: (option) => option.name, }); diff --git a/modern/src/attributes/EditAttributesView.js b/modern/src/attributes/EditAttributesView.js index 68395d9..e8ab83e 100644 --- a/modern/src/attributes/EditAttributesView.js +++ b/modern/src/attributes/EditAttributesView.js @@ -5,8 +5,8 @@ import { } from '@material-ui/core'; import CloseIcon from '@material-ui/icons/Close'; import AddIcon from '@material-ui/icons/Add'; -import t from '../LocalizationProvider'; import AddAttributeDialog from './AddAttributeDialog'; +import { useTranslation } from '../LocalizationProvider'; const useStyles = makeStyles((theme) => ({ addButton: { @@ -20,6 +20,7 @@ const useStyles = makeStyles((theme) => ({ const EditAttributesView = ({ attributes, setAttributes, definitions }) => { const classes = useStyles(); + const t = useTranslation(); const [addDialogShown, setAddDialogShown] = useState(false); -- cgit v1.2.3