diff --git a/src/app/BridgeSwap/Index.tsx b/src/app/BridgeSwap/Index.tsx index c8e83af2..18ca6581 100644 --- a/src/app/BridgeSwap/Index.tsx +++ b/src/app/BridgeSwap/Index.tsx @@ -2,9 +2,10 @@ import { Flex } from "@chakra-ui/layout"; import Swap from "./Swap"; import { Details } from "./Details"; import MaintenanceBanner from "@/components/modal/MaintenanceBanner"; -import { SwitchToTestNetwork } from "@/staging/components/cross-trade/components/common/WrongNetwork"; -import { BANNER10 } from "@/staging/constants/banner"; -import { InitialBanner } from "@/staging/components/legacy-titan/InitialBanner"; +import { Banner10Component } from "@/staging/components/legacy-titan/Banner10"; +import { BRIDGE_VERSION } from "@/staging/constants/legacyTitan"; +import { LegacyTitanBridgeVersionEnum } from "@/staging/types/legacyTitan"; +import { Banner11Component } from "@/staging/components/legacy-titan/Banner11"; export default function BridgeSwap() { return ( @@ -25,7 +26,12 @@ export default function BridgeSwap() { > {/* */} - {BANNER10 && } + {BRIDGE_VERSION === LegacyTitanBridgeVersionEnum.V01 && ( + + )} + {BRIDGE_VERSION === LegacyTitanBridgeVersionEnum.V10 && ( + + )} {/* */} diff --git a/src/app/BridgeSwap/components/ActionButton.tsx b/src/app/BridgeSwap/components/ActionButton.tsx index 5886076d..c14059da 100644 --- a/src/app/BridgeSwap/components/ActionButton.tsx +++ b/src/app/BridgeSwap/components/ActionButton.tsx @@ -23,6 +23,8 @@ import useSwapConfirmModal from "@/staging/components/new-confirm/hooks/useSwapC // FW UI test @Robert import useCTOptionModal from "@/staging/components/cross-trade/hooks/useCTOptionModal"; +import { LegacyTitanBridgeVersionEnum } from "@/staging/types/legacyTitan"; +import { BRIDGE_VERSION } from "@/staging/constants/legacyTitan"; export default function ActionButton() { const { isConnected } = useAccount(); @@ -47,6 +49,10 @@ export default function ActionButton() { const isDisabled = useMemo(() => { if (!isConnected) return false; + if (BRIDGE_VERSION === LegacyTitanBridgeVersionEnum.V10) { + if (mode === "Deposit" || mode === "Withdraw") return true; + if (isL2) return true; + } if (mode === "Withdraw" && !isInputZero) return false; const disabled = !isReady || diff --git a/src/constant/url/index.ts b/src/constant/url/index.ts index a3e72e15..ba3c3ab2 100644 --- a/src/constant/url/index.ts +++ b/src/constant/url/index.ts @@ -3,3 +3,9 @@ export const GoogleFormURL = export const TitanSunSetGuideURL = "https://medium.com/tokamak-network/tokamak-network-to-sunset-titan-b4471019c92"; + +export const ClaimableListPlanURL = + "https://medium.com/tokamak-network/tokamak-network-to-sunset-titan-b4471019c92"; + +export const WithdrawAssetsGuideURL = + "https://medium.com/tokamak-network/tokamak-network-to-sunset-titan-b4471019c92"; diff --git a/src/staging/components/legacy-titan/InitialBanner.tsx b/src/staging/components/legacy-titan/Banner10.tsx similarity index 97% rename from src/staging/components/legacy-titan/InitialBanner.tsx rename to src/staging/components/legacy-titan/Banner10.tsx index c7c11b79..a6858912 100644 --- a/src/staging/components/legacy-titan/InitialBanner.tsx +++ b/src/staging/components/legacy-titan/Banner10.tsx @@ -2,7 +2,7 @@ import { TitanSunSetGuideURL } from "@/constant/url"; import { Flex, Text } from "@chakra-ui/react"; import React from "react"; -export const InitialBanner = () => { +export const Banner10Component = () => { return ( { + const daysLeft = Math.floor( + (BridgeShutdownDate.getTime() - new Date().getTime()) / + (1000 * 60 * 60 * 24) + ); + return ( + + + + Claimable list plan + + + Read about it more{" "} + + here + + . The exact date will be announced soon. + + + + + + Tokamak Bridge to be shutdown + + + Make sure to withdraw your assets using Tokamak Bridge by end of + January 2025. See this{" "} + + guide + {" "} + . + + + + + + {daysLeft} + {" "} + days Left + + + + + ); +}; diff --git a/src/staging/constants/banner.ts b/src/staging/constants/banner.ts deleted file mode 100644 index 463dd6d0..00000000 --- a/src/staging/constants/banner.ts +++ /dev/null @@ -1,2 +0,0 @@ -export const BANNER10 = true; -export const MAINTENANCE_MODE = false; diff --git a/src/staging/constants/legacyTitan.ts b/src/staging/constants/legacyTitan.ts new file mode 100644 index 00000000..818e97ec --- /dev/null +++ b/src/staging/constants/legacyTitan.ts @@ -0,0 +1,7 @@ +import { LegacyTitanBridgeVersionEnum } from "../types/legacyTitan"; + +export const BRIDGE_VERSION: LegacyTitanBridgeVersionEnum = + LegacyTitanBridgeVersionEnum.V01; + +export const BridgeShutdownDate = new Date("2025-01-31"); +export const TitanShutdownDate = new Date("2024-12-30"); diff --git a/src/staging/types/legacyTitan.ts b/src/staging/types/legacyTitan.ts new file mode 100644 index 00000000..ef010c3a --- /dev/null +++ b/src/staging/types/legacyTitan.ts @@ -0,0 +1,5 @@ +export enum LegacyTitanBridgeVersionEnum { + V01 = "v0.1", + V10 = "v1.0", + V11 = "v1.1", +}