Skip to content

Commit

Permalink
Minor frontend improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
luloxi committed Sep 17, 2024
1 parent 38c3907 commit a402537
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions packages/nextjs/app/simpleMint/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,20 @@ const SimpleMint: NextPage = () => {
setAttributes(newAttributes);
};

// const [mounted, setMounted] = useState(false);

// Check if this is working properly
// Used for database: Check if this is working properly
// const { trigger: postCollectionData } = useSWRMutation("/api/collections/new", postMutationFetcher); // SWR for API call

// Automatically update the JSON whenever the fields change
useEffect(() => {
// Function that generates the token URI and updates the JSON
const generateTokenURIString = () => {
const tokenURI = generateTokenURI(collectionName, description, image, animationUrl, attributes);
setYourJSON(JSON.parse(atob(tokenURI.split(",")[1])));
};

generateTokenURIString();
}, [collectionName, description, image, animationUrl, attributes]);

// Function that generates the token URI and updates the JSON
const generateTokenURIString = () => {
const tokenURI = generateTokenURI(collectionName, description, image, animationUrl, attributes);
setYourJSON(JSON.parse(atob(tokenURI.split(",")[1])));
};

// Is this necessary?
// useEffect(() => {
// setMounted(true);
// }, []);

const handleSignAndUpload = async () => {
if (!connectedAddress) {
notification.error("Please connect your wallet");
Expand Down

0 comments on commit a402537

Please sign in to comment.