Closed QuintonC closed 1 year ago
/snapit
🫰✨ Thanks @QuintonC! Your snapshot has been published to npm.
Test the snapshot by updating your package.json
with the newly published version:
yarn add @shopify/tokengate@0.0.0-snapshot-20230511185047
LGTM
This is good as-is. Some of these changes seem like a matter of preference rather than needing to be done to test/clean up the code. I only mention this b/c you mentioned this PR being a bigger one.
👍 It's a mix of quite a few things which I think make it big. Those things being preference, organization, separation of concerns (in some areas), adding tests where there weren't tests before, supporting custom titles + pluralization, and addressing a bug with the redemption limit subtitle + adding tests for that fix.
⚠️ Fixes:
ℹ️ What is the context for these changes?
This PR adds support for custom
discountTitles
that retain the discount value within the title. This will work for bothlocked
andunlocked
title variants.This also relocates some code that was used for tokengate state / titles, etc. The files were quite large and becoming cumbersome to comb through while attempting to add support for new features.
🕹️ Demonstration
Dynamic values
Order limits
🎩 How can this be tophatted?
I updated Storybook to include the ability to specify custom titles in it. To place the dynamic value anywhere, just place
{{value}}
inside of your custom title.📖 Storybook
✅ Checklist