Просмотр исходного кода

replace withtranslation for ArcguveFilesTable

yohei0125 3 лет назад
Родитель
Сommit
8d43acb7d6
1 измененных файлов с 12 добавлено и 5 удалено
  1. 12 5
      packages/app/src/components/Admin/ExportArchiveData/ArchiveFilesTable.jsx

+ 12 - 5
packages/app/src/components/Admin/ExportArchiveData/ArchiveFilesTable.jsx

@@ -1,11 +1,13 @@
 import React from 'react';
 import React from 'react';
-import PropTypes from 'prop-types';
-import { withTranslation } from 'react-i18next';
+
 import { format } from 'date-fns';
 import { format } from 'date-fns';
+import PropTypes from 'prop-types';
+import { useTranslation } from 'react-i18next';
 
 
-import { withUnstatedContainers } from '../../UnstatedUtils';
 import AppContainer from '~/client/services/AppContainer';
 import AppContainer from '~/client/services/AppContainer';
 
 
+import { withUnstatedContainers } from '../../UnstatedUtils';
+
 import ArchiveFilesTableMenu from './ArchiveFilesTableMenu';
 import ArchiveFilesTableMenu from './ArchiveFilesTableMenu';
 
 
 class ArchiveFilesTable extends React.Component {
 class ArchiveFilesTable extends React.Component {
@@ -58,9 +60,14 @@ ArchiveFilesTable.propTypes = {
   onZipFileStatRemove: PropTypes.func.isRequired,
   onZipFileStatRemove: PropTypes.func.isRequired,
 };
 };
 
 
+const ArchiveFilesTableWrapperFC = (props) => {
+  const { t } = useTranslation();
+  return <ArchiveFilesTable t={t} {...props} />;
+};
+
 /**
 /**
  * Wrapper component for using unstated
  * Wrapper component for using unstated
  */
  */
-const ArchiveFilesTableWrapper = withUnstatedContainers(ArchiveFilesTable, [AppContainer]);
+const ArchiveFilesTableWrapper = withUnstatedContainers(ArchiveFilesTableWrapperFC, [AppContainer]);
 
 
-export default withTranslation()(ArchiveFilesTableWrapper);
+export default ArchiveFilesTableWrapper;