public-assembly / zora-drops-utils

React hooks and query utils for Zora editions contracts
MIT License
4 stars 2 forks source link

Support overlapping presale and public sale windows #69

Open neatonk opened 1 year ago

neatonk commented 1 year ago

Background

Thanks so much for adding support for allowlist/presale features to this repo. We are relying on this feature in the mint UI of the songcamp CC0lab website.

I've copied the code to our repo and made changes needed to support overlapping presale/pub sale windows. Other changes have been made to support custom markup, but that's out-of-scope for this discussion.

The following issues were addressed:

Proposal

Rather than making a proper PR for this I felt it better to discuss what would likely be a better solution.

In our case, the presale option is always preferable, so there is no need to show the public sale option when the connected wallet is on the allowlist.

cc/ @0xTranqui @dblodorn

0xTranqui commented 1 year ago

Thanks for so much detail on this! @dblodorn has been maintaining + moving this repo forward so will defer to him mostly, but have some thoughts about the public/presale options to provide -- which is that I agree with u completely that only showing presale when both are available to the given user (ex: if they are logged in, and they are on presale list, they only see that) makes total sense to me. Perhaps lets just provide an override in the component itself that would let a dev allow both if that was needed for some reason, without them having to fork the package

dblodorn commented 1 year ago

Hey @neatonk thanks so much for the insight and sharing the updates you made in your codebase. Yeah I had been thinking in terms of either or. So this is really helpful.

I have a big pr to merge into main and will implement your work along with some other features i've been thinking on.

One of which is a conditional rendering wrapper to displaying elements based on sale state. This use case surfaced in a project where messaging and some ui not related directly to sales functionality needed to change based on sale state.

Thank you ser. Will ping you on the pr when it's ready!