diff --git a/package.json b/package.json index dbfd793..cf47277 100644 --- a/package.json +++ b/package.json @@ -64,14 +64,12 @@ "eslint-config-react-app": "6", "ethers": "^5.5.4", "graphql": "^16.3.0", - "i18next": "^21.3.2", "javascript-time-ago": "^2.3.11", "ramda": "^0.27.1", "react": "^17.0.2", "react-cookie": "^4.1.1", "react-dom": "^17.0.2", "react-flow-renderer": "^10.3.1", - "react-i18next": "^11.18.1", "react-loading-skeleton": "^3.1.0", "react-modal": "3.12.1", "react-popper": "^2.3.0", diff --git a/src/components/banks/ApproveToken/index.tsx b/src/components/banks/ApproveToken/index.tsx index eafe21c..00aabc0 100644 --- a/src/components/banks/ApproveToken/index.tsx +++ b/src/components/banks/ApproveToken/index.tsx @@ -1,7 +1,6 @@ import React, { FC } from 'react'; import { Button } from 'components/common/Button'; import { LoadingWrapper } from 'components/common/LoadingWrapper'; -import { useTranslation } from 'react-i18next'; import styles from './styles.module.scss'; type Props = { @@ -10,12 +9,10 @@ type Props = { }; export const ApproveToken: FC = ({ isLoadingApprove, onApproveClick }) => { - const { t } = useTranslation(); - return (
-
); diff --git a/src/components/banks/Deposit/index.tsx b/src/components/banks/Deposit/index.tsx index 8a5812e..c14e60a 100644 --- a/src/components/banks/Deposit/index.tsx +++ b/src/components/banks/Deposit/index.tsx @@ -5,7 +5,6 @@ import { ApproveToken } from 'components/banks/ApproveToken'; import { LoadingWrapper } from 'components/common/LoadingWrapper'; import { EtherscanLink } from 'components/banks/EtherScanLink'; import { Button } from 'components/common/Button'; -import { useTranslation } from 'react-i18next'; import styles from './styles.module.scss'; type Props = { @@ -34,7 +33,6 @@ export const Deposit: FC = ({ error, }) => { const needsUnlock = +vaultData.depositAmount > +bank.collateralToken.unlockedAmount && !localApproved; - const { t } = useTranslation(); return ( <> @@ -42,9 +40,7 @@ export const Deposit: FC = ({

- {`${t('How much')} ${vaultData.collateralToken} ${t( - 'do you want to lock up as collateral?', - )}`} + {`${'How much'} ${vaultData.collateralToken} ${'do you want to lock up as collateral?'}`}

= ({ {needsUnlock ? ( <>

- {t('Please give allowance for your collateral to continue.')} + {'Please give allowance for your collateral to continue.'}

) : null}
-
diff --git a/src/components/banks/EtherScanLink/index.tsx b/src/components/banks/EtherScanLink/index.tsx index b76ff81..8c32255 100644 --- a/src/components/banks/EtherScanLink/index.tsx +++ b/src/components/banks/EtherScanLink/index.tsx @@ -1,6 +1,5 @@ import React, { FC } from 'react'; import cx from 'classnames'; -import { useTranslation } from 'react-i18next'; import styles from './styles.module.scss'; type Props = { @@ -26,12 +25,11 @@ export const EtherscanLink: FC = ({ path, hash, className }) => { } } }; - const { t } = useTranslation(); return (
- {t('view on Polygonscan')} + {'view on Polygonscan'}
); diff --git a/src/components/banks/SignInButton/index.tsx b/src/components/banks/SignInButton/index.tsx index ff6e885..62b4250 100644 --- a/src/components/banks/SignInButton/index.tsx +++ b/src/components/banks/SignInButton/index.tsx @@ -2,7 +2,6 @@ import React, { FC } from 'react'; import cx from 'classnames'; import { Button } from 'components/common/Button'; import { FontIcon, FontIconName } from 'components/common/FontIcon'; -import { useTranslation } from 'react-i18next'; import styles from './styles.module.scss'; type Props = { @@ -11,12 +10,10 @@ type Props = { }; export const SignInButton: FC = ({ className, onClick }) => { - const { t } = useTranslation(); - return ( ); }; diff --git a/src/components/common/LoadingPopUp/index.tsx b/src/components/common/LoadingPopUp/index.tsx index 9fd348a..ecce74c 100644 --- a/src/components/common/LoadingPopUp/index.tsx +++ b/src/components/common/LoadingPopUp/index.tsx @@ -1,22 +1,19 @@ import React from 'react'; import { FontIcon, FontIconName } from 'components/common/FontIcon'; -import { useTranslation } from 'react-i18next'; import styles from './styles.module.scss'; export const LoadingPopUp = () => { - const { t } = useTranslation(); - return (
-

{t('Please hold on while we load your information.')}

+

{'Please hold on while we load your information.'}

-

{t('This will only take a few moments')}

+

{'This will only take a few moments'}

); }; diff --git a/src/components/common/TextInput/index.tsx b/src/components/common/TextInput/index.tsx index 11f2b9d..d60d06d 100644 --- a/src/components/common/TextInput/index.tsx +++ b/src/components/common/TextInput/index.tsx @@ -1,6 +1,5 @@ import React, { FC, HTMLProps } from 'react'; import classNames from 'classnames'; -import { useTranslation } from 'react-i18next'; import styles from './styles.module.scss'; import { TextInputWrap } from '../TextInputWrap'; import ButtonNew from '../ButtonNew'; @@ -42,7 +41,6 @@ const TextInput: FC = ({ dontBlockChar = false, ...props }) => { - const { t } = useTranslation(); const blockInvalidChar = (e: any) => ['e', 'E', '+', '-'].includes(e.key) && e.preventDefault(); return ( @@ -68,7 +66,7 @@ const TextInput: FC = ({ onClick={onClickMax} className={styles.max} > - {t('Max')} + {'Max'}
)} diff --git a/src/components/common/WalletButton/index.tsx b/src/components/common/WalletButton/index.tsx index 3e21e76..c0b4fe8 100644 --- a/src/components/common/WalletButton/index.tsx +++ b/src/components/common/WalletButton/index.tsx @@ -5,7 +5,6 @@ import { numFormatter } from 'utils/balances'; import { useDispatch } from 'react-redux'; import { connectWeb3Modal } from 'store/main/actionCreators'; import useENS from 'hooks/useENS'; -import { useTranslation } from 'react-i18next'; import styles from './styles.module.scss'; interface IProps { @@ -16,8 +15,7 @@ interface IProps { export const WalletButton: FC = ({ ricBalance = '', account, mobile }) => { const dispatch = useDispatch(); - const { t } = useTranslation(); - const preConnect = account === t('Connect Wallet'); + const preConnect = account === 'Connect Wallet'; const [connecting, setConnecting] = useState(false); const { ensName, ensAvatar } = useENS(account); //this solution doesn't work properly, examples: if user has pop ups disabled diff --git a/src/components/layout/CoinBalance/index.tsx b/src/components/layout/CoinBalance/index.tsx index bad4268..b7de7ce 100644 --- a/src/components/layout/CoinBalance/index.tsx +++ b/src/components/layout/CoinBalance/index.tsx @@ -1,6 +1,5 @@ import React, { FC } from 'react'; import ButtonNew from 'components/common/ButtonNew'; -import { useTranslation } from 'i18n'; import { Coin, iconsCoin } from '../../../constants/coins'; import styles from './styles.module.scss'; @@ -12,8 +11,6 @@ interface IProps { } export const CoinBalance: FC = ({ nameCoin, balance, className, onClickMax }) => { - const { t } = useTranslation(); - return (
@@ -25,7 +22,7 @@ export const CoinBalance: FC = ({ nameCoin, balance, className, onClickM
{nameCoin}
diff --git a/src/components/layout/InvestNav/index.tsx b/src/components/layout/InvestNav/index.tsx index 8971159..4ddf751 100644 --- a/src/components/layout/InvestNav/index.tsx +++ b/src/components/layout/InvestNav/index.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { FontIcon, FontIconName } from 'components/common/FontIcon'; import { NavLink } from 'react-router-dom'; import { Routes } from 'constants/routes'; -import { useTranslation } from 'react-i18next'; +import currency from 'assets/images/coins/currency.svg'; import { useShallowSelector } from 'hooks/useShallowSelector'; import { selectUserStreams } from 'store/main/selectors'; import gift from 'assets/images/gift.svg'; @@ -11,7 +11,6 @@ import { RICOCHET_LEGACY_LINK, SUPPORT, TUTORIAL_LINK } from 'utils/helpers'; export const InvestNav = () => { const userStreams = useShallowSelector(selectUserStreams); - const { t } = useTranslation(); return (
@@ -24,23 +23,23 @@ export const InvestNav = () => { to={Routes.InvestStreams} > -
{`${t('Active Streams')} (${userStreams.length})`}
+
{`${'Active Streams'} (${userStreams.length})`}
) : null} -
{t('Wallet')}
+
{'Wallet'}
-
{t('Market')}
+
{'Market'}
-
{t('Swap')}
+
{'Swap'}
@@ -51,16 +50,20 @@ export const InvestNav = () => { height="16" style={{ filter: 'invert(1)', marginRight: '3px' }} /> -
{t('Gifts')}
+
{'Gifts'}
+ + currency +
{'Payments'}
+
-
{t('Launchpad')}
+
{'Launchpad'}
{ activeClassName={styles.nav_link_active} > -
{t('Activity')}
+
{'Activity'}
-
{t('Refer')}
+
{'Refer'}
-
{t('Support')}
+
{'Support'}
-
{t('Tutorial')}
+
{'Tutorial'}
+ -
{t('Ricochet V2')}
+
{'Ricochet V2'}
diff --git a/src/components/layout/MobileMenu/index.tsx b/src/components/layout/MobileMenu/index.tsx index 73db56a..2e82358 100644 --- a/src/components/layout/MobileMenu/index.tsx +++ b/src/components/layout/MobileMenu/index.tsx @@ -1,7 +1,6 @@ import React, { FC } from 'react'; import Link from 'components/common/Link'; import { NavLink } from 'react-router-dom'; -import { useTranslation } from 'i18n'; import { Routes } from '../../../constants/routes'; import styles from './styles.module.scss'; import { RICOCHET_LEGACY_LINK } from 'utils/helpers'; @@ -11,7 +10,6 @@ interface IProps { } export const MobileMenu: FC = ({ closeMenu }) => { - const { t } = useTranslation(); return (