gita / gita-frontend-v2

Frontend for BhagavadGita.io v2
https://bhagavadgita.io
MIT License
43 stars 53 forks source link

Fix newsletter subscription and UI modal #203

Closed Gupta-Anubhav12 closed 1 year ago

Gupta-Anubhav12 commented 1 year ago

Summary by CodeRabbit

vercel[bot] commented 1 year ago

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

Name Status Preview Updated (UTC)
bhagavad-gita ✅ Ready (Inspect) Visit Preview Sep 3, 2023 3:10pm
github-actions[bot] commented 1 year ago

Image description CodeRabbit

Walkthrough

This pull request introduces a more accessible and transition-friendly UI modal component using the @headlessui/react library. It also refines the newsletter subscription logic by storing mutation results in a variable, enhancing readability and maintainability.

Changes

File(s) Summary
gqty.config.cjs Removed an unnecessary line of code that throws an error if the NEXT_PUBLIC_GRAPHQL_ENDPOINT environment variable is not defined.
src/components/Home/Modal.tsx Replaced the previous implementation with a new one that uses the @headlessui/react library for improved accessibility and transitions. Refactored to use the Transition and Dialog components from @headlessui/react. Modified some class names and styles.
src/lib/subscribeUser.ts Introduced a change to the subscribeUser function by adding a variable result to store the result of the mutation. The function now returns the id property of the result object.

🐇💻

Code refined, errors declined,

With each line, we've designed,

A better flow, a smoother ride,

In our codebase, far and wide.

Accessibility, a noble quest,

Transitions smooth, we've done our best,

Newsletter logic, now so clear,

Celebrate changes, give a cheer! 🎉


Uplevel your code reviews with CodeRabbit Pro ### CodeRabbit Pro If you like this project, please support us by purchasing the [Pro version](https://coderabbit.ai). The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version. Moreover, CodeRabbit Pro is free for open source projects.