From 6ae5dcb5a616d12dbc281131357c7ebb76271f10 Mon Sep 17 00:00:00 2001 From: Martin Date: Mon, 4 Nov 2024 12:28:30 -0300 Subject: [PATCH] fix: advice at registration to check PoHID and wallet connected --- src/app/[pohid]/claim/Form.tsx | 32 +++++++++++++++--------------- src/app/[pohid]/claim/Review.tsx | 34 +++++++++++++++++++++++--------- 2 files changed, 41 insertions(+), 25 deletions(-) diff --git a/src/app/[pohid]/claim/Form.tsx b/src/app/[pohid]/claim/Form.tsx index 2f002b3..9bb340b 100644 --- a/src/app/[pohid]/claim/Form.tsx +++ b/src/app/[pohid]/claim/Form.tsx @@ -1,28 +1,28 @@ "use client"; -import { Fragment, useMemo } from "react"; -import Finalized from "./Finalized"; -import InfoStep from "./Info"; -import PhotoStep from "./Photo"; -import ReviewStep from "./Review"; -import VideoStep from "./Video"; +import { enableReactUse } from "@legendapp/state/config/enableReactUse"; import { Show, Switch, useObservable } from "@legendapp/state/react"; -import { useAccount, useChainId } from "wagmi"; -import withClientConnected from "components/HighOrder/withClientConnected"; -import { useParams } from "next/navigation"; -import { Hash, parseEther } from "viem"; import cn from "classnames"; -import { enableReactUse } from "@legendapp/state/config/enableReactUse"; -import Connect from "./Connect"; +import withClientConnected from "components/HighOrder/withClientConnected"; import { SupportedChain, SupportedChainId } from "config/chains"; -import { RegistrationQuery } from "generated/graphql"; +import { Effects } from "contracts/hooks/types"; import usePoHWrite from "contracts/hooks/usePoHWrite"; +import { ContractData } from "data/contract"; +import { RegistrationQuery } from "generated/graphql"; +import { useLoading } from "hooks/useLoading"; +import { useParams } from "next/navigation"; +import { Fragment, useMemo } from "react"; import { toast } from "react-toastify"; import { machinifyId } from "utils/identifier"; -import { Effects } from "contracts/hooks/types"; import { uploadToIPFS } from "utils/ipfs"; -import { useLoading } from "hooks/useLoading"; -import { ContractData } from "data/contract"; +import { Hash, parseEther } from "viem"; +import { useAccount, useChainId } from "wagmi"; +import Connect from "./Connect"; +import Finalized from "./Finalized"; +import InfoStep from "./Info"; +import PhotoStep from "./Photo"; +import ReviewStep from "./Review"; +import VideoStep from "./Video"; enableReactUse(); diff --git a/src/app/[pohid]/claim/Review.tsx b/src/app/[pohid]/claim/Review.tsx index cebceda..e24a8b4 100644 --- a/src/app/[pohid]/claim/Review.tsx +++ b/src/app/[pohid]/claim/Review.tsx @@ -1,19 +1,19 @@ +import { ObservableObject, ObservablePrimitiveBaseFns } from "@legendapp/state"; +import ExternalLink from "components/ExternalLink"; import Field from "components/Field"; import Label from "components/Label"; +import Previewed from "components/Previewed"; import TimeAgo from "components/TimeAgo"; +import { SupportedChainId, idToChain } from "config/chains"; +import { ContractData } from "data/contract"; +import DocumentIcon from "icons/NoteMajor.svg"; +import Image from "next/image"; +import { prettifyId } from "utils/identifier"; import { ipfs } from "utils/ipfs"; import { formatEth } from "utils/misc"; +import { formatEther } from "viem"; import { useAccount, useBalance, useChainId } from "wagmi"; -import { ObservableObject, ObservablePrimitiveBaseFns } from "@legendapp/state"; import { MediaState, SubmissionState } from "./Form"; -import { formatEther } from "viem"; -import { SupportedChainId, idToChain } from "config/chains"; -import ExternalLink from "components/ExternalLink"; -import Image from "next/image"; -import Previewed from "components/Previewed"; -import DocumentIcon from "icons/NoteMajor.svg"; -import { ContractData } from "data/contract"; -import { prettifyId } from "utils/identifier"; interface ReviewProps { arbitrationInfo: ContractData["arbitrationInfo"]; @@ -159,6 +159,22 @@ function Review({ after failure. Any amount not contributed now can be put up by crowdfunders later. + {pohId.toLowerCase() !== address?.toLowerCase() ? ( + + Beware: Your PoH + ID differs from the wallet address connected to your account. If + you're registering for the first time, this discrepancy is a + consequence of changing the connected wallet during the + registration process. In such cases, to make both addresses match, + you may need to change the connected wallet to the original wallet + used at the beginning of the registration process, or else + reinitiate the registration process. If you are not a newcomer and + wish to reclaim your ID from a different wallet (e.g., if you have + lost the private key to your original wallet), please confirm that + the PoH ID you are using is the one from your initial + registration. + + ) : null} {loadingMessage ? (