mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-19 13:00:51 -04:00
fix(client): import TFunction from i18next in profile componenets (#49814)
* fix(client): import TFunction from i18next * Import Tfunction as type * swap tFuntion with the hook when possilbe
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React, { ReactNode, useEffect } from 'react';
|
||||
import Helmet from 'react-helmet';
|
||||
import { TFunction, withTranslation } from 'react-i18next';
|
||||
import { useTranslation, withTranslation } from 'react-i18next';
|
||||
import { connect } from 'react-redux';
|
||||
import { bindActionCreators, Dispatch } from 'redux';
|
||||
import { createSelector } from 'reselect';
|
||||
@@ -104,7 +104,6 @@ interface DefaultLayoutProps extends StateProps, DispatchProps {
|
||||
block?: string;
|
||||
showCodeAlly: boolean;
|
||||
superBlock?: string;
|
||||
t: TFunction;
|
||||
}
|
||||
|
||||
const getSystemTheme = () =>
|
||||
@@ -127,13 +126,13 @@ function DefaultLayout({
|
||||
isChallenge = false,
|
||||
block,
|
||||
superBlock,
|
||||
t,
|
||||
theme = Themes.Default,
|
||||
showCodeAlly,
|
||||
user,
|
||||
fetchUser,
|
||||
updateAllChallengesInfo
|
||||
}: DefaultLayoutProps): JSX.Element {
|
||||
const { t } = useTranslation();
|
||||
const { challengeEdges, certificateNodes } = useGetAllBlockIds();
|
||||
useEffect(() => {
|
||||
// componentDidMount
|
||||
|
||||
@@ -6,7 +6,8 @@ import {
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { Col, Row } from '@freecodecamp/react-bootstrap';
|
||||
import React from 'react';
|
||||
import { TFunction, useTranslation } from 'react-i18next';
|
||||
import type { TFunction } from 'i18next';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import envData from '../../../../../config/env.json';
|
||||
import { getLangCode } from '../../../../../config/i18n';
|
||||
|
||||
@@ -7,7 +7,8 @@ import addMonths from 'date-fns/addMonths';
|
||||
import isEqual from 'date-fns/isEqual';
|
||||
import startOfDay from 'date-fns/startOfDay';
|
||||
import React, { Component } from 'react';
|
||||
import { TFunction, useTranslation } from 'react-i18next';
|
||||
import type { TFunction } from 'i18next';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import ReactTooltip from 'react-tooltip';
|
||||
|
||||
import '@freecodecamp/react-calendar-heatmap/dist/styles.css';
|
||||
|
||||
@@ -3,7 +3,8 @@ import Loadable from '@loadable/component';
|
||||
import { graphql, useStaticQuery } from 'gatsby';
|
||||
import { reverse, sortBy } from 'lodash-es';
|
||||
import React, { useMemo, useState } from 'react';
|
||||
import { TFunction, withTranslation } from 'react-i18next';
|
||||
import type { TFunction } from 'i18next';
|
||||
import { withTranslation } from 'react-i18next';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import envData from '../../../../../config/env.json';
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { Grid, Row } from '@freecodecamp/react-bootstrap';
|
||||
import React from 'react';
|
||||
import Helmet from 'react-helmet';
|
||||
import { TFunction, useTranslation } from 'react-i18next';
|
||||
import type { TFunction } from 'i18next';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { FullWidthRow, Link, Spacer } from '../helpers';
|
||||
import { User } from './../../redux/prop-types';
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { isEqual } from 'lodash-es';
|
||||
import React, { Component } from 'react';
|
||||
import { HotKeys, ObserveKeys } from 'react-hotkeys';
|
||||
import { TFunction, withTranslation } from 'react-i18next';
|
||||
import type { TFunction } from 'i18next';
|
||||
import { withTranslation } from 'react-i18next';
|
||||
import { Hit } from 'react-instantsearch-core';
|
||||
import { SearchBox } from 'react-instantsearch-dom';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
Reference in New Issue
Block a user