Skip to content

Conversation

@GWSzeto
Copy link
Contributor

@GWSzeto GWSzeto commented Oct 30, 2024

Problem solved

Short description of the bug fixed or feature added


PR-Codex overview

This PR introduces a new RoyaltyModule component for managing royalty information and transfer validation for NFTs. It allows users to set and update royalty details and includes a form for inputting the necessary data.

Detailed summary

  • Added RoyaltyModule component to handle royalty info and transfer validator.
  • Implemented RoyaltyInfoFormValues and RoyaltyModuleFormValues types.
  • Integrated useReadContract for fetching default royalty info and transfer validator.
  • Created setRoyaltyInfoForToken and update functions for transaction handling.
  • Developed RoyaltyModuleUI for rendering the form and handling submissions.
  • Added form fields for recipient, royalty BPS, and transfer validator.
  • Utilized react-hook-form for form state management and validation.
  • Incorporated toast notifications for transaction success and failure feedback.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@vercel
Copy link

vercel bot commented Oct 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
thirdweb-www ❌ Failed (Inspect) Oct 30, 2024 5:44pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Skipped (Inspect) Oct 30, 2024 5:44pm
thirdweb_playground ⬜️ Skipped (Inspect) Oct 30, 2024 5:44pm
wallet-ui ⬜️ Skipped (Inspect) Oct 30, 2024 5:44pm

@changeset-bot
Copy link

changeset-bot bot commented Oct 30, 2024

⚠️ No Changeset found

Latest commit: d2d6a95

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 30, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Oct 30, 2024
Copy link
Contributor Author

GWSzeto commented Oct 30, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @GWSzeto and the rest of your teammates on Graphite Graphite

@GWSzeto GWSzeto marked this pull request as ready for review October 30, 2024 17:39
Comment on lines +161 to +169
const _setRoyaltyInfoForToken = async () => {
const promise = setRoyaltyInfoForTokenMutation.mutateAsync(
form.getValues(),
);
toast.promise(promise, {
success: "Successfully set royalty info for token",
error: "Failed to set royalty info for token",
});
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The _setRoyaltyInfoForToken function appears to be dead code and has a potential bug - it attempts to use the form values directly but the form schema doesn't include the required tokenId field that the mutation expects. Consider either removing this unused function or implementing it properly by adding a tokenId input field to the form.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

name="transferValidator"
render={({ field }) => (
<FormItem className="flex flex-1 flex-col gap-3">
<FormLabel>Primary Sale Recipient</FormLabel>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The label Primary Sale Recipient appears to be a copy/paste error for the transferValidator form field. The label should be Transfer Validator to correctly describe the field's purpose and maintain consistency with the variable name.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 43 KB (0%) 861 ms (0%) 1.2 s (+56.41% 🔺) 2 s
thirdweb (cjs) 102.91 KB (0%) 2.1 s (0%) 2.1 s (+50.86% 🔺) 4.1 s
thirdweb (minimal + tree-shaking) 4.84 KB (0%) 97 ms (0%) 191 ms (+225.4% 🔺) 288 ms
thirdweb/chains (tree-shaking) 498 B (0%) 10 ms (0%) 242 ms (+2107.27% 🔺) 252 ms
thirdweb/react (minimal + tree-shaking) 17.38 KB (0%) 348 ms (0%) 471 ms (+268.34% 🔺) 819 ms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Dashboard Involves changes to the Dashboard.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants