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

remove useTranslation and propTypes from ErrorViewer

yohei0125 3 лет назад
Родитель
Сommit
27070ebe59

+ 1 - 13
packages/app/src/components/Admin/ImportData/GrowiArchive/ErrorViewer.tsx

@@ -1,7 +1,5 @@
 import React from 'react';
 
-import PropTypes from 'prop-types';
-import { useTranslation } from 'react-i18next';
 import { Modal, ModalHeader, ModalBody } from 'reactstrap';
 
 type ErrorViewerProps = {
@@ -9,9 +7,8 @@ type ErrorViewerProps = {
   errors: any[],
   onClose: () => void,
 }
-const ErrorViewer = (props: ErrorViewerProps): JSX.Element => {
-  const { t } = useTranslation();
 
+const ErrorViewer = (props: ErrorViewerProps): JSX.Element => {
   const { errors } = props;
 
   let value = '(no errors)';
@@ -34,13 +31,4 @@ const ErrorViewer = (props: ErrorViewerProps): JSX.Element => {
   );
 };
 
-ErrorViewer.propTypes = {
-  t: PropTypes.func.isRequired, // i18next
-
-  isOpen: PropTypes.bool.isRequired,
-  onClose: PropTypes.func.isRequired,
-
-  errors: PropTypes.arrayOf(PropTypes.object),
-};
-
 export default ErrorViewer;