import { Bech32Address } from "@keplr-wallet/cosmos"; import Image from "next/image"; import { useRouter } from "next/router"; import { FunctionComponent } from "react"; import ReactModal from "react-modal"; import styled from "styled-components"; import { MINIMUM_OSMO_FEE } from "../../constants/wallet"; import color from "../../styles/color"; import { PrimaryButton } from "../primary-button"; import { SecondaryButton } from "../secondary-button"; interface Props { twitterUserName: string | undefined; walletInfo: | { name: string; pubKey: Uint8Array; bech32Address: string } | undefined; isModalOpen: boolean; onCloseModal: () => void; onClickRegisterButton: () => Promise; isLoadingRegistration?: boolean; } export const FinalCheckModal: FunctionComponent = (props) => { const { twitterUserName, walletInfo, isModalOpen, onCloseModal, onClickRegisterButton, isLoadingRegistration, } = props; const router = useRouter(); return ( Final Checks {`You are claiming the ICNS name "${twitterUserName}" on Keplr account`} } title="Your Twitter Handle" content={`${twitterUserName}`} />
} title={walletInfo?.name || "Keplr account"} content={Bech32Address.shortenAddress( walletInfo?.bech32Address || "", 28, )} /> ICNS name can only be claimed once per Twitter account. ICNS name can’t be transferred at this time. Please make sure you’ve selected the right account on your wallet. {MINIMUM_OSMO_FEE} will be spent as a spam-prevention fee. Register { await router.push("/"); }} > Use a different account
); }; const ModalContainer = styled.div` display: flex; flex-direction: column; max-width: 37.5rem; padding: 2rem 2.25rem; font-family: "Inter", serif; font-style: normal; `; const ModalTitle = styled.div` font-weight: 600; font-size: 1.625rem; line-height: 1.94rem; color: ${color.white}; margin-bottom: 1.75rem; `; const ModalDescription = styled.div` font-weight: 400; font-size: 0.875rem; line-height: 1.18rem; color: ${color.grey["100"]}; `; const SubTextsContainer = styled.div` margin-top: 1.75rem; padding: 1rem 1.75rem; background-color: ${color.grey["700"]}; `; const SubTextList = styled.ul` margin: 0 0 1rem; padding: 0 0.75rem; `; const SubTextListItem = styled.li` font-weight: 400; font-size: 0.815rem; line-height: 1.5rem; color: ${color.grey["300"]}; `; const SubText = styled.div` font-weight: 600; font-size: 13px; line-height: 1.5rem; color: ${color.grey["200"]}; `; const ButtonContainer = styled.div` display: flex; flex-direction: column; align-items: center; margin-top: 1.75rem; `; const RegisterButton = styled.div` width: 60%; height: 4.125rem; `; const CancelButton = styled.div` width: 80%; margin-top: 0.75rem; `; const NameBox: FunctionComponent<{ title: string; content: string; icon?: React.ReactElement; marginTop: string; }> = ({ icon, title, content, marginTop }) => { return ( {icon ? {icon} : null} {title} {content} ); }; const NameBoxContainer = styled.div` position: relative; display: flex; flex-direction: column; font-family: "Inter", serif; font-style: normal; `; const NameBoxTitleContainer = styled.div` position: absolute; top: -1.9rem; display: flex; flex-direction: row; align-items: center; `; const NameBoxIconContainer = styled.div` display: flex; align-items: center; height: 1px; `; const NameBoxTitle = styled.div` font-weight: 500; font-size: 1rem; line-height: 1.18rem; color: ${color.grey["100"]}; `; const NameBoxContentContainer = styled.div` display: flex; align-items: center; justify-content: center; padding: 2rem 0; background-color ${color.grey["600"]}; border: 1px solid ${color.grey["300"]}; font-weight: 600; font-size: 1.375rem; line-height: 1.6875rem; color: ${color.white} `;