From d5eb67e374bd3d8c981767502388dc9378c915ba Mon Sep 17 00:00:00 2001 From: Jan Langheimer Date: Wed, 17 Jan 2024 10:30:27 +0000 Subject: [PATCH] refactor react-router 2 --- package.json | 8 +- .../useBurgerMenuItems.tsx | 2 +- .../menu/mainMenu/MainMenuTradeSwitch.tsx | 3 +- .../create/BuySellBlock/BugetSection.tsx | 105 ------ .../strategies/create/BuySellBlock/index.tsx | 2 +- src/components/strategies/create/utils.ts | 3 +- .../strategyBlock/StrategyBlockRoi.tsx | 2 +- src/components/trade/useTradeTokens.ts | 2 +- src/libs/routing/externalLinks.ts | 16 + src/libs/routing/index.ts | 1 + src/libs/routing/routes.tsx | 195 ----------- src/libs/routing/routes/debug.ts | 9 + src/libs/routing/routes/explorer.ts | 60 ++++ src/libs/routing/routes/index.ts | 55 ++++ src/libs/routing/routes/legal.ts | 16 + src/libs/routing/routes/myStrategies.ts | 34 ++ src/libs/routing/routes/root.ts | 6 + src/libs/routing/routes/strategyCreateEdit.ts | 26 ++ src/libs/routing/routes/trade.ts | 17 + src/pages/explorer/type/portfolio/index.tsx | 2 +- src/pages/trade/index.tsx | 11 +- yarn.lock | 304 ++++++++++++++++-- 22 files changed, 540 insertions(+), 339 deletions(-) delete mode 100644 src/components/strategies/create/BuySellBlock/BugetSection.tsx create mode 100644 src/libs/routing/externalLinks.ts delete mode 100644 src/libs/routing/routes.tsx create mode 100644 src/libs/routing/routes/debug.ts create mode 100644 src/libs/routing/routes/explorer.ts create mode 100644 src/libs/routing/routes/index.ts create mode 100644 src/libs/routing/routes/legal.ts create mode 100644 src/libs/routing/routes/myStrategies.ts create mode 100644 src/libs/routing/routes/root.ts create mode 100644 src/libs/routing/routes/strategyCreateEdit.ts create mode 100644 src/libs/routing/routes/trade.ts diff --git a/package.json b/package.json index 07c3a0338..0fe21ffd0 100644 --- a/package.json +++ b/package.json @@ -16,10 +16,10 @@ "@sentry/vite-plugin": "^0.7.2", "@tanstack/react-query": "^4.14.5", "@tanstack/react-query-devtools": "^4.14.5", - "@tanstack/react-router": "^1.4.6", + "@tanstack/react-router": "^1.4.9", "@tanstack/react-table": "^8.9.3", "@tanstack/react-virtual": "^3.0.0-beta.30", - "@tanstack/router-devtools": "^1.4.6", + "@tanstack/router-devtools": "^1.4.9", "@testing-library/dom": "^7.21.4", "@testing-library/jest-dom": "^5.14.1", "@testing-library/react": "^13.0.0", @@ -45,7 +45,7 @@ "@web3-react/types": "8.2.2", "@web3-react/walletconnect-v2": "^8.5.0", "autoprefixer": "^10.4.12", - "axios": "^1.1.3", + "axios": "1.6.0", "body-scroll-lock": "^4.0.0-beta.0", "buffer": "^6.0.3", "class-variance-authority": "^0.2.4", @@ -86,7 +86,7 @@ "typescript": "^4.4.2", "ua-parser-js": "^1.0.35", "use-async-effect": "^2.2.7", - "vite": "^4.4.9", + "vite": "5.0.5", "vite-plugin-rewrite-all": "^1.0.1", "vite-plugin-svgr": "^2.4.0", "vite-tsconfig-paths": "^4.2.1", diff --git a/src/components/core/menu/mainMenu/MainMenuRightBurger/useBurgerMenuItems.tsx b/src/components/core/menu/mainMenu/MainMenuRightBurger/useBurgerMenuItems.tsx index 67e117a01..e4e5de5fb 100644 --- a/src/components/core/menu/mainMenu/MainMenuRightBurger/useBurgerMenuItems.tsx +++ b/src/components/core/menu/mainMenu/MainMenuRightBurger/useBurgerMenuItems.tsx @@ -1,6 +1,6 @@ import { ReactElement, useMemo } from 'react'; import { Link, PathNames } from 'libs/routing'; -import { externalLinks } from 'libs/routing/routes'; +import { externalLinks } from 'libs/routing'; import { useFiatCurrency } from 'hooks/useFiatCurrency'; import { MenuItemActions } from './useMenuContext'; import { ReactComponent as IconX } from 'assets/logos/x.svg'; diff --git a/src/components/core/menu/mainMenu/MainMenuTradeSwitch.tsx b/src/components/core/menu/mainMenu/MainMenuTradeSwitch.tsx index 9484a9671..5b7776411 100644 --- a/src/components/core/menu/mainMenu/MainMenuTradeSwitch.tsx +++ b/src/components/core/menu/mainMenu/MainMenuTradeSwitch.tsx @@ -3,7 +3,6 @@ import { ReactComponent as IconSwitch } from 'assets/icons/switch.svg'; import { Button } from 'components/common/button'; import { Token } from 'libs/tokens'; import { useNavigate } from 'libs/routing'; -import { PathNames } from 'libs/routing'; import { carbonEvents } from 'services/events'; type Props = { @@ -16,7 +15,7 @@ export const MainMenuTradeSwitch: FC = ({ baseToken, quoteToken }) => { const onClick = () => { navigate({ - to: PathNames.trade, + to: '/trade', search: { base: quoteToken.address, quote: baseToken.address }, }); carbonEvents.trade.tradePairSwap({ diff --git a/src/components/strategies/create/BuySellBlock/BugetSection.tsx b/src/components/strategies/create/BuySellBlock/BugetSection.tsx deleted file mode 100644 index 81faf007a..000000000 --- a/src/components/strategies/create/BuySellBlock/BugetSection.tsx +++ /dev/null @@ -1,105 +0,0 @@ -import { Tooltip } from 'components/common/tooltip/Tooltip'; -import { Token } from 'libs/tokens'; -import { FC, useEffect, useId } from 'react'; -import { StrategyType } from '../types'; -import { TokenInputField } from 'components/common/TokenInputField/TokenInputField'; -import { OrderCreate } from '../useOrder'; -import { UseQueryResult } from '@tanstack/react-query'; -import { SafeDecimal } from 'libs/safedecimal'; -import { useStrategyEvents } from './useStrategyEvents'; -import { ReactComponent as IconWarning } from 'assets/icons/warning.svg'; - -interface Props { - base: Token; - quote: Token; - order: OrderCreate; - strategyType?: StrategyType; - tokenBalanceQuery: UseQueryResult; - isBudgetOptional?: boolean; - buy?: boolean; -} - -export const BudgetSection: FC = ({ - buy, - quote, - base, - strategyType, - order, - isBudgetOptional, - tokenBalanceQuery, -}) => { - const inputId = useId(); - const budgetToken = buy ? quote : base; - const insufficientBalance = - !tokenBalanceQuery.isLoading && - new SafeDecimal(tokenBalanceQuery.data || 0).lt(order.budget); - - useStrategyEvents({ base, quote, order, buy, insufficientBalance }); - - useEffect(() => { - if (insufficientBalance) { - order.setBudgetError('Insufficient balance'); - } else { - order.setBudgetError(''); - } - }, [insufficientBalance, order]); - - return ( -
- - - 2 - - - - Set {buy ? 'Buy' : 'Sell'} Budget  - - - {isBudgetOptional && ( - Optional - )} - - - {insufficientBalance && ( - - - Insufficient balance - - )} -
- ); -}; diff --git a/src/components/strategies/create/BuySellBlock/index.tsx b/src/components/strategies/create/BuySellBlock/index.tsx index a768afe8b..f505b8074 100644 --- a/src/components/strategies/create/BuySellBlock/index.tsx +++ b/src/components/strategies/create/BuySellBlock/index.tsx @@ -16,7 +16,7 @@ import { FullOutcome } from 'components/strategies/FullOutcome'; import { BuySellHeader } from './Header'; import { m } from 'libs/motion'; import { items } from '../variants'; -import { BudgetSection } from './BugetSection'; +import { BudgetSection } from './BudgetSection'; type Props = { base: Token; diff --git a/src/components/strategies/create/utils.ts b/src/components/strategies/create/utils.ts index 06ea61904..2c73c67cf 100644 --- a/src/components/strategies/create/utils.ts +++ b/src/components/strategies/create/utils.ts @@ -4,7 +4,6 @@ import { StrategySettings, } from 'components/strategies/create/types'; import { QueryKey } from 'libs/queries'; -import { PathNames } from 'libs/routing'; import { OrderCreate } from 'components/strategies/create/useOrder'; import { carbonEvents } from 'services/events'; import { Dispatch, SetStateAction } from 'react'; @@ -116,7 +115,7 @@ export const handleTxStatusAndRedirectToOverview = ( ) => { setIsProcessing(true); setTimeout(() => { - navigate?.({ to: PathNames.strategies }); + navigate?.({ to: '/', params: {} }); setIsProcessing(false); }, ONE_AND_A_HALF_SECONDS_IN_MS); }; diff --git a/src/components/strategies/overview/strategyBlock/StrategyBlockRoi.tsx b/src/components/strategies/overview/strategyBlock/StrategyBlockRoi.tsx index a92d3e67e..52a13be56 100644 --- a/src/components/strategies/overview/strategyBlock/StrategyBlockRoi.tsx +++ b/src/components/strategies/overview/strategyBlock/StrategyBlockRoi.tsx @@ -1,6 +1,6 @@ import { FC } from 'react'; import { Tooltip } from 'components/common/tooltip/Tooltip'; -import { externalLinks } from 'libs/routing/routes'; +import { externalLinks } from 'libs/routing'; import { Link } from 'libs/routing'; import { ReactComponent as IconLink } from 'assets/icons/link.svg'; import { ReactComponent as IconTooltip } from 'assets/icons/tooltip.svg'; diff --git a/src/components/trade/useTradeTokens.ts b/src/components/trade/useTradeTokens.ts index c40964140..2e2806fdd 100644 --- a/src/components/trade/useTradeTokens.ts +++ b/src/components/trade/useTradeTokens.ts @@ -22,7 +22,7 @@ export const useTradeTokens = () => { const quoteToken = getTokenById(search.quote); const goToPair = (base: string, quote: string, replace?: boolean) => - navigate({ to: PathNames.trade, search: { base, quote }, replace }); + navigate({ to: '/trade', search: { base, quote }, replace }); const isTokenError = (search.base && !baseToken) || (search.base && !quoteToken); diff --git a/src/libs/routing/externalLinks.ts b/src/libs/routing/externalLinks.ts new file mode 100644 index 000000000..e03dbae6f --- /dev/null +++ b/src/libs/routing/externalLinks.ts @@ -0,0 +1,16 @@ +export const externalLinks = { + blog: 'http://blog.carbondefi.xyz', + faq: 'https://faq.carbondefi.xyz/', + analytics: 'http://analytics.carbondefi.xyz', + x: 'https://x.com/carbondefixyz', + youtube: 'https://www.youtube.com/c/BancorProtocol', + discord: 'https://discord.gg/bancor', + telegram: 'https://t.me/CarbonDeFixyz', + techDocs: 'https://docs.carbondefi.xyz/', + litePaper: 'https://carbondefi.xyz/litepaper', + whitepaper: 'https://carbondefi.xyz/whitepaper', + simulatorRepo: 'https://github.com/bancorprotocol/carbon-simulator', + interactiveSim: 'https://simulator.carbondefi.xyz/', + duneDashboard: 'https://dune.com/bancor/carbon-by-bancor', + roiLearnMore: 'https://faq.carbondefi.xyz/strategy-roi-and-apr', +}; diff --git a/src/libs/routing/index.ts b/src/libs/routing/index.ts index f3d612b8b..760f708be 100644 --- a/src/libs/routing/index.ts +++ b/src/libs/routing/index.ts @@ -11,3 +11,4 @@ export { } from '@tanstack/react-router'; export { Link } from 'libs/routing/Link'; export { Outlet } from '@tanstack/react-router'; +export { externalLinks } from 'libs/routing/externalLinks'; diff --git a/src/libs/routing/routes.tsx b/src/libs/routing/routes.tsx deleted file mode 100644 index 7e7f60211..000000000 --- a/src/libs/routing/routes.tsx +++ /dev/null @@ -1,195 +0,0 @@ -import { ExplorerPage } from 'pages/explorer'; -import { StrategiesPage } from 'pages/strategies'; -import { CreateStrategyPage } from 'pages/strategies/create'; -import { DebugPage } from 'pages/debug'; -import { TermsPage } from 'pages/terms'; -import { EditStrategyPage } from 'pages/strategies/edit'; -import { PrivacyPage } from 'pages/privacy'; -import { App } from 'App'; -import { redirect, RootRoute, Route } from '@tanstack/react-router'; -import { ExplorerTypePage } from 'pages/explorer/type'; -import { ExplorerTypePortfolioPage } from 'pages/explorer/type/portfolio'; -import { ExplorerTypePortfolioTokenPage } from 'pages/explorer/type/portfolio/token'; -import { ExplorerTypeOverviewPage } from 'pages/explorer/type/overview'; -import { StrategiesOverviewPage } from 'pages/strategies/overview'; -import { StrategiesPortfolioTokenPage } from 'pages/strategies/portfolio/token'; -import { StrategiesPortfolioPage } from 'pages/strategies/portfolio'; - -export const externalLinks = { - blog: 'http://blog.carbondefi.xyz', - faq: 'https://faq.carbondefi.xyz/', - analytics: 'http://analytics.carbondefi.xyz', - x: 'https://x.com/carbondefixyz', - youtube: 'https://www.youtube.com/c/BancorProtocol', - discord: 'https://discord.gg/bancor', - telegram: 'https://t.me/CarbonDeFixyz', - techDocs: 'https://docs.carbondefi.xyz/', - litePaper: 'https://carbondefi.xyz/litepaper', - whitepaper: 'https://carbondefi.xyz/whitepaper', - simulatorRepo: 'https://github.com/bancorprotocol/carbon-simulator', - interactiveSim: 'https://simulator.carbondefi.xyz/', - duneDashboard: 'https://dune.com/bancor/carbon-by-bancor', - roiLearnMore: 'https://faq.carbondefi.xyz/strategy-roi-and-apr', -}; - -export const appRoute = new RootRoute({ - component: App, -}); - -const termPage = new Route({ - getParentRoute: () => appRoute, - path: '/terms', - component: TermsPage, -}); - -const privacyPage = new Route({ - getParentRoute: () => appRoute, - path: '/privacy', - component: PrivacyPage, -}); - -const debugPage = new Route({ - getParentRoute: () => appRoute, - path: '/debug', - component: DebugPage, -}); - -// const tradePage = new Route({ -// getParentRoute: () => appRoute, -// path: '/trade', -// component: TradePage, -// }); - -const createStrategyPage = new Route({ - getParentRoute: () => appRoute, - path: '/strategies/create', - component: CreateStrategyPage, - validateSearch: (search: Record) => { - if ( - search.strategyType === 'recurring' || - search.strategyType === 'disposable' || - search.strategy - ) { - return search; - } - return { ...search, strategyType: 'recurring' }; - }, -}); - -const editStrategyPage = new Route({ - getParentRoute: () => appRoute, - path: '/strategies/edit/$strategyId', - component: EditStrategyPage, -}); - -// MY STRATEGY -export const myStrategyLayout = new Route({ - getParentRoute: () => appRoute, - id: 'my-strategy-layout', - component: StrategiesPage, -}); - -export const strategyOverviewPage = new Route({ - getParentRoute: () => myStrategyLayout, - path: '/', - component: StrategiesOverviewPage, -}); -export const strategyPortflioLayout = new Route({ - getParentRoute: () => myStrategyLayout, - path: 'strategies/portfolio', -}); - -export const strategyPortflioTokenPage = new Route({ - getParentRoute: () => strategyPortflioLayout, - path: 'token/$address', - component: StrategiesPortfolioTokenPage, -}); - -export const strategyPortflioPage = new Route({ - getParentRoute: () => strategyPortflioLayout, - path: '/', - component: StrategiesPortfolioPage, -}); - -// EXPLORER -const explorerLayout = new Route({ - getParentRoute: () => appRoute, - path: 'explorer', -}); - -const explorerRedirect = new Route({ - getParentRoute: () => explorerLayout, - path: '/', - loader: () => { - redirect({ to: '/explorer/$type', params: { type: 'token-pair' } }); - }, -}); - -const explorerPage = new Route({ - getParentRoute: () => explorerLayout, - path: '$type', - component: ExplorerPage, -}); - -export const explorerResultLayout = new Route({ - getParentRoute: () => explorerPage, - path: '$slug', -}); - -const explorerTypePage = new Route({ - getParentRoute: () => explorerPage, - path: '/', - component: ExplorerTypePage, -}); - -const explorerOverviewPage = new Route({ - getParentRoute: () => explorerResultLayout, - path: '/', - component: ExplorerTypeOverviewPage, -}); - -const explorerPortfolioLayout = new Route({ - getParentRoute: () => explorerResultLayout, - path: 'portfolio', -}); - -const explorerPortfolioPage = new Route({ - getParentRoute: () => explorerPortfolioLayout, - path: '/', - component: ExplorerTypePortfolioPage, -}); - -const explorerPortfolioTokenPage = new Route({ - getParentRoute: () => explorerPortfolioLayout, - path: 'token/$address', - component: ExplorerTypePortfolioTokenPage, -}); - -export const routeTree = appRoute.addChildren([ - termPage, - privacyPage, - debugPage, - // tradePage, - createStrategyPage, - editStrategyPage, - explorerLayout.addChildren([ - explorerRedirect, - explorerPage.addChildren([ - explorerTypePage, - explorerResultLayout.addChildren([ - explorerOverviewPage, - explorerPortfolioLayout.addChildren([ - explorerPortfolioPage, - explorerPortfolioTokenPage, - ]), - ]), - ]), - ]), - myStrategyLayout.addChildren([ - strategyOverviewPage, - strategyPortflioLayout.addChildren([ - strategyPortflioPage, - strategyPortflioTokenPage, - ]), - ]), -]); diff --git a/src/libs/routing/routes/debug.ts b/src/libs/routing/routes/debug.ts new file mode 100644 index 000000000..e224c66ce --- /dev/null +++ b/src/libs/routing/routes/debug.ts @@ -0,0 +1,9 @@ +import { Route } from '@tanstack/react-router'; +import { rootRoot } from 'libs/routing/routes/root'; +import { DebugPage } from 'pages/debug'; + +export const debugPage = new Route({ + getParentRoute: () => rootRoot, + path: '/debug', + component: DebugPage, +}); diff --git a/src/libs/routing/routes/explorer.ts b/src/libs/routing/routes/explorer.ts new file mode 100644 index 000000000..f74e63618 --- /dev/null +++ b/src/libs/routing/routes/explorer.ts @@ -0,0 +1,60 @@ +import { redirect, Route } from '@tanstack/react-router'; +import { rootRoot } from 'libs/routing/routes/root'; +import { ExplorerPage } from 'pages/explorer'; +import { ExplorerTypePage } from 'pages/explorer/type'; +import { ExplorerTypeOverviewPage } from 'pages/explorer/type/overview'; +import { ExplorerTypePortfolioPage } from 'pages/explorer/type/portfolio'; +import { ExplorerTypePortfolioTokenPage } from 'pages/explorer/type/portfolio/token'; + +export const explorerLayout = new Route({ + getParentRoute: () => rootRoot, + path: '/explorer', +}); + +export const explorerRedirect = new Route({ + getParentRoute: () => explorerLayout, + path: '/', + loader: () => { + redirect({ to: '/explorer/$type', params: { type: 'token-pair' } }); + }, +}); + +export const explorerPage = new Route({ + getParentRoute: () => explorerLayout, + path: '$type', + component: ExplorerPage, +}); + +export const explorerResultLayout = new Route({ + getParentRoute: () => explorerPage, + path: '$slug', +}); + +export const explorerTypePage = new Route({ + getParentRoute: () => explorerPage, + path: '/', + component: ExplorerTypePage, +}); + +export const explorerOverviewPage = new Route({ + getParentRoute: () => explorerResultLayout, + path: '/', + component: ExplorerTypeOverviewPage, +}); + +export const explorerPortfolioLayout = new Route({ + getParentRoute: () => explorerResultLayout, + path: 'portfolio', +}); + +export const explorerPortfolioPage = new Route({ + getParentRoute: () => explorerPortfolioLayout, + path: '/', + component: ExplorerTypePortfolioPage, +}); + +export const explorerPortfolioTokenPage = new Route({ + getParentRoute: () => explorerPortfolioLayout, + path: 'token/$address', + component: ExplorerTypePortfolioTokenPage, +}); diff --git a/src/libs/routing/routes/index.ts b/src/libs/routing/routes/index.ts new file mode 100644 index 000000000..17ec7972c --- /dev/null +++ b/src/libs/routing/routes/index.ts @@ -0,0 +1,55 @@ +import { debugPage } from 'libs/routing/routes/debug'; +import { + explorerLayout, + explorerOverviewPage, + explorerPage, + explorerPortfolioLayout, + explorerPortfolioPage, + explorerPortfolioTokenPage, + explorerRedirect, + explorerResultLayout, + explorerTypePage, +} from 'libs/routing/routes/explorer'; +import { privacyPage, termPage } from 'libs/routing/routes/legal'; +import { + myStrategyLayout, + strategyOverviewPage, + strategyPortfolioLayout, + strategyPortfolioPage, + strategyPortfolioTokenPage, +} from 'libs/routing/routes/myStrategies'; +import { rootRoot } from 'libs/routing/routes/root'; +import { + createStrategyPage, + editStrategyPage, +} from 'libs/routing/routes/strategyCreateEdit'; +import { tradePage } from 'libs/routing/routes/trade'; + +export const routeTree = rootRoot.addChildren([ + termPage, + privacyPage, + debugPage, + tradePage, + createStrategyPage, + editStrategyPage, + explorerLayout.addChildren([ + explorerRedirect, + explorerPage.addChildren([ + explorerTypePage, + explorerResultLayout.addChildren([ + explorerOverviewPage, + explorerPortfolioLayout.addChildren([ + explorerPortfolioPage, + explorerPortfolioTokenPage, + ]), + ]), + ]), + ]), + myStrategyLayout.addChildren([ + strategyOverviewPage, + strategyPortfolioLayout.addChildren([ + strategyPortfolioPage, + strategyPortfolioTokenPage, + ]), + ]), +]); diff --git a/src/libs/routing/routes/legal.ts b/src/libs/routing/routes/legal.ts new file mode 100644 index 000000000..f838e44da --- /dev/null +++ b/src/libs/routing/routes/legal.ts @@ -0,0 +1,16 @@ +import { Route } from '@tanstack/react-router'; +import { rootRoot } from 'libs/routing/routes/root'; +import { PrivacyPage } from 'pages/privacy'; +import { TermsPage } from 'pages/terms'; + +export const termPage = new Route({ + getParentRoute: () => rootRoot, + path: '/terms', + component: TermsPage, +}); + +export const privacyPage = new Route({ + getParentRoute: () => rootRoot, + path: '/privacy', + component: PrivacyPage, +}); diff --git a/src/libs/routing/routes/myStrategies.ts b/src/libs/routing/routes/myStrategies.ts new file mode 100644 index 000000000..f3972e37b --- /dev/null +++ b/src/libs/routing/routes/myStrategies.ts @@ -0,0 +1,34 @@ +import { Route } from '@tanstack/react-router'; +import { rootRoot } from 'libs/routing/routes/root'; +import { StrategiesPage } from 'pages/strategies'; +import { StrategiesOverviewPage } from 'pages/strategies/overview'; +import { StrategiesPortfolioPage } from 'pages/strategies/portfolio'; +import { StrategiesPortfolioTokenPage } from 'pages/strategies/portfolio/token'; + +export const myStrategyLayout = new Route({ + getParentRoute: () => rootRoot, + id: 'my-strategy-layout', + component: StrategiesPage, +}); + +export const strategyOverviewPage = new Route({ + getParentRoute: () => myStrategyLayout, + path: '/', + component: StrategiesOverviewPage, +}); +export const strategyPortfolioLayout = new Route({ + getParentRoute: () => myStrategyLayout, + path: 'strategies/portfolio', +}); + +export const strategyPortfolioTokenPage = new Route({ + getParentRoute: () => strategyPortfolioLayout, + path: 'token/$address', + component: StrategiesPortfolioTokenPage, +}); + +export const strategyPortfolioPage = new Route({ + getParentRoute: () => strategyPortfolioLayout, + path: '/', + component: StrategiesPortfolioPage, +}); diff --git a/src/libs/routing/routes/root.ts b/src/libs/routing/routes/root.ts new file mode 100644 index 000000000..39426ce02 --- /dev/null +++ b/src/libs/routing/routes/root.ts @@ -0,0 +1,6 @@ +import { RootRoute } from '@tanstack/react-router'; +import { App } from 'App'; + +export const rootRoot = new RootRoute({ + component: App, +}); diff --git a/src/libs/routing/routes/strategyCreateEdit.ts b/src/libs/routing/routes/strategyCreateEdit.ts new file mode 100644 index 000000000..eb4a3e570 --- /dev/null +++ b/src/libs/routing/routes/strategyCreateEdit.ts @@ -0,0 +1,26 @@ +import { Route } from '@tanstack/react-router'; +import { rootRoot } from 'libs/routing/routes/root'; +import { CreateStrategyPage } from 'pages/strategies/create'; +import { EditStrategyPage } from 'pages/strategies/edit'; + +export const createStrategyPage = new Route({ + getParentRoute: () => rootRoot, + path: '/strategies/create', + component: CreateStrategyPage, + validateSearch: (search: Record) => { + if ( + search.strategyType === 'recurring' || + search.strategyType === 'disposable' || + search.strategy + ) { + return search; + } + return { ...search, strategyType: 'recurring' }; + }, +}); + +export const editStrategyPage = new Route({ + getParentRoute: () => rootRoot, + path: '/strategies/edit/$strategyId', + component: EditStrategyPage, +}); diff --git a/src/libs/routing/routes/trade.ts b/src/libs/routing/routes/trade.ts new file mode 100644 index 000000000..31a160c31 --- /dev/null +++ b/src/libs/routing/routes/trade.ts @@ -0,0 +1,17 @@ +import { Route } from '@tanstack/react-router'; +import { rootRoot } from 'libs/routing/routes/root'; +import { TradePage } from 'pages/trade'; + +export interface TradeSearch { + base: string; + quote: string; +} + +export const tradePage = new Route({ + getParentRoute: () => rootRoot, + path: '/trade', + component: TradePage, + validateSearch: (search: Record): TradeSearch => { + return { base: search.base as string, quote: search.quote as string }; + }, +}); diff --git a/src/pages/explorer/type/portfolio/index.tsx b/src/pages/explorer/type/portfolio/index.tsx index 22580fecb..4eba54079 100644 --- a/src/pages/explorer/type/portfolio/index.tsx +++ b/src/pages/explorer/type/portfolio/index.tsx @@ -15,7 +15,7 @@ export const ExplorerTypePortfolioPage = () => { to: '/explorer/$type/$slug/portfolio/token/$address', params: { type, - slug, + slug: slug || '', address: row.original.token.address, }, }); diff --git a/src/pages/trade/index.tsx b/src/pages/trade/index.tsx index ce7415b7a..443fef09f 100644 --- a/src/pages/trade/index.tsx +++ b/src/pages/trade/index.tsx @@ -3,24 +3,21 @@ import { OrderBookWidget } from 'components/trade/orderWidget/OrderBookWidget'; import { DepthChartWidget } from 'components/trade/depthChartWidget/DepthChartWidget'; import { useBreakpoints } from 'hooks/useBreakpoints'; import { useTradeTokens } from 'components/trade/useTradeTokens'; +import { tradePage } from 'libs/routing/routes/trade'; import { Token } from 'libs/tokens'; import { useTradePairs } from 'components/trade/useTradePairs'; import { MainMenuTrade } from 'components/core/menu/mainMenu/MainMenuTrade'; import { useEffect } from 'react'; import { lsService } from 'services/localeStorage'; import { CarbonLogoLoading } from 'components/common/CarbonLogoLoading'; -import { useNavigate, useSearch } from '@tanstack/react-router'; +import { useNavigate } from '@tanstack/react-router'; import { getLastVisitedPair } from 'libs/routing/utils'; -export interface TradeSearch { - base: string; - quote: string; -} export type TradePageProps = { base: Token; quote: Token }; export const TradePage = () => { const navigate = useNavigate(); - const search: TradeSearch = useSearch({ strict: false }); + const search = tradePage.useSearch(); const { belowBreakpoint } = useBreakpoints(); const { baseToken, quoteToken } = useTradeTokens(); const { isLoading, isTradePairError } = useTradePairs(); @@ -29,7 +26,7 @@ export const TradePage = () => { useEffect(() => { if (search.base && search.quote) return; - navigate({ search: { ...search, ...getLastVisitedPair() } }); + navigate({ search: { ...search, ...getLastVisitedPair() }, params: {} }); }, [search, navigate]); useEffect(() => { diff --git a/yarn.lock b/yarn.lock index 12aad3a55..208bd91a2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1348,116 +1348,231 @@ resolved "https://registry.yarnpkg.com/@emotion/memoize/-/memoize-0.7.4.tgz#19bf0f5af19149111c40d98bb0cf82119f5d9eeb" integrity sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw== +"@esbuild/aix-ppc64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.19.11.tgz#2acd20be6d4f0458bc8c784103495ff24f13b1d3" + integrity sha512-FnzU0LyE3ySQk7UntJO4+qIiQgI7KoODnZg5xzXIrFJlKd2P2gwHsHY4927xj9y5PJmJSzULiUCWmv7iWnNa7g== + "@esbuild/android-arm64@0.18.18": version "0.18.18" resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.18.18.tgz#a52e0a1276065b1bf6b2de45b482cf36b6b945bd" integrity sha512-dkAPYzRHq3dNXIzOyAknYOzsx8o3KWaNiuu56B2rP9IFPmFWMS58WQcTlUQi6iloku8ZyHHMluCe5sTWhKq/Yw== +"@esbuild/android-arm64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.19.11.tgz#b45d000017385c9051a4f03e17078abb935be220" + integrity sha512-aiu7K/5JnLj//KOnOfEZ0D90obUkRzDMyqd/wNAUQ34m4YUPVhRZpnqKV9uqDGxT7cToSDnIHsGooyIczu9T+Q== + "@esbuild/android-arm@0.18.18": version "0.18.18" resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.18.18.tgz#ffd591b956ced1c96e1224edfbed1001adadf2ae" integrity sha512-oBymf7ZwplAawSxmiSlBCf+FMcY0f4bs5QP2jn43JKUf0M9DnrUTjqa5RvFPl1elw+sMfcpfBRPK+rb+E1q7zg== +"@esbuild/android-arm@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.19.11.tgz#f46f55414e1c3614ac682b29977792131238164c" + integrity sha512-5OVapq0ClabvKvQ58Bws8+wkLCV+Rxg7tUVbo9xu034Nm536QTII4YzhaFriQ7rMrorfnFKUsArD2lqKbFY4vw== + "@esbuild/android-x64@0.18.18": version "0.18.18" resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.18.18.tgz#6e8a7b41fc80265849e0a1de928fe162b27990c7" integrity sha512-r7/pVcrUQMYkjvtE/1/n6BxhWM+/9tvLxDG1ev1ce4z3YsqoxMK9bbOM6bFcj0BowMeGQvOZWcBV182lFFKmrw== +"@esbuild/android-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.19.11.tgz#bfc01e91740b82011ef503c48f548950824922b2" + integrity sha512-eccxjlfGw43WYoY9QgB82SgGgDbibcqyDTlk3l3C0jOVHKxrjdc9CTwDUQd0vkvYg5um0OH+GpxYvp39r+IPOg== + "@esbuild/darwin-arm64@0.18.18": version "0.18.18" resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.18.18.tgz#36755dc44cefac6c56e82ed3b67f9d457ca27156" integrity sha512-MSe2iV9MAH3wfP0g+vzN9bp36rtPPuCSk+bT5E2vv/d8krvW5uB/Pi/Q5+txUZuxsG3GcO8dhygjnFq0wJU9hQ== +"@esbuild/darwin-arm64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.19.11.tgz#533fb7f5a08c37121d82c66198263dcc1bed29bf" + integrity sha512-ETp87DRWuSt9KdDVkqSoKoLFHYTrkyz2+65fj9nfXsaV3bMhTCjtQfw3y+um88vGRKRiF7erPrh/ZuIdLUIVxQ== + "@esbuild/darwin-x64@0.18.18": version "0.18.18" resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.18.18.tgz#8aa691d0cbd3fb67f9f9083375c0c72e0463b8b2" integrity sha512-ARFYISOWkaifjcr48YtO70gcDNeOf1H2RnmOj6ip3xHIj66f3dAbhcd5Nph5np6oHI7DhHIcr9MWO18RvUL1bw== +"@esbuild/darwin-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.19.11.tgz#62f3819eff7e4ddc656b7c6815a31cf9a1e7d98e" + integrity sha512-fkFUiS6IUK9WYUO/+22omwetaSNl5/A8giXvQlcinLIjVkxwTLSktbF5f/kJMftM2MJp9+fXqZ5ezS7+SALp4g== + "@esbuild/freebsd-arm64@0.18.18": version "0.18.18" resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.18.tgz#0aafde382df508d7863360950d5f491c07024806" integrity sha512-BHnXmexzEWRU2ZySJosU0Ts0NRnJnNrMB6t4EiIaOSel73I8iLsNiTPLH0rJulAh19cYZutsB5XHK6N8fi5eMg== +"@esbuild/freebsd-arm64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.11.tgz#d478b4195aa3ca44160272dab85ef8baf4175b4a" + integrity sha512-lhoSp5K6bxKRNdXUtHoNc5HhbXVCS8V0iZmDvyWvYq9S5WSfTIHU2UGjcGt7UeS6iEYp9eeymIl5mJBn0yiuxA== + "@esbuild/freebsd-x64@0.18.18": version "0.18.18" resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.18.18.tgz#f00e54a3b65824ac3c749173bec9cd56d95fe73b" integrity sha512-n823w35wm0ZOobbuE//0sJjuz1Qj619+AwjgOcAJMN2pomZhH9BONCtn+KlfrmM/NWZ+27yB/eGVFzUIWLeh3w== +"@esbuild/freebsd-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.19.11.tgz#7bdcc1917409178257ca6a1a27fe06e797ec18a2" + integrity sha512-JkUqn44AffGXitVI6/AbQdoYAq0TEullFdqcMY/PCUZ36xJ9ZJRtQabzMA+Vi7r78+25ZIBosLTOKnUXBSi1Kw== + "@esbuild/linux-arm64@0.18.18": version "0.18.18" resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.18.18.tgz#e04203429670257126a1bfee79bbd56448b24f5e" integrity sha512-zANxnwF0sCinDcAqoMohGoWBK9QaFJ65Vgh0ZE+RXtURaMwx+RfmfLElqtnn7X8OYNckMoIXSg7u+tZ3tqTlrA== +"@esbuild/linux-arm64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.19.11.tgz#58ad4ff11685fcc735d7ff4ca759ab18fcfe4545" + integrity sha512-LneLg3ypEeveBSMuoa0kwMpCGmpu8XQUh+mL8XXwoYZ6Be2qBnVtcDI5azSvh7vioMDhoJFZzp9GWp9IWpYoUg== + "@esbuild/linux-arm@0.18.18": version "0.18.18" resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.18.18.tgz#863236dc47df2269f860001ca5c5ff50931e9933" integrity sha512-Kck3jxPLQU4VeAGwe8Q4NU+IWIx+suULYOFUI9T0C2J1+UQlOHJ08ITN+MaJJ+2youzJOmKmcphH/t3SJxQ1Tw== +"@esbuild/linux-arm@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.19.11.tgz#ce82246d873b5534d34de1e5c1b33026f35e60e3" + integrity sha512-3CRkr9+vCV2XJbjwgzjPtO8T0SZUmRZla+UL1jw+XqHZPkPgZiyWvbDvl9rqAN8Zl7qJF0O/9ycMtjU67HN9/Q== + "@esbuild/linux-ia32@0.18.18": version "0.18.18" resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.18.18.tgz#9ef6c7eeb8c86c5c1b7234a9684c6f45cbc2ed57" integrity sha512-+VHz2sIRlY5u8IlaLJpdf5TL2kM76yx186pW7bpTB+vLWpzcFQVP04L842ZB2Ty13A1VXUvy3DbU1jV65P2skg== +"@esbuild/linux-ia32@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.19.11.tgz#cbae1f313209affc74b80f4390c4c35c6ab83fa4" + integrity sha512-caHy++CsD8Bgq2V5CodbJjFPEiDPq8JJmBdeyZ8GWVQMjRD0sU548nNdwPNvKjVpamYYVL40AORekgfIubwHoA== + "@esbuild/linux-loong64@0.18.18": version "0.18.18" resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.18.18.tgz#dca8624674924ac92c9e56399af160479283f130" integrity sha512-fXPEPdeGBvguo/1+Na8OIWz3667BN1cwbGtTEZWTd0qdyTsk5gGf9jVX8MblElbDb/Cpw6y5JiaQuL96YmvBwQ== +"@esbuild/linux-loong64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.19.11.tgz#5f32aead1c3ec8f4cccdb7ed08b166224d4e9121" + integrity sha512-ppZSSLVpPrwHccvC6nQVZaSHlFsvCQyjnvirnVjbKSHuE5N24Yl8F3UwYUUR1UEPaFObGD2tSvVKbvR+uT1Nrg== + "@esbuild/linux-mips64el@0.18.18": version "0.18.18" resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.18.18.tgz#e6525b60ae9d8c3bdc652a773e6ebf66caa3fdd3" integrity sha512-dLvRB87pIBIRnEIC32LIcgwK1JzlIuADIRjLKdUIpxauKwMuS/xMpN+cFl+0nN4RHNYOZ57DmXFFmQAcdlFOmw== +"@esbuild/linux-mips64el@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.19.11.tgz#38eecf1cbb8c36a616261de858b3c10d03419af9" + integrity sha512-B5x9j0OgjG+v1dF2DkH34lr+7Gmv0kzX6/V0afF41FkPMMqaQ77pH7CrhWeR22aEeHKaeZVtZ6yFwlxOKPVFyg== + "@esbuild/linux-ppc64@0.18.18": version "0.18.18" resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.18.18.tgz#2ea6a4e0c6b0db21770d2c3c1525623dceadfe46" integrity sha512-fRChqIJZ7hLkXSKfBLYgsX9Ssb5OGCjk3dzCETF5QSS1qjTgayLv0ALUdJDB9QOh/nbWwp+qfLZU6md4XcjL7w== +"@esbuild/linux-ppc64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.19.11.tgz#9c5725a94e6ec15b93195e5a6afb821628afd912" + integrity sha512-MHrZYLeCG8vXblMetWyttkdVRjQlQUb/oMgBNurVEnhj4YWOr4G5lmBfZjHYQHHN0g6yDmCAQRR8MUHldvvRDA== + "@esbuild/linux-riscv64@0.18.18": version "0.18.18" resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.18.18.tgz#296c25d5bdeb3bab9ca79ad5279a8cc0a42fbeea" integrity sha512-ALK/BT3u7Hoa/vHjow6W6+MKF0ohYcVcVA1EpskI4bkBPVuDLrUDqt2YFifg5UcZc8qup0CwQqWmFUd6VMNgaA== +"@esbuild/linux-riscv64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.19.11.tgz#2dc4486d474a2a62bbe5870522a9a600e2acb916" + integrity sha512-f3DY++t94uVg141dozDu4CCUkYW+09rWtaWfnb3bqe4w5NqmZd6nPVBm+qbz7WaHZCoqXqHz5p6CM6qv3qnSSQ== + "@esbuild/linux-s390x@0.18.18": version "0.18.18" resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.18.18.tgz#bec4e9c982e778c51deaa754e1ed3f0546705647" integrity sha512-crT7jtOXd9iirY65B+mJQ6W0HWdNy8dtkZqKGWNcBnunpLcTCfne5y5bKic9bhyYzKpQEsO+C/VBPD8iF0RhRw== +"@esbuild/linux-s390x@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.19.11.tgz#4ad8567df48f7dd4c71ec5b1753b6f37561a65a8" + integrity sha512-A5xdUoyWJHMMlcSMcPGVLzYzpcY8QP1RtYzX5/bS4dvjBGVxdhuiYyFwp7z74ocV7WDc0n1harxmpq2ePOjI0Q== + "@esbuild/linux-x64@0.18.18": version "0.18.18" resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.18.18.tgz#22c9666920d3b7ef453289516ccff1c3ecbfdddd" integrity sha512-/NSgghjBOW9ELqjXDYxOCCIsvQUZpvua1/6NdnA9Vnrp9UzEydyDdFXljUjMMS9p5KxMzbMO9frjHYGVHBfCHg== +"@esbuild/linux-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.19.11.tgz#b7390c4d5184f203ebe7ddaedf073df82a658766" + integrity sha512-grbyMlVCvJSfxFQUndw5mCtWs5LO1gUlwP4CDi4iJBbVpZcqLVT29FxgGuBJGSzyOxotFG4LoO5X+M1350zmPA== + "@esbuild/netbsd-x64@0.18.18": version "0.18.18" resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.18.18.tgz#99b6125868c5ba8f0131bacc3f2bd05918245f45" integrity sha512-8Otf05Vx5sZjLLDulgr5QS5lsWXMplKZEyHMArH9/S4olLlhzmdhQBPhzhJTNwaL2FJNdWcUPNGAcoD5zDTfUA== +"@esbuild/netbsd-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.19.11.tgz#d633c09492a1721377f3bccedb2d821b911e813d" + integrity sha512-13jvrQZJc3P230OhU8xgwUnDeuC/9egsjTkXN49b3GcS5BKvJqZn86aGM8W9pd14Kd+u7HuFBMVtrNGhh6fHEQ== + "@esbuild/openbsd-x64@0.18.18": version "0.18.18" resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.18.18.tgz#c2685bdd1e5aa11be1e212db371f474812a9b158" integrity sha512-tFiFF4kT5L5qhVrWJUNxEXWvvX8nK/UX9ZrB7apuTwY3f6+Xy4aFMBPwAVrBYtBd5MOUuyOVHK6HBZCAHkwUlw== +"@esbuild/openbsd-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.19.11.tgz#17388c76e2f01125bf831a68c03a7ffccb65d1a2" + integrity sha512-ysyOGZuTp6SNKPE11INDUeFVVQFrhcNDVUgSQVDzqsqX38DjhPEPATpid04LCoUr2WXhQTEZ8ct/EgJCUDpyNw== + "@esbuild/sunos-x64@0.18.18": version "0.18.18" resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.18.18.tgz#277b2f5727119fe3004e673eb9f6ead0b4ff0738" integrity sha512-MPogVV8Bzh8os4OM+YDGGsSzCzmNRiyKGtHoJyZLtI4BMmd6EcxmGlcEGK1uM46h1BiOyi7Z7teUtzzQhvkC+w== +"@esbuild/sunos-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.19.11.tgz#e320636f00bb9f4fdf3a80e548cb743370d41767" + integrity sha512-Hf+Sad9nVwvtxy4DXCZQqLpgmRTQqyFyhT3bZ4F2XlJCjxGmRFF0Shwn9rzhOYRB61w9VMXUkxlBy56dk9JJiQ== + "@esbuild/win32-arm64@0.18.18": version "0.18.18" resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.18.18.tgz#e94d9e6d058e0ccb92d858badd4a6aa74772150e" integrity sha512-YKD6LF/XXY9REu+ZL5RAsusiG48n602qxsMVh/E8FFD9hp4OyTQaL9fpE1ovxwQXqFio+tT0ITUGjDSSSPN13w== +"@esbuild/win32-arm64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.19.11.tgz#c778b45a496e90b6fc373e2a2bb072f1441fe0ee" + integrity sha512-0P58Sbi0LctOMOQbpEOvOL44Ne0sqbS0XWHMvvrg6NE5jQ1xguCSSw9jQeUk2lfrXYsKDdOe6K+oZiwKPilYPQ== + "@esbuild/win32-ia32@0.18.18": version "0.18.18" resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.18.18.tgz#454916b1d0b85d2f82252192ae7bd5ea65c98ea1" integrity sha512-NjSBmBsyZBTsZB6ga6rA6PfG/RHnwruUz/9YEVXcm4STGauFWvhYhOMhEyw1yU5NVgYYm8CH5AltCm77TS21/Q== +"@esbuild/win32-ia32@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.19.11.tgz#481a65fee2e5cce74ec44823e6b09ecedcc5194c" + integrity sha512-6YOrWS+sDJDmshdBIQU+Uoyh7pQKrdykdefC1avn76ss5c+RN6gut3LZA4E2cH5xUEp5/cA0+YxRaVtRAb0xBg== + "@esbuild/win32-x64@0.18.18": version "0.18.18" resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.18.18.tgz#914c007ab1dbd28ca84e79ee666adeee6ccf92b4" integrity sha512-eTSg/gC3p3tdjj4roDhe5xu94l1s2jMazP8u2FsYO8SEKvSpPOO71EucprDn/IuErDPvTFUhV9lTw5z5WJCRKQ== +"@esbuild/win32-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.19.11.tgz#a5d300008960bb39677c46bf16f53ec70d8dee04" + integrity sha512-vfkhltrjCAb603XaFhqhAF4LGDi2M4OrCRrFusyQ+iTLQ/o60QQXxc9cZC/FFpihBI9N1Grn6SMKVJ4KP7Fuiw== + "@eslint-community/eslint-utils@^4.2.0": version "4.4.0" resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" @@ -2150,6 +2265,71 @@ estree-walker "^2.0.2" picomatch "^2.3.1" +"@rollup/rollup-android-arm-eabi@4.9.5": + version "4.9.5" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.9.5.tgz#b752b6c88a14ccfcbdf3f48c577ccc3a7f0e66b9" + integrity sha512-idWaG8xeSRCfRq9KpRysDHJ/rEHBEXcHuJ82XY0yYFIWnLMjZv9vF/7DOq8djQ2n3Lk6+3qfSH8AqlmHlmi1MA== + +"@rollup/rollup-android-arm64@4.9.5": + version "4.9.5" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.9.5.tgz#33757c3a448b9ef77b6f6292d8b0ec45c87e9c1a" + integrity sha512-f14d7uhAMtsCGjAYwZGv6TwuS3IFaM4ZnGMUn3aCBgkcHAYErhV1Ad97WzBvS2o0aaDv4mVz+syiN0ElMyfBPg== + +"@rollup/rollup-darwin-arm64@4.9.5": + version "4.9.5" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.9.5.tgz#5234ba62665a3f443143bc8bcea9df2cc58f55fb" + integrity sha512-ndoXeLx455FffL68OIUrVr89Xu1WLzAG4n65R8roDlCoYiQcGGg6MALvs2Ap9zs7AHg8mpHtMpwC8jBBjZrT/w== + +"@rollup/rollup-darwin-x64@4.9.5": + version "4.9.5" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.9.5.tgz#981256c054d3247b83313724938d606798a919d1" + integrity sha512-UmElV1OY2m/1KEEqTlIjieKfVwRg0Zwg4PLgNf0s3glAHXBN99KLpw5A5lrSYCa1Kp63czTpVll2MAqbZYIHoA== + +"@rollup/rollup-linux-arm-gnueabihf@4.9.5": + version "4.9.5" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.9.5.tgz#120678a5a2b3a283a548dbb4d337f9187a793560" + integrity sha512-Q0LcU61v92tQB6ae+udZvOyZ0wfpGojtAKrrpAaIqmJ7+psq4cMIhT/9lfV6UQIpeItnq/2QDROhNLo00lOD1g== + +"@rollup/rollup-linux-arm64-gnu@4.9.5": + version "4.9.5" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.9.5.tgz#c99d857e2372ece544b6f60b85058ad259f64114" + integrity sha512-dkRscpM+RrR2Ee3eOQmRWFjmV/payHEOrjyq1VZegRUa5OrZJ2MAxBNs05bZuY0YCtpqETDy1Ix4i/hRqX98cA== + +"@rollup/rollup-linux-arm64-musl@4.9.5": + version "4.9.5" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.9.5.tgz#3064060f568a5718c2a06858cd6e6d24f2ff8632" + integrity sha512-QaKFVOzzST2xzY4MAmiDmURagWLFh+zZtttuEnuNn19AiZ0T3fhPyjPPGwLNdiDT82ZE91hnfJsUiDwF9DClIQ== + +"@rollup/rollup-linux-riscv64-gnu@4.9.5": + version "4.9.5" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.9.5.tgz#987d30b5d2b992fff07d055015991a57ff55fbad" + integrity sha512-HeGqmRJuyVg6/X6MpE2ur7GbymBPS8Np0S/vQFHDmocfORT+Zt76qu+69NUoxXzGqVP1pzaY6QIi0FJWLC3OPA== + +"@rollup/rollup-linux-x64-gnu@4.9.5": + version "4.9.5" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.9.5.tgz#85946ee4d068bd12197aeeec2c6f679c94978a49" + integrity sha512-Dq1bqBdLaZ1Gb/l2e5/+o3B18+8TI9ANlA1SkejZqDgdU/jK/ThYaMPMJpVMMXy2uRHvGKbkz9vheVGdq3cJfA== + +"@rollup/rollup-linux-x64-musl@4.9.5": + version "4.9.5" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.9.5.tgz#fe0b20f9749a60eb1df43d20effa96c756ddcbd4" + integrity sha512-ezyFUOwldYpj7AbkwyW9AJ203peub81CaAIVvckdkyH8EvhEIoKzaMFJj0G4qYJ5sw3BpqhFrsCc30t54HV8vg== + +"@rollup/rollup-win32-arm64-msvc@4.9.5": + version "4.9.5" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.9.5.tgz#422661ef0e16699a234465d15b2c1089ef963b2a" + integrity sha512-aHSsMnUw+0UETB0Hlv7B/ZHOGY5bQdwMKJSzGfDfvyhnpmVxLMGnQPGNE9wgqkLUs3+gbG1Qx02S2LLfJ5GaRQ== + +"@rollup/rollup-win32-ia32-msvc@4.9.5": + version "4.9.5" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.9.5.tgz#7b73a145891c202fbcc08759248983667a035d85" + integrity sha512-AiqiLkb9KSf7Lj/o1U3SEP9Zn+5NuVKgFdRIZkvd4N0+bYrTOovVd0+LmYCPQGbocT4kvFyK+LXCDiXPBF3fyA== + +"@rollup/rollup-win32-x64-msvc@4.9.5": + version "4.9.5" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.9.5.tgz#10491ccf4f63c814d4149e0316541476ea603602" + integrity sha512-1q+mykKE3Vot1kaFJIDoUFv5TuW+QQVaf2FmTT9krg86pQrGStOSJJ0Zil7CFagyxDuouTepzt5Y5TVzyajOdQ== + "@rushstack/eslint-patch@^1.1.0": version "1.3.2" resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.3.2.tgz#31b9c510d8cada9683549e1dbb4284cca5001faf" @@ -2567,10 +2747,10 @@ "@svgr/hast-util-to-babel-ast" "^6.5.1" svg-parser "^2.0.4" -"@tanstack/history@1.4.6": - version "1.4.6" - resolved "https://registry.yarnpkg.com/@tanstack/history/-/history-1.4.6.tgz#b45964811d34984bf15c8ba5334e780f8fa64ac4" - integrity sha512-RprNuwxBlQc+zY2LoXVG5WaZdKQ2rFMTRNBBs3XWu6N4GW2tvyLoiPbTS0MYTOkd1ygTEIoP6nQp3/+sdFT0BQ== +"@tanstack/history@1.4.9": + version "1.4.9" + resolved "https://registry.yarnpkg.com/@tanstack/history/-/history-1.4.9.tgz#37794f8aa96568a12b7ac40335bae06953577a87" + integrity sha512-hLdZMwvYNE8d6v8wJvHtbOJfkA7Er6wNm3i4bLAl06y6PjkmU2mmI8slh2GkB+evogJ0OHRoVAr6n6S6bbxDgg== "@tanstack/match-sorter-utils@^8.7.0": version "8.8.4" @@ -2601,13 +2781,13 @@ "@tanstack/query-core" "4.32.6" use-sync-external-store "^1.2.0" -"@tanstack/react-router@1.4.6", "@tanstack/react-router@^1.4.6": - version "1.4.6" - resolved "https://registry.yarnpkg.com/@tanstack/react-router/-/react-router-1.4.6.tgz#5fce01e9d422c2bd6d0825f5e513acf847e4eec2" - integrity sha512-4pAQ7+gwhrfafqs3nHwCDlLLBXjL8phk/JAx6qunvRkGulBbwblDs0PQbzTzWvIJH4hS8x0zMIrUGr/LzlD8xQ== +"@tanstack/react-router@1.4.9", "@tanstack/react-router@^1.4.9": + version "1.4.9" + resolved "https://registry.yarnpkg.com/@tanstack/react-router/-/react-router-1.4.9.tgz#4146680d9b37cfcd516b75eb87f07761a22e252d" + integrity sha512-OkjGAGi7Hxr49dHm9jaFsSICBoEXF0tFC1kSSNgiXH2TqSAGIm0yW9+ltQT5PKYW4jTm6vzwqA3xA8vUWdUQiA== dependencies: "@babel/runtime" "^7.16.7" - "@tanstack/history" "1.4.6" + "@tanstack/history" "1.4.9" "@tanstack/react-store" "^0.2.1" "@tanstack/store" "^0.1.3" tiny-invariant "^1.3.1" @@ -2635,13 +2815,13 @@ dependencies: "@tanstack/virtual-core" "3.0.0-beta.54" -"@tanstack/router-devtools@^1.4.6": - version "1.4.6" - resolved "https://registry.yarnpkg.com/@tanstack/router-devtools/-/router-devtools-1.4.6.tgz#459f3631915dec3ece36f18225d1e9ff3dadb130" - integrity sha512-+JDQ5PJC7/78/AZm/COy2C0uBAL0OjfAmfJv/AUQAuEPSbbTWWFsM4QCtdDh01rHZf7AhHX9gdhsV9N0yS7Hew== +"@tanstack/router-devtools@^1.4.9": + version "1.4.9" + resolved "https://registry.yarnpkg.com/@tanstack/router-devtools/-/router-devtools-1.4.9.tgz#0ccbc9190248f64034cd2426e4ccf8a5390199e8" + integrity sha512-XveQ/1vWwLfYMV1wLZOQ5cO7NJQbKGzpBvznbSsf7j7PQ2Ds/H8/+2jjWAfzzyJTbML10RQs45LkMC1HH0LJlw== dependencies: "@babel/runtime" "^7.16.7" - "@tanstack/react-router" "1.4.6" + "@tanstack/react-router" "1.4.9" date-fns "^2.29.1" "@tanstack/store@0.1.3", "@tanstack/store@^0.1.3": @@ -2784,6 +2964,11 @@ dependencies: "@types/ms" "*" +"@types/estree@1.0.5": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" + integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== + "@types/estree@^1.0.0": version "1.0.1" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.1.tgz#aa22750962f3bf0e79d753d3cc067f010c95f194" @@ -3747,10 +3932,10 @@ axe-core@^4.6.2: resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.7.2.tgz#040a7342b20765cb18bb50b628394c21bccc17a0" integrity sha512-zIURGIS1E1Q4pcrMjp+nnEh+16G56eG/MUllJH8yEvw7asDo7Ac9uhC9KIH5jzpITueEZolfYglnCGIuSBz39g== -axios@^1.1.3: - version "1.4.0" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.4.0.tgz#38a7bf1224cd308de271146038b551d725f0be1f" - integrity sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA== +axios@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.0.tgz#f1e5292f26b2fd5c2e66876adc5b06cdbd7d2102" + integrity sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg== dependencies: follow-redirects "^1.15.0" form-data "^4.0.0" @@ -4824,6 +5009,35 @@ esbuild@^0.18.10: "@esbuild/win32-ia32" "0.18.18" "@esbuild/win32-x64" "0.18.18" +esbuild@^0.19.3: + version "0.19.11" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.19.11.tgz#4a02dca031e768b5556606e1b468fe72e3325d96" + integrity sha512-HJ96Hev2hX/6i5cDVwcqiJBBtuo9+FeIJOtZ9W1kA5M6AMJRHUZlpYZ1/SbEwtO0ioNAW8rUooVpC/WehY2SfA== + optionalDependencies: + "@esbuild/aix-ppc64" "0.19.11" + "@esbuild/android-arm" "0.19.11" + "@esbuild/android-arm64" "0.19.11" + "@esbuild/android-x64" "0.19.11" + "@esbuild/darwin-arm64" "0.19.11" + "@esbuild/darwin-x64" "0.19.11" + "@esbuild/freebsd-arm64" "0.19.11" + "@esbuild/freebsd-x64" "0.19.11" + "@esbuild/linux-arm" "0.19.11" + "@esbuild/linux-arm64" "0.19.11" + "@esbuild/linux-ia32" "0.19.11" + "@esbuild/linux-loong64" "0.19.11" + "@esbuild/linux-mips64el" "0.19.11" + "@esbuild/linux-ppc64" "0.19.11" + "@esbuild/linux-riscv64" "0.19.11" + "@esbuild/linux-s390x" "0.19.11" + "@esbuild/linux-x64" "0.19.11" + "@esbuild/netbsd-x64" "0.19.11" + "@esbuild/openbsd-x64" "0.19.11" + "@esbuild/sunos-x64" "0.19.11" + "@esbuild/win32-arm64" "0.19.11" + "@esbuild/win32-ia32" "0.19.11" + "@esbuild/win32-x64" "0.19.11" + escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -5451,6 +5665,11 @@ fsevents@2.3.2, fsevents@~2.3.2: resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== +fsevents@~2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== + function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" @@ -6626,6 +6845,11 @@ nanoid@^3.3.6: resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c" integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA== +nanoid@^3.3.7: + version "3.3.7" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8" + integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g== + natural-compare-lite@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz#17b09581988979fddafe0201e931ba933c96cbb4" @@ -7097,6 +7321,15 @@ postcss@^8.4.14, postcss@^8.4.27, postcss@^8.4.31: picocolors "^1.0.0" source-map-js "^1.0.2" +postcss@^8.4.32: + version "8.4.33" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.33.tgz#1378e859c9f69bf6f638b990a0212f43e2aaa742" + integrity sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg== + dependencies: + nanoid "^3.3.7" + picocolors "^1.0.0" + source-map-js "^1.0.2" + preact@^10.5.9: version "10.16.0" resolved "https://registry.yarnpkg.com/preact/-/preact-10.16.0.tgz#68a06d70b191b8a313ea722d61e09c6b2a79a37e" @@ -7488,6 +7721,28 @@ rollup@^3.27.1: optionalDependencies: fsevents "~2.3.2" +rollup@^4.2.0: + version "4.9.5" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.9.5.tgz#62999462c90f4c8b5d7c38fc7161e63b29101b05" + integrity sha512-E4vQW0H/mbNMw2yLSqJyjtkHY9dslf/p0zuT1xehNRqUTBOFMqEjguDvqhXr7N7r/4ttb2jr4T41d3dncmIgbQ== + dependencies: + "@types/estree" "1.0.5" + optionalDependencies: + "@rollup/rollup-android-arm-eabi" "4.9.5" + "@rollup/rollup-android-arm64" "4.9.5" + "@rollup/rollup-darwin-arm64" "4.9.5" + "@rollup/rollup-darwin-x64" "4.9.5" + "@rollup/rollup-linux-arm-gnueabihf" "4.9.5" + "@rollup/rollup-linux-arm64-gnu" "4.9.5" + "@rollup/rollup-linux-arm64-musl" "4.9.5" + "@rollup/rollup-linux-riscv64-gnu" "4.9.5" + "@rollup/rollup-linux-x64-gnu" "4.9.5" + "@rollup/rollup-linux-x64-musl" "4.9.5" + "@rollup/rollup-win32-arm64-msvc" "4.9.5" + "@rollup/rollup-win32-ia32-msvc" "4.9.5" + "@rollup/rollup-win32-x64-msvc" "4.9.5" + fsevents "~2.3.2" + rpc-websockets@^7.5.1: version "7.5.1" resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-7.5.1.tgz#e0a05d525a97e7efc31a0617f093a13a2e10c401" @@ -8401,7 +8656,18 @@ vite-tsconfig-paths@^4.2.1: globrex "^0.1.2" tsconfck "^2.1.0" -"vite@^3.0.0 || ^4.0.0", vite@^4.4.9: +vite@5.0.5: + version "5.0.5" + resolved "https://registry.yarnpkg.com/vite/-/vite-5.0.5.tgz#3eebe3698e3b32cea36350f58879258fec858a3c" + integrity sha512-OekeWqR9Ls56f3zd4CaxzbbS11gqYkEiBtnWFFgYR2WV8oPJRRKq0mpskYy/XaoCL3L7VINDhqqOMNDiYdGvGg== + dependencies: + esbuild "^0.19.3" + postcss "^8.4.32" + rollup "^4.2.0" + optionalDependencies: + fsevents "~2.3.3" + +"vite@^3.0.0 || ^4.0.0": version "4.4.11" resolved "https://registry.yarnpkg.com/vite/-/vite-4.4.11.tgz#babdb055b08c69cfc4c468072a2e6c9ca62102b0" integrity sha512-ksNZJlkcU9b0lBwAGZGGaZHCMqHsc8OpgtoYhsQ4/I2v5cnpmmmqe5pM4nv/4Hn6G/2GhTdj0DhZh2e+Er1q5A==