// React import { useEffect, useState } from "react"; // NextJs import Image from "next/image"; // Types import { IcnsVerificationResponse, TwitterAuthInfoResponse, } from "../../types/api-response"; import { VerifierMsg } from "../../types/msg"; import { request } from "../../utils/url"; // Styles import color from "../../styles/color"; // Components import { Logo } from "../../components/logo"; import { SkeletonCircle, SkeletonText } from "../../components/skeleton"; import { Container, MainContainer, ContentContainer, ProfileContainer, ProfileFollowContainer, ProfileContentContainer, ProfileImageContainer, ProfileNameContainer, ProfileFollowerContainer, ProfileFollowBold, ProfileUserNameContainer, ProfileDescriptionContainer, ChainListTitle, SearchContainer, ChainContainer, ChainItemContainer, ChainImageContainer, ChainInfoContainer, ChainListTitleContainer, ChainName, WalletAddress, Flex1, ChainCheckBox, ButtonContainer, SkeletonDivider, SkeletonButton, } from "./styled"; import { PrimaryButton } from "../../components/primary-button"; export default function VerificationPage() { const [twitterAuthInfo, setTwitterAuthInfo] = useState(); const [isLoading, setIsLoading] = useState(true); useEffect(() => { setTimeout(() => setIsLoading(false), 1500); }, []); useEffect(() => { const handleVerification = async () => { if (window.location.search) { const [, state, code] = window.location.search.match( /^(?=.*state=([^&]+)|)(?=.*code=([^&]+)|).+$/, ) || []; const newTwitterAuthInfo = await request( `/api/twitter-auth-info?state=${state}&code=${code}`, ); console.log(newTwitterAuthInfo); setTwitterAuthInfo(newTwitterAuthInfo); const verifierMsg: VerifierMsg = { unique_twitter_id: newTwitterAuthInfo.id, name: newTwitterAuthInfo.username, claimer: "osmo1y5mm5nj5m8ttddt5ccspek6xgyyavehrkak7gq", contract_address: "osmo1y5mm5nj5m8ttddt5ccspek6xgyyavehrkak7gq", chain_id: "osmosis-1", }; const icnsVerification = await request( "/api/icns-verification", { method: "post", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ msg: JSON.stringify(verifierMsg), authToken: newTwitterAuthInfo.accessToken, }), }, ); console.log(icnsVerification); } }; handleVerification(); }, []); return ( {isLoading ? ( ) : ( profile image BaeHeesung @BaeHeesung25 42 Following 42 Following Product UIUX designer @Keplrwallet and I like @regen_network🌿 Chain List Search chain image .osmo cosmos14ky6udatsvdx859050mrnr7rvml0huue2wszvs chain image .osmo cosmos14ky6udatsvdx859050mrnr7rvml0huue2wszvs chain image .osmo cosmos14ky6udatsvdx859050mrnr7rvml0huue2wszvs chain image .osmo cosmos14ky6udatsvdx859050mrnr7rvml0huue2wszvs chain image .osmo cosmos14ky6udatsvdx859050mrnr7rvml0huue2wszvs chain image .osmo cosmos14ky6udatsvdx859050mrnr7rvml0huue2wszvs Register )} ); }