Skip to content

Commit

Permalink
fix style + bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Marchand-Nicolas committed Jul 24, 2024
1 parent ad63133 commit 3a10d57
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
4 changes: 3 additions & 1 deletion components/identities/identityCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ const IdentityCard: FunctionComponent<IdentityCardProps> = ({
</div>
{minting ? (
<div className="text-left h-full py-2">
<h1 className="text-3xl font-bold">Minting your identity...</h1>
<h1 className="text-3xl font-bold font-quickZap">
Minting your identity...
</h1>
<p>This page will refresh automatically</p>
<Skeleton className="mt-3" variant="rounded" height={30} />
<Skeleton className="mt-3" variant="rounded" height={58} />
Expand Down
25 changes: 19 additions & 6 deletions pages/identities/[tokenId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,24 @@ const TokenIdPage: NextPage = () => {
const [isTxModalOpen, setIsTxModalOpen] = useState(false);
const [ppTxHash, setPpTxHash] = useState<string>();
const [ppImageUrl, setPpImageUrl] = useState("");
const [minting, setMinting] = useState(false);
const searchParams = useSearchParams();
const minting = searchParams.get("minting") === "true";
const mintingInUrl = searchParams.get("minting") === "true";

useEffect(() => {
if (mintingInUrl) setMinting(true);
else setMinting(false);
}, [mintingInUrl]);

const endMinting = useCallback(() => {
router.replace(router.asPath.split("?")[0]);
setMinting(false);
setHideActions(false);
}, [router]);

useEffect(() => {
if (minting && identity) endMinting();
}, [minting, identity, endMinting]);

useEffect(() => {
if (!identity || !address) {
Expand Down Expand Up @@ -78,10 +94,7 @@ const TokenIdPage: NextPage = () => {
return response.json();
})
.then((data: IdentityData) => {
if (minting) {
router.replace(router.asPath.split("?")[0]);
setHideActions(false);
}
if (minting) endMinting();
setIdentity(new Identity(data));
setIsIdentityADomain(Boolean(data?.domain));
})
Expand All @@ -95,7 +108,7 @@ const TokenIdPage: NextPage = () => {
setIsIdentityADomain(false);
}
}),
[tokenId, minting, router]
[tokenId, minting, endMinting]
);

useEffect(() => {
Expand Down

0 comments on commit 3a10d57

Please sign in to comment.