Fix complete page, Fix Osmo fee in index page

This commit is contained in:
HeesungB 2022-12-17 01:57:10 +09:00
parent 75656943a1
commit a35e7bb9af
3 changed files with 27 additions and 12 deletions

View File

@ -8,6 +8,7 @@ export const WALLET_INSTALL_URL =
export const SELECTED_WALLET_KEY = "SELECTED_WALLET_KEY";
export const MINIMUM_VERSION = "0.11.22";
export const MINIMUM_OSMO_FEE = process.env.MINIMUM_OSMO_FEE ?? "0.5 OSMO";
export type WalletName = "Keplr" | "Cosmostation";
export interface WalletType {

View File

@ -23,9 +23,10 @@ export default function CompletePage() {
const [availableAddress, setAvailableAddress] = useState("");
const [isSuccess, setIsSuccess] = useState<boolean>(false);
useEffect(() => {
const { txHash, twitterUsername } = router.query;
if (txHash && twitterUsername) {
initialize(txHash as string, twitterUsername as string);
}
@ -37,23 +38,30 @@ export default function CompletePage() {
"/websocket",
);
const result: { code?: number } = await txTracer.traceTx(
Buffer.from(txHash, "hex"),
);
try {
const result: { code?: number } = await txTracer.traceTx(
Buffer.from(txHash, "hex"),
);
if (result.code || result.code === 0) {
const addresses = await queryAddressesFromTwitterName(twitterUserName);
setRegisteredAddressed(addresses.data.addresses);
if (!result.code || result.code === 0) {
const addresses = await queryAddressesFromTwitterName(twitterUserName);
setRegisteredAddressed(addresses.data.addresses);
setIsSuccess(true);
}
} catch (e) {
console.log("error", e);
}
};
const onClickShareButton = () => {
const { twitterUsername } = router.query;
const shareMessage = `👨‍🚀 To Interchain... And Beyond!%0a%0aHey frens, I just minted my name for the interchain on @icns_xyz: ${twitterUsername}%0a%0aClaim yours now ▶`;
const width = 500;
const height = 700;
window.open(
`${SHARE_URL}?url=https://www.icns.xyz/&text=${twitterUsername}`,
`${SHARE_URL}?url=https://www.icns.xyz?referral=${twitterUsername}/&text=${shareMessage}`,
"Share Twitter",
`top=${(window.screen.height - height) / 2}, left=${
(window.screen.width - width) / 2
@ -67,7 +75,13 @@ export default function CompletePage() {
<MainContainer>
<MainTitle>
<div>Your Name is Active Now!</div>
{isSuccess && (
<Typed
strings={["Your Name is Active Now!"]}
stopped={!isSuccess}
typeSpeed={100}
/>
)}
</MainTitle>
<ContentContainer>
<RecipentContainer>

View File

@ -15,7 +15,7 @@ import MainLogo from "../public/images/svg/main-logo.svg";
import CheckIcon from "../public/images/svg/check-icon.svg";
import { Logo } from "../components/logo";
import { useEffect, useState } from "react";
import { SELECTED_WALLET_KEY } from "../constants/wallet";
import { MINIMUM_OSMO_FEE, SELECTED_WALLET_KEY } from "../constants/wallet";
import { replaceToInstallPage } from "../utils/url";
import { REFERRAL_KEY } from "../constants/icns";
@ -87,8 +87,8 @@ export default function Home() {
alt="Check Icon"
/>
</CheckIconContainer>
<CheckBoldText>Osmo&nbsp;</CheckBoldText> is required for this
transaction
<CheckBoldText>{MINIMUM_OSMO_FEE}&nbsp;</CheckBoldText> is
required for this transaction
</CheckContainer>
</SubContainer>
</MainTitleContainer>