hathitrust / firebird-common

Other
0 stars 0 forks source link

Winter break message for feedback form #55

Closed carylwyatt closed 9 months ago

carylwyatt commented 9 months ago

winter break message

I used Roger's date logic from alicorn and Val's suggested wording to create a message for the form that will only show between two dates (in this case Dec 22 - Jan 2). I added a few stories to the storybook, too.

Take a look at the deploy preview on netlify. This links to the Winter Break story, but there is also a winterBreak variable on the other versions of the feedback form modal, so you can toggle the message on and off to see what it will look like in each variant of the modal. I deployed this on dev-3, but it's hard to see something that isn't supposed to work until Dec 22.

~In a perfect world, I'd use this moment to refactor this component, but I have a vague memory that getting this to work in a DRY fashion was not worth figuring out at the time.~ I tried to refactor, but then remembered why this doesn't work: svelte slots don't work with conditionals like I want them to in Svelte 3. There's a new feature in Svelte 5 called snippets that should do the trick. It's ugly for now, but it works!

vite build --watch

I also added a script to package.json to make it easier to reload firebird files when working in babel-local-dev. There's a separate issue with the storybook in babel-local-dev that I still need to address, but this is a good first step.

netlify[bot] commented 9 months ago

Deploy Preview for hathitrust-firebird-common ready!

Name Link
Latest commit 149745afc650567e6345a537b13928a02cf7f251
Latest deploy log https://app.netlify.com/sites/hathitrust-firebird-common/deploys/65775bc708a32e00084b217e
Deploy Preview https://deploy-preview-55--hathitrust-firebird-common.netlify.app/
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

liseli commented 9 months ago

I won't able to reproduce the PR because the message will only appear in some specific days, however I've reviewed the change and it looks ok, so I will approve this PR