-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
45fe9f1
commit e8e9611
Showing
10 changed files
with
133 additions
and
9 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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,55 @@ | ||
import { useState } from "react"; | ||
import { IoMdClose } from "react-icons/io"; | ||
import { useLocalStorage } from "usehooks-ts"; | ||
|
||
import { shouldDisableUnbonding } from "@/config"; | ||
|
||
import { GeneralModal } from "./GeneralModal"; | ||
|
||
const Title: React.FC = () => { | ||
return ( | ||
<h3 className="font-bold">Unbonding disabled during Phase-2 Transition</h3> | ||
); | ||
}; | ||
|
||
const Content: React.FC = () => { | ||
return ( | ||
<div className="text-text-black dark:text-white"> | ||
<div className="mt-6 flex flex-col gap-4"> | ||
<p> | ||
In preparation for the upcoming Phase-2 testnet launch in DATE, | ||
on-demand stake unbonding is disabled. | ||
<br /> | ||
Once the Phase-2 testnet is launched, you will be able to transit your | ||
Signet BTC stake to Phase-2 and then unbond. | ||
</p> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export const UnbondingDisabledModal: React.FC = () => { | ||
const [unbondingDisabledModalOpened, setUnbondingDisabledModalOpened] = | ||
useLocalStorage<boolean>("bbn-unbonding-disabled-modal-opened", false); | ||
|
||
const [unbondingDisabledModalOpen, setUnbondingDisabledModalOpen] = useState( | ||
!unbondingDisabledModalOpened && shouldDisableUnbonding(), | ||
); | ||
|
||
const onClose = () => { | ||
setUnbondingDisabledModalOpen(false); | ||
setUnbondingDisabledModalOpened(true); | ||
}; | ||
|
||
return ( | ||
<GeneralModal open={unbondingDisabledModalOpen} onClose={onClose}> | ||
<div className="mb-4 flex items-center justify-between"> | ||
<Title /> | ||
<button className="btn btn-circle btn-ghost btn-sm" onClick={onClose}> | ||
<IoMdClose size={24} /> | ||
</button> | ||
</div> | ||
<Content /> | ||
</GeneralModal> | ||
); | ||
}; |
32 changes: 32 additions & 0 deletions
32
src/app/components/UnbondingDisabledBanner/UnbondingDisabledBanner.tsx
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,32 @@ | ||
import Image from "next/image"; | ||
import { FC } from "react"; | ||
|
||
import BannerWarningIcon from "@/app/assets/banner-warning.svg"; | ||
import { shouldDisableUnbonding } from "@/config"; | ||
|
||
interface UnbondingDisabledBannerProps {} | ||
|
||
export const UnbondingDisabledBanner: FC<UnbondingDisabledBannerProps> = () => { | ||
if (!shouldDisableUnbonding()) return null; | ||
return ( | ||
<div className="w-full bg-[#FDF2EC] min-h-[50px] p-2 lg:min-h-[40px] flex items-center justify-center"> | ||
<div className="flex items-center"> | ||
<Image | ||
src={BannerWarningIcon} | ||
alt="Warning Icon" | ||
className="mr-2 text-sm" | ||
/> | ||
<p className="text-xs md:text-sm text-black text-center flex flex-col md:block"> | ||
<strong className="block mb-1 md:mb-0 md:inline"> | ||
Unbonding disabled during Phase-2 Transition | ||
<span className="hidden md:inline">:</span> | ||
</strong>{" "} | ||
<span className="block text-xs md:text-sm md:inline"> | ||
To support a smooth transition of the testnet to Phase-2, on-demand | ||
unbonding has been disabled until the phase-2 testnet launch. | ||
</span> | ||
</p> | ||
</div> | ||
</div> | ||
); | ||
}; |
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