From 9149a602485f5559d2b5ce134abff0afb3963ae8 Mon Sep 17 00:00:00 2001 From: holybasil Date: Wed, 14 Jun 2023 19:46:27 +0800 Subject: [PATCH] fix: add nft-bridge route --- src/Portal.tsx | 58 ----------------------------- src/components/Header/constants.ts | 5 +++ src/routes/index.tsx | 8 ++++ src/routes/portalRoutes.tsx | 60 ------------------------------ 4 files changed, 13 insertions(+), 118 deletions(-) delete mode 100644 src/Portal.tsx delete mode 100644 src/routes/portalRoutes.tsx diff --git a/src/Portal.tsx b/src/Portal.tsx deleted file mode 100644 index 252ebc9c8..000000000 --- a/src/Portal.tsx +++ /dev/null @@ -1,58 +0,0 @@ -import { Helmet } from "react-helmet-async" -import { Route, Routes } from "react-router-dom" - -import Footer from "@/components/Footer" -import Header from "@/components/Header" -import Web3Provider from "@/contexts/Web3ContextProvider" -import ScrollToTop from "@/hooks/useScrollToTop" -import NotFound from "@/pages/404" -import { requireEnv } from "@/utils" - -import AppWrapper from "./contexts" -import useMatchedRoute from "./hooks/useMatchedRoute" -import routes from "./routes/portalRoutes" - -const baseUrl = requireEnv("REACT_APP_API_BASE_URI") -function Portal() { - const route = useMatchedRoute() - const getUrl = () => { - return window.location.href - } - - const getImageUrl = () => { - return window.location.origin + "/logo_for_og.png" - } - - return ( -
- - Scroll zkEVM Alpha {route?.name ? " – " + route.name : null} - - - - - - - - - - - - - -
- - {routes.map((route, key) => ( - - ))} - } /> - -
- - - -
- ) -} - -export default Portal diff --git a/src/components/Header/constants.ts b/src/components/Header/constants.ts index 841584055..07483d7ff 100644 --- a/src/components/Header/constants.ts +++ b/src/components/Header/constants.ts @@ -19,6 +19,11 @@ const navigations = [ key: "bridge", href: "/bridge", }, + { + label: "NFT Bridge", + key: "nft-bridge", + href: "/nft-bridge", + }, { label: "Ecosystem", key: "ecosystem", diff --git a/src/routes/index.tsx b/src/routes/index.tsx index c771a8121..0025b394b 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -2,6 +2,7 @@ import IframeEmbedding from "@/components/IframeEmbedding" import Bridge from "@/pages/bridge" import Ecosystem from "@/pages/ecosystem" import Portal from "@/pages/home" +import NFTBridge from "@/pages/nftBridge" import RollupScanBatch from "@/pages/rollup/batch" import RollupScanBlock from "@/pages/rollup/block" import RollupScan from "@/pages/rollup/index" @@ -52,6 +53,13 @@ const routes = [ fullPath: "/bridge", element: , }, + + { + name: "NFTBridge", + path: "/nft-bridge", + fullPath: "/nft-bridge", + element: , + }, { name: "Ecosystem", path: "/ecosystem", diff --git a/src/routes/portalRoutes.tsx b/src/routes/portalRoutes.tsx deleted file mode 100644 index 59bee6043..000000000 --- a/src/routes/portalRoutes.tsx +++ /dev/null @@ -1,60 +0,0 @@ -import Bridge from "@/pages/bridge" -import Ecosystem from "@/pages/ecosystem" -import Home from "@/pages/home" -import NFTBridge from "@/pages/nftBridge" -import RollupScanBatch from "@/pages/rollup/batch" -import RollupScanBlock from "@/pages/rollup/block" -import RollupScan from "@/pages/rollup/index" -import { isProduction } from "@/utils" - -const routes = [ - { - name: "Portal", - path: "/", - fullPath: "/alpha", - element: , - }, - { - name: "Bridge", - path: "/bridge", - fullPath: "/alpha/bridge", - element: , - }, - ...(isProduction - ? [] - : [ - { - name: "NFTBridge", - path: "/nft-bridge", - fullPath: "/alpha/nft-bridge", - element: , - }, - ]), - - { - name: "Ecosystem", - path: "/ecosystem", - fullPath: "/alpha/ecosystem", - element: , - }, - { - name: "Rollup Explorer", - path: "/rollupscan", - fullPath: "/alpha/rollupscan", - element: , - }, - { - name: "Rollup Explorer: Batch Details", - path: "/rollupscan/batch/:batchIndex", - fullPath: "/alpha/rollupscan/batch/:batchIndex", - element: , - }, - { - name: "Rollup Explorer: Block Details", - path: "/rollupscan/batch/:batchIndex/blocks", - fullPath: "/alpha/rollupscan/batch/:batchIndex/blocks", - element: , - }, -] - -export default routes