|
1 | | -/* oxlint-disable max-lines */ |
2 | | -import { FeatureFlags, useFeatureFlag, useStatsigClientStatus } from '@universe/gating' |
| 1 | +import { FeatureFlags, useFeatureFlag } from '@universe/gating' |
3 | 2 | import { lazy, ReactNode, Suspense, useMemo } from 'react' |
4 | 3 | import { matchPath, Navigate, Route, Routes, useLocation } from 'react-router' |
5 | | -import { SpinningLoader } from 'ui/src' |
6 | 4 | import { WRAPPED_PATH } from 'uniswap/src/components/banners/shared/utils' |
7 | 5 | import { CHROME_EXTENSION_UNINSTALL_URL_PATH } from 'uniswap/src/constants/urls' |
8 | 6 | import { WRAPPED_SOL_ADDRESS_SOLANA } from 'uniswap/src/features/chains/svm/defaults' |
@@ -103,27 +101,6 @@ const StaticTitlesAndDescriptions = { |
103 | 101 | ToucanLaunchAuctionDescription: i18n.t('title.launchTokenAuction'), |
104 | 102 | } |
105 | 103 |
|
106 | | -/** |
107 | | - * Registers /liquidity/launch-auction even while Statsig is still loading so direct |
108 | | - * navigation does not fall through to 404. After gates are ready, shows the page or not-found. |
109 | | - */ |
110 | | -function CreateAuctionRouteGate(): JSX.Element { |
111 | | - const isToucanLaunchAuctionEnabled = useFeatureFlag(FeatureFlags.ToucanLaunchAuction) |
112 | | - const { isStatsigReady } = useStatsigClientStatus() |
113 | | - |
114 | | - if (!isStatsigReady) { |
115 | | - return <SpinningLoader color="$accent1" /> |
116 | | - } |
117 | | - if (!isToucanLaunchAuctionEnabled) { |
118 | | - return <Navigate to="/not-found" replace /> |
119 | | - } |
120 | | - return ( |
121 | | - <Suspense fallback={null}> |
122 | | - <CreateAuction /> |
123 | | - </Suspense> |
124 | | - ) |
125 | | -} |
126 | | - |
127 | 104 | export interface RouteDefinition { |
128 | 105 | path: string |
129 | 106 | nestedPaths: string[] |
@@ -222,7 +199,11 @@ export const routes: RouteDefinition[] = [ |
222 | 199 | path: '/liquidity/launch-auction', |
223 | 200 | getTitle: () => i18n.t('toucan.createAuction.title'), |
224 | 201 | getDescription: () => StaticTitlesAndDescriptions.ToucanLaunchAuctionDescription, |
225 | | - getElement: () => <CreateAuctionRouteGate />, |
| 202 | + getElement: () => ( |
| 203 | + <Suspense fallback={null}> |
| 204 | + <CreateAuction /> |
| 205 | + </Suspense> |
| 206 | + ), |
226 | 207 | }), |
227 | 208 | createRouteDefinition({ |
228 | 209 | path: '/liquidity/launch-auction/x/callback', |
|
0 commit comments