Skip to content

Commit

Permalink
Merge pull request #993 from Verifieddanny/fix-953
Browse files Browse the repository at this point in the history
fix: Refont domain registration step 2
  • Loading branch information
Marchand-Nicolas authored Jan 25, 2025
2 parents 115cb7e + 375e175 commit 9937c82
Show file tree
Hide file tree
Showing 3 changed files with 730 additions and 694 deletions.
133 changes: 66 additions & 67 deletions components/identities/pfpGallery.tsx
Original file line number Diff line number Diff line change
@@ -1,67 +1,66 @@
import React, { FunctionComponent, useState } from "react";
import styles from "../../styles/components/profilePic.module.css";
import NftCard from "../UI/nftCard";
import { debounce } from "../../utils/debounceService";
import WarningMessage from "../UI/warningMessage";
import PfpSkeleton from "./skeletons/pfpSkeleton";

type PfpGalleryProps = {
userNfts: StarkscanNftProps[];
isLoading?: boolean;
selectPfp: (nft: StarkscanNftProps) => void;
selectedPfp?: StarkscanNftProps | null;
};

const PfpGallery: FunctionComponent<PfpGalleryProps> = ({
userNfts,
isLoading = false,
selectPfp,
selectedPfp,
}) => {
const [isHovered, setIsHovered] = useState<string | null>(null);

const handleMouseEnter = debounce((id: string) => setIsHovered(id), 50);
const handleMouseLeave = debounce(() => setIsHovered(null), 50);

return (
<>
<div>
<p className={styles.subtitle}>Your NFTs</p>
<h2 className={styles.title}>Choose your NFT Profile picture</h2>
<div className={styles.nftSection}>
{isLoading ? (
<PfpSkeleton />
) : userNfts && userNfts.length > 0 ? (
userNfts.map((nft, index) => {
if (!nft.image_url) return null;
return (
<div
key={index}
onMouseEnter={() => handleMouseEnter(nft.token_id)}
onMouseLeave={handleMouseLeave}
>
<NftCard
image={nft.image_url as string}
name={nft.name as string}
selectPicture={() => selectPfp(nft)}
isHovered={isHovered === nft.token_id}
isSelected={selectedPfp?.token_id === nft.token_id}
/>
</div>
);
})
) : (
<div className="flex flex-col align-middle items-center">
<img src="/visuals/notFound.webp" alt="Not found" width={201} />
<WarningMessage>
You don&apos;t own any whitelisted NFTs yet
</WarningMessage>
</div>
)}
</div>
</div>
</>
);
};

export default PfpGallery;
import React, { FunctionComponent, useState } from "react";
import styles from "../../styles/components/profilePic.module.css";
import NftCard from "../UI/nftCard";
import { debounce } from "../../utils/debounceService";
import WarningMessage from "../UI/warningMessage";
import PfpSkeleton from "./skeletons/pfpSkeleton";

type PfpGalleryProps = {
userNfts: StarkscanNftProps[];
isLoading?: boolean;
selectPfp: (nft: StarkscanNftProps) => void;
selectedPfp?: StarkscanNftProps | null;
};

const PfpGallery: FunctionComponent<PfpGalleryProps> = ({
userNfts,
isLoading = false,
selectPfp,
selectedPfp,
}) => {
const [isHovered, setIsHovered] = useState<string | null>(null);

const handleMouseEnter = debounce((id: string) => setIsHovered(id), 50);
const handleMouseLeave = debounce(() => setIsHovered(null), 50);

return (
<>
<div>
<h2 className={styles.title}>Choose your NFT Profile picture</h2>
<div className={styles.nftSection}>
{isLoading ? (
<PfpSkeleton />
) : userNfts && userNfts.length > 0 ? (
userNfts.map((nft, index) => {
if (!nft.image_url) return null;
return (
<div
key={index}
onMouseEnter={() => handleMouseEnter(nft.token_id)}
onMouseLeave={handleMouseLeave}
>
<NftCard
image={nft.image_url as string}
name={nft.name as string}
selectPicture={() => selectPfp(nft)}
isHovered={isHovered === nft.token_id}
isSelected={selectedPfp?.token_id === nft.token_id}
/>
</div>
);
})
) : (
<div className="flex flex-col align-middle items-center">
<img src="/visuals/notFound.webp" alt="Not found" width={201} />
<WarningMessage>
You don&apos;t own any whitelisted NFTs yet
</WarningMessage>
</div>
)}
</div>
</div>
</>
);
};

export default PfpGallery;
Loading

0 comments on commit 9937c82

Please sign in to comment.