Skip to content

Conversation

@kien-ngo
Copy link
Contributor

@kien-ngo kien-ngo commented Dec 31, 2024

Problem solved

Short description of the bug fixed or feature added


PR-Codex overview

This PR enhances the NFTClaimButton component by adding address validation and trimming functionality for the recipient address input, improving user experience and input accuracy.

Detailed summary

  • Added isAddress validation for the recipient address.
  • Implemented custom validation messages for empty and invalid addresses.
  • Trimmed the recipient address before processing the claim transaction.
  • Included setValue in the useForm hook to update the input value on change.

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

@vercel
Copy link

vercel bot commented Dec 31, 2024

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

Name Status Preview Comments Updated (UTC)
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2025 8:15am
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Skipped (Inspect) Jan 3, 2025 8:15am
thirdweb_playground ⬜️ Skipped (Inspect) Jan 3, 2025 8:15am
wallet-ui ⬜️ Skipped (Inspect) Jan 3, 2025 8:15am

@changeset-bot
Copy link

changeset-bot bot commented Dec 31, 2024

⚠️ No Changeset found

Latest commit: 7de1635

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

@vercel vercel bot temporarily deployed to Preview – thirdweb_playground December 31, 2024 03:40 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 December 31, 2024 03:40 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui December 31, 2024 03:40 Inactive
@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Dec 31, 2024
Copy link
Contributor Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

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

@kien-ngo kien-ngo changed the title update [Dashboard] Trim whitespace at the end of the input value for claim form Dec 31, 2024
@kien-ngo kien-ngo marked this pull request as ready for review December 31, 2024 03:41
@kien-ngo kien-ngo requested review from a team and jakubkrehel as code owners December 31, 2024 03:41
@codecov
Copy link

codecov bot commented Dec 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.19%. Comparing base (a9547c5) to head (c6c33f3).
Report is 10 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5860   +/-   ##
=======================================
  Coverage   55.19%   55.19%           
=======================================
  Files        1123     1123           
  Lines       59622    59622           
  Branches     5029     5029           
=======================================
  Hits        32906    32906           
  Misses      25996    25996           
  Partials      720      720           
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from a9547c5
packages 52.84% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 31, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 45.09 KB (0%) 902 ms (0%) 559 ms (+34.36% 🔺) 1.5 s
thirdweb (cjs) 110.84 KB (0%) 2.3 s (0%) 1.4 s (+10.16% 🔺) 3.6 s
thirdweb (minimal + tree-shaking) 5.58 KB (0%) 112 ms (0%) 68 ms (+37% 🔺) 180 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 62 ms (+390.48% 🔺) 72 ms
thirdweb/react (minimal + tree-shaking) 19.12 KB (0%) 383 ms (0%) 225 ms (+142.01% 🔺) 607 ms

const transaction = claimTo({
contract,
to: d.to,
to: d.to.trim(),
Copy link
Member

Choose a reason for hiding this comment

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

whitespace is ignored during validation, so it may or may not have whitespace - but its not removed when passing to claimTo.

Always save the trimmed value instead:

onChange: (e) => {
 form.setValue('to', e.target.value.trim(), { shouldValidate: true });
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated thanks for the review

Copy link
Member

@MananTank MananTank left a comment

Choose a reason for hiding this comment

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

please address comments

@kien-ngo kien-ngo force-pushed the kien/core-491_trim-whitespace-setMetadata-form branch from 7de1635 to c6c33f3 Compare January 3, 2025 08:07
@vercel vercel bot temporarily deployed to Preview – docs-v2 January 3, 2025 08:07 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui January 3, 2025 08:07 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground January 3, 2025 08:07 Inactive
@kien-ngo kien-ngo requested a review from MananTank January 3, 2025 08:54
@gregfromstl gregfromstl merged commit c948e71 into main Jan 3, 2025
32 checks passed
@gregfromstl gregfromstl deleted the kien/core-491_trim-whitespace-setMetadata-form branch January 3, 2025 22:44
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.

4 participants