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

create ts file on RedirectedAlert

Kami-jo 3 лет назад
Родитель
Сommit
b016049205
1 измененных файлов с 9 добавлено и 10 удалено
  1. 9 10
      packages/app/src/components/Page/RedirectedAlert.tsx

+ 9 - 10
packages/app/src/components/Page/RedirectedAlert.jsx → packages/app/src/components/Page/RedirectedAlert.tsx

@@ -1,10 +1,13 @@
-import React from 'react';
-import PropTypes from 'prop-types';
-import { withTranslation } from 'react-i18next';
+import React, { FC } from 'react';
 
+import { useTranslation } from 'react-i18next';
 
-const RedirectedAlert = (props) => {
-  const { t } = props;
+type Props = {
+
+}
+
+const RedirectedAlert: FC<Props> = () => {
+  const { t } = useTranslation();
   const urlParams = new URLSearchParams(window.location.search);
   const fromPath = urlParams.get('redirectFrom');
 
@@ -15,8 +18,4 @@ const RedirectedAlert = (props) => {
   );
 };
 
-RedirectedAlert.propTypes = {
-  t: PropTypes.func.isRequired, // i18next
-};
-
-export default withTranslation()(RedirectedAlert);
+export default RedirectedAlert;