Skip to content

Commit

Permalink
polishing mint process
Browse files Browse the repository at this point in the history
  • Loading branch information
MattPereira committed Jan 30, 2024
1 parent dcdbc08 commit ec9b0e6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
4 changes: 1 addition & 3 deletions packages/foundry/contracts/OnlyBuidlorsNft.sol
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ contract OnlyBuidlorsNft is ERC721, FunctionsClient, ConfirmedOwner {
// associated with chainlink function
mapping(bytes32 => address) public s_requestIdToMemberAddress;
bytes32 public s_lastRequestId;
// bytes public s_lastResponse;
// bytes public s_lastError;
uint32 public s_gasLimit;
bytes32 public s_donID;
string public s_source =
Expand Down Expand Up @@ -339,7 +337,7 @@ contract OnlyBuidlorsNft is ERC721, FunctionsClient, ConfirmedOwner {
}

/**
* May try to handle minting with chainlink automation listening for "Response" event from function above
* May try to handle minting with chainlink automation by listening for "Response" event from function above
*/
function mintNft() public {
require(
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/contracts/deployedContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2297,7 +2297,7 @@ const deployedContracts = {
},
421614: {
OnlyBuidlorsNft: {
address: "0x3Bc640ab394D8A884C8101335caBd7aA099faa18",
address: "0x3de760aC52F380A4f946C2FA201F02f43098aA7C",
abi: [
{
type: "constructor",
Expand Down
16 changes: 10 additions & 6 deletions packages/nextjs/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const Home: NextPage = () => {

const { address } = useAccount();

// Save ENS name to state for arg in the minting NFT transaction
useEffect(() => {
const fetchEnsName = async () => {
if (address) {
Expand Down Expand Up @@ -170,7 +171,9 @@ const Home: NextPage = () => {
};

if (hasMinted || stepsCompleted === 3) {
setStepsCompleted(3);
if (stepsCompleted !== 3) {
setStepsCompleted(3);
}
if (nftData) {
try {
const decodedString = Buffer.from(nftData.raw.tokenUri, "base64").toString("utf-8");
Expand All @@ -181,6 +184,7 @@ const Home: NextPage = () => {
}
}
} else if (buidlCount && buidlCount > 0n) {
setStepsCompleted(2);
updateImageWithFade("/step-3.jpg");
} else if (stepsCompleted === 1) {
updateImageWithFade("/step-2.jpg");
Expand All @@ -197,7 +201,7 @@ const Home: NextPage = () => {
<section className="p-5 md:p-10 lg:px-16 2xl:p-24 grow flex flex-col">
<div className="grid grid-cols-1 2xl:grid-cols-2 gap-14 pb-20 items-end border-b border-primary">
<div>
<div className="flex justify-center lg:justify-start mb-">
<div className="flex justify-center lg:justify-start">
<div className="mr-5 w-[120px] h-[120px] lg:w-[200px] lg:h-[300px]">
<BuidlGuidlIcon alt="github icon" />
</div>
Expand Down Expand Up @@ -229,12 +233,12 @@ const Home: NextPage = () => {
{steps.map(step => (
<div key={step.number} className="text-2xl flex gap-4 mb-8 items-start">
<div
style={{ minWidth: "40px" }}
style={{ minWidth: "55px" }}
className={`${
stepsCompleted >= step.number ? "bg-green-600" : "bg-primary"
} font-bold w-10 h-10 flex items-center justify-center rounded-full text-primary-content`}
stepsCompleted >= step.number ? "bg-green-600" : "bg-base-300"
} border-2 border-base-content text-3xl font-bold w-[55px] h-[55px] flex items-center justify-center rounded-full text-base-content`}
>
{stepsCompleted >= step.number ? <CheckIcon className="w-6 h-6 text-white" /> : step.number}
{stepsCompleted >= step.number ? <CheckIcon className="w-8 h-8 text-primary" /> : step.number}
</div>
<div>{step.text}</div>
</div>
Expand Down

0 comments on commit ec9b0e6

Please sign in to comment.