-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove react-router references Correct window checking 2
(Remove WalletRoutes after fix faceyspacey/extract-css-chunks-webpack-plugin#222)
- Loading branch information
1 parent
2ade3a7
commit 79da9f4
Showing
16 changed files
with
28 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 0 additions & 21 deletions
21
packages/social-trader/src/pages/dashboard/dashboard.routes.tsx
This file was deleted.
Oops, something went wrong.
16 changes: 3 additions & 13 deletions
16
...ages/social-trader/src/pages/invest/funds/fund-settings/services/fund-settings.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,6 @@ | ||
import { push } from "connected-react-router"; | ||
import Router from "next/router"; | ||
import { Dispatch } from "redux"; | ||
import { | ||
FUND_DETAILS_ROUTE, | ||
FUNDS_ROUTE, | ||
FUNDS_SLUG_URL_PARAM_NAME | ||
} from "routes/funds.routes"; | ||
import getParams from "utils/get-params"; | ||
import { FUNDS_ROUTE } from "routes/funds.routes"; | ||
|
||
export const redirectToFund = () => (dispatch: Dispatch) => { | ||
const fundSlugUrl = getParams(Router.pathname, FUND_DETAILS_ROUTE)[ | ||
FUNDS_SLUG_URL_PARAM_NAME | ||
]; | ||
dispatch(push(`${FUNDS_ROUTE}/${fundSlugUrl}`)); | ||
export const redirectToFund = (id: string) => { | ||
Router.replace(`${FUNDS_ROUTE}/${id}`); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 0 additions & 38 deletions
38
packages/social-trader/src/pages/profile/profile.routes.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { composeUrl } from "utils/compose-url"; | ||
|
||
export const WALLET_TOTAL_PAGE_NAME = "wallet"; | ||
export const WALLET_TOTAL_PAGE_ROUTE = `/${WALLET_TOTAL_PAGE_NAME}`; | ||
export const CURRENCY_SLUG = ":currency"; | ||
export const WALLET_CURRENCY_PAGE_ROUTE = `${WALLET_TOTAL_PAGE_ROUTE}/${CURRENCY_SLUG}`; | ||
|
||
export const WALLET_CURRENCY_FOLDER_ROUTE = `${WALLET_TOTAL_PAGE_ROUTE}/[id]`; | ||
|
||
export const composeWalletCurrencyUrl = composeUrl( | ||
WALLET_CURRENCY_PAGE_ROUTE, | ||
CURRENCY_SLUG | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,23 @@ | ||
import NotFoundPage from "components/not-found/not-found"; | ||
import * as React from "react"; | ||
import { useEffect } from "react"; | ||
import { useDispatch, useSelector } from "react-redux"; | ||
import { RouteComponentProps } from "react-router"; | ||
import { Route, Switch } from "react-router-dom"; | ||
import { currencySelector } from "reducers/account-settings-reducer"; | ||
import { composeUrl } from "utils/compose-url"; | ||
|
||
import WalletCurrencyContainer from "./components/wallet-currency.container"; | ||
import WalletTotalContainer from "./components/wallet-total-container"; | ||
import { fetchWallets } from "./services/wallet.services"; | ||
|
||
export const WALLET_TOTAL_PAGE_NAME = "wallet"; | ||
export const WALLET_TOTAL_PAGE_ROUTE = `/${WALLET_TOTAL_PAGE_NAME}`; | ||
export const CURRENCY_SLUG = ":currency"; | ||
export const WALLET_CURRENCY_PAGE_ROUTE = `${WALLET_TOTAL_PAGE_ROUTE}/${CURRENCY_SLUG}`; | ||
|
||
export const WALLET_CURRENCY_FOLDER_ROUTE = `${WALLET_TOTAL_PAGE_ROUTE}/[id]`; | ||
|
||
export const composeWalletCurrencyUrl = composeUrl( | ||
WALLET_CURRENCY_PAGE_ROUTE, | ||
CURRENCY_SLUG | ||
); | ||
|
||
interface DispatchProps { | ||
fetchWallets(): void; | ||
} | ||
|
||
interface RouteProps {} | ||
|
||
export interface WalletRouteProps extends RouteComponentProps<RouteProps> {} | ||
|
||
const _WalletRoutes: React.FC<DispatchProps> = () => { | ||
const currency = useSelector(currencySelector); | ||
const dispatch = useDispatch(); | ||
useEffect(() => { | ||
dispatch(fetchWallets(currency)); | ||
}, [currency]); | ||
return ( | ||
<Switch> | ||
<Route | ||
exact | ||
path={WALLET_TOTAL_PAGE_ROUTE} | ||
component={WalletTotalContainer} | ||
/> | ||
<Route | ||
path={WALLET_CURRENCY_PAGE_ROUTE} | ||
component={WalletCurrencyContainer} | ||
/> | ||
<Route component={NotFoundPage} /> | ||
</Switch> | ||
); | ||
}; | ||
|
||
const WalletRoutes = React.memo(_WalletRoutes); | ||
export default WalletRoutes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.