feat: 添加组件库多语言
This commit is contained in:
parent
0bfc695bf3
commit
91807a2e3e
|
|
@ -1125,5 +1125,6 @@
|
|||
"possess LP": "持有LP",
|
||||
"capital pool": "资金池",
|
||||
"Unclaimed income": "待领取收益",
|
||||
"pledge": "质押"
|
||||
"pledge": "质押",
|
||||
"Invite": "邀请"
|
||||
}
|
||||
|
|
|
|||
92
src/App.tsx
92
src/App.tsx
|
|
@ -1,6 +1,6 @@
|
|||
import React, { lazy, useEffect } from 'react'
|
||||
import { Router, Redirect, Route, Switch } from 'react-router-dom'
|
||||
import { ResetCSS } from '@pancakeswap/uikit'
|
||||
import { ResetCSS, ConfigProvider } from '@pancakeswap/uikit'
|
||||
import { useDispatch } from 'react-redux'
|
||||
import BigNumber from 'bignumber.js'
|
||||
import useEagerConnect from 'hooks/useEagerConnect'
|
||||
|
|
@ -10,6 +10,7 @@ import { initAxios } from 'utils/request'
|
|||
import useToast from 'hooks/useToast'
|
||||
import { useAccountEventListener } from 'hooks/useAccountEventListener'
|
||||
import { fetchUserInfo, clearUserInfo } from 'state/actions'
|
||||
import { useTranslation } from 'contexts/Localization'
|
||||
import { useAccount } from 'state/userInfo/hooks'
|
||||
import GlobalStyle from './style/Global'
|
||||
import Menu from './components/Menu'
|
||||
|
|
@ -70,6 +71,7 @@ const App: React.FC = () => {
|
|||
const dispatch = useDispatch()
|
||||
const toast = useToast()
|
||||
const account = useAccount()
|
||||
const { t } = useTranslation()
|
||||
|
||||
useEffect(() => {
|
||||
initAxios(() => {
|
||||
|
|
@ -81,37 +83,38 @@ const App: React.FC = () => {
|
|||
}, [account])
|
||||
|
||||
return (
|
||||
<Router history={history}>
|
||||
<ResetCSS />
|
||||
<GlobalStyle />
|
||||
<Menu>
|
||||
<SuspenseWithChunkError fallback={<PageLoader />}>
|
||||
<Switch>
|
||||
<Route path="/" exact>
|
||||
<Home />
|
||||
</Route>
|
||||
<Route exact path="/farms/auction">
|
||||
<FarmAuction />
|
||||
</Route>
|
||||
<Route path="/farms">
|
||||
<Farms />
|
||||
</Route>
|
||||
<Route path="/pools">
|
||||
<Pools />
|
||||
</Route>
|
||||
<Route path="/referral">
|
||||
<Referral />
|
||||
</Route>
|
||||
<Route path="/board">
|
||||
<Board />
|
||||
</Route>
|
||||
<Route path="/nft">
|
||||
<Nft />
|
||||
</Route>
|
||||
<Route path="/announcement">
|
||||
<Announcement />
|
||||
</Route>
|
||||
{/* <Route path="/lottery">
|
||||
<ConfigProvider t={t}>
|
||||
<Router history={history}>
|
||||
<ResetCSS />
|
||||
<GlobalStyle />
|
||||
<Menu>
|
||||
<SuspenseWithChunkError fallback={<PageLoader />}>
|
||||
<Switch>
|
||||
<Route path="/" exact>
|
||||
<Home />
|
||||
</Route>
|
||||
<Route exact path="/farms/auction">
|
||||
<FarmAuction />
|
||||
</Route>
|
||||
<Route path="/farms">
|
||||
<Farms />
|
||||
</Route>
|
||||
<Route path="/pools">
|
||||
<Pools />
|
||||
</Route>
|
||||
<Route path="/referral">
|
||||
<Referral />
|
||||
</Route>
|
||||
<Route path="/board">
|
||||
<Board />
|
||||
</Route>
|
||||
<Route path="/nft">
|
||||
<Nft />
|
||||
</Route>
|
||||
<Route path="/announcement">
|
||||
<Announcement />
|
||||
</Route>
|
||||
{/* <Route path="/lottery">
|
||||
<Lottery />
|
||||
</Route>
|
||||
<Route path="/ifo">
|
||||
|
|
@ -146,7 +149,7 @@ const App: React.FC = () => {
|
|||
</Route>
|
||||
|
||||
{/* Using this format because these components use routes injected props. We need to rework them with hooks */}
|
||||
{/* <Route exact strict path="/swap" component={Swap} />
|
||||
{/* <Route exact strict path="/swap" component={Swap} />
|
||||
<Route exact strict path="/swap/:outputCurrency" component={RedirectToSwap} />
|
||||
<Route exact strict path="/send" component={RedirectPathToSwapOnly} />
|
||||
<Route exact strict path="/find" component={PoolFinder} />
|
||||
|
|
@ -163,8 +166,8 @@ const App: React.FC = () => {
|
|||
<Route exact strict path="/nft" component={Nft} />
|
||||
<Route exact strict path="/announcement" component={Announcement} /> */}
|
||||
|
||||
{/* Redirect */}
|
||||
{/* <Route path="/staking">
|
||||
{/* Redirect */}
|
||||
{/* <Route path="/staking">
|
||||
<Redirect to="/pools" />
|
||||
</Route>
|
||||
<Route path="/syrup">
|
||||
|
|
@ -174,15 +177,16 @@ const App: React.FC = () => {
|
|||
<Redirect to="/collectibles" />
|
||||
</Route> */}
|
||||
|
||||
{/* 404 */}
|
||||
<Route component={NotFound} />
|
||||
</Switch>
|
||||
</SuspenseWithChunkError>
|
||||
</Menu>
|
||||
<EasterEgg iterations={2} />
|
||||
<ToastListener />
|
||||
<DatePickerPortal />
|
||||
</Router>
|
||||
{/* 404 */}
|
||||
<Route component={NotFound} />
|
||||
</Switch>
|
||||
</SuspenseWithChunkError>
|
||||
</Menu>
|
||||
<EasterEgg iterations={2} />
|
||||
<ToastListener />
|
||||
<DatePickerPortal />
|
||||
</Router>
|
||||
</ConfigProvider>
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue