Skip to content

Commit

Permalink
feat(migrator): show what's next screen (#130)
Browse files Browse the repository at this point in the history
* feat(migrator): show what's next screen

* feat(migrator): add close button instead x
  • Loading branch information
abbylow authored Jul 21, 2023
1 parent 79f00c8 commit 20e97df
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
19 changes: 17 additions & 2 deletions apps/converter/src/components/converter/dialogue/Completed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
L1_BITDAO_TOKEN_ADDRESS,
L1_MANTLE_TOKEN,
L1_CHAIN_ID,
CTAPages,
} from "@config/constants";
import { Button, Typography } from "@mantle/ui";
import TxLink from "@components/converter/utils/TxLink";
Expand All @@ -28,7 +29,8 @@ export default function Deposited({
}) {
const { addToken } = useAddToken();
const { createToast } = useToast();
const { chainId, isLoadingBalances, balances } = useContext(StateContext);
const { chainId, isLoadingBalances, balances, setCTAPage } =
useContext(StateContext);

useEffect(() => {
if (typeof txHash === "string") {
Expand Down Expand Up @@ -101,6 +103,10 @@ export default function Deposited({
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isLoadingBalances, txHash, BITBalance, hasBitBalanceRemaining]);

const openWhatsNext = () => {
setCTAPage(CTAPages.WhatsNext);
};

return (
<>
<Typography variant="modalHeading" className="text-center w-full mt-4">
Expand All @@ -120,12 +126,21 @@ export default function Deposited({
type="button"
size="full"
className="h-14 flex flex-row gap-4 text-center items-center justify-center my-4"
variant="secondary"
variant="dark"
onClick={() => addToken(L1_MANTLE_TOKEN)}
>
<Image src={MetamaskSvg} alt="metamask" height={26} width={26} />
Add MNT to Wallet
</Button>
<Button
type="button"
size="full"
className="h-14 flex flex-row gap-4 text-center items-center justify-center my-4"
variant="primary"
onClick={openWhatsNext}
>
Close
</Button>
</div>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function WhatNextLink({
);
}

export default function Deposited({
export default function WhatsNext({
txHash,
from,
closeModal,
Expand Down
9 changes: 8 additions & 1 deletion apps/converter/src/components/converter/dialogue/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Loading from "@components/converter/dialogue/Loading";
import Error from "@components/converter/dialogue/Error";

import Converted from "@components/converter/dialogue/Completed";

import WhatsNext from "@components/converter/dialogue/WhatsNext";
import { ConvertCard } from "@components/ConvertCard";
import { formatUnits, parseUnits } from "ethers/lib/utils.js";

Expand Down Expand Up @@ -88,6 +88,13 @@ export default function Dialogue() {
closeModal={closeModalAndReset}
/>
)}
{ctaPage === CTAPages.WhatsNext && (
<WhatsNext
txHash={txHash}
from={from}
closeModal={closeModalAndReset}
/>
)}
{ctaPage === CTAPages.Loading && (
<Loading
txHash={txHash}
Expand Down
1 change: 1 addition & 0 deletions apps/converter/src/config/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export enum CTAPages {
"Default",
"Loading",
"Converted",
"WhatsNext",
"Error",
}

Expand Down

2 comments on commit 20e97df

@vercel
Copy link

@vercel vercel bot commented on 20e97df Jul 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

ethcc – ./apps/events

ethcc-git-main-mantle-xyz.vercel.app
ethcc-mantle.vercel.app
ethcc-mantle-xyz.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 20e97df Jul 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.