RenamedAlert.jsx 573 B

12345678910111213141516171819202122
  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import { withTranslation } from 'react-i18next';
  4. const RenamedAlert = (props) => {
  5. const { t } = props;
  6. const urlParams = new URLSearchParams(window.location.search);
  7. const fromPath = urlParams.get('renamedFrom');
  8. return (
  9. <>
  10. <strong>{ t('Moved') }:</strong> {t('page_page.notice.moved')} <code>{fromPath}</code> {t('page_page.notice.moved_period')}
  11. </>
  12. );
  13. };
  14. RenamedAlert.propTypes = {
  15. t: PropTypes.func.isRequired, // i18next
  16. };
  17. export default withTranslation()(RenamedAlert);