Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added possibility to set a max and min amount of items in the array f… #341

Merged
merged 5 commits into from
Feb 26, 2024

Conversation

jabba-the-bug
Copy link
Contributor

Implemented what was described in this issue
#326

the code will disable delete/add buttons once the specified limit is reached
it will also swap the default icon for the alert-circle icon

Copy link

vercel bot commented Feb 2, 2024

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

Name Status Preview Comments Updated (UTC)
puck-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 26, 2024 10:19am
puck-docs ✅ Ready (Inspect) Visit Preview Feb 26, 2024 10:19am

Copy link

vercel bot commented Feb 2, 2024

@simon-virkesborsen is attempting to deploy a commit to the Measured Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Member

@chrisvxd chrisvxd left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution @jabba-the-bug, great stuff! Left one comment.

Can you also fix the formatting issues from the build? You can do that with yarn format.

I'd also appreciate it if you added an example to the demo app - perhaps limit the buttons on the hero to min: 1 and max: 4.

Finally, I'll need to add documentation to this. I'm happy to do it in a follow up PR.

@jabba-the-bug
Copy link
Contributor Author

  • Fixed the min, max example for the hero buttons
  • removed use of AlertCircle
  • ran yarn format
  • added some documentation for use of min, max

Let me know if there is anything else needed.
I've never used prettier before got a bunch of changed files only commited the files I've touched, hope that was correct

Copy link
Member

@chrisvxd chrisvxd left a comment

Choose a reason for hiding this comment

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

Looks good! I'll make a few tweaks to docs after merge, but can you run yarn format again? Your build is still failing.

disabled={
field.max !== undefined &&
localState.arrayState.items.length >= field.max
}
Copy link
Member

Choose a reason for hiding this comment

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

Looks like we're missing disabled styles for this and the IconButton. I'll open a separate ticket for that.

@jabba-the-bug
Copy link
Contributor Author

Ran yarn format :)

Copy link
Member

@chrisvxd chrisvxd left a comment

Choose a reason for hiding this comment

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

🎉

@chrisvxd chrisvxd merged commit 53b7937 into measuredco:main Feb 26, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants