Skip to content

Commit

Permalink
refactor: SuccessStatus.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
0x7u committed Feb 21, 2025
1 parent 6d913db commit d16b8fc
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions components/send/SuccessStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,20 @@ export const SuccessStatus = ({ transactionIds }: SuccessProps) => {
const isKrc20Operation = "opData" in formFields;
const ticker = isKrc20Operation ? formFields.opData.tick : "KAS";
const op = isKrc20Operation ? formFields?.opData?.op : "";
const opFormatted = op === "deploy" ? "Deployed" : "Minted";
const title = !isKrc20Operation
? `${ticker} ${opFormatted}`
: "KAS Dispatched!";
const krc20DescriptionFormatted =
op === "deploy"
? "A new token has been forget"
: `${ticker} has been forged!`;
const opTitle: Record<string, string> = {
transfer: `${ticker} Dispatched`,
deploy: `${ticker} Deployed`,
mint: `${ticker} Minted`,
};
const opDescription: Record<string, string> = {
transfer: `Your ${ticker} has been sent to the recipient's address`,
deploy: "A new token has been forget",
mint: `${ticker} has been forged!`,
};

const title = isKrc20Operation ? opTitle[op] : "KAS Dispatched!";
const description = isKrc20Operation
? krc20DescriptionFormatted
? opDescription[op]
: "Your KAS has been sent to the recipient's address";

const openTransactions = () => {
Expand Down

0 comments on commit d16b8fc

Please sign in to comment.