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

[FEAT]: Add messages when handling the purchase process with toast notification #204

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

fathima200
Copy link

📝 Pull Request Title: [FEAT]: Add messages when handling the purchase process with toast notification

🛠️ Issue

📖 Description

Added dialog messages (toasts) to the purchase process on the shopping/[id] page as requested. The Trustless Work API was already implemented, and this change introduces success or error notifications after payment attempts, improving user feedback.

✅ Changes made

  • I added Shadcn toast notifications in shopping/[id]/page.tsx to display success or error messages during the payment process.
  • Wrapped the onPay function in a try/catch block to handle payment outcomes and trigger appropriate toasts.
  • Updated locales/en.ts and locales/es.ts with translations for success ("Payment Successful"/"Pago Exitoso") and error ("Payment Failed"/"Error en el Pago") messages.

🖼️ Media (screenshots/videos)

  • Error toast displayed on payment attempt (due to API 401):
    Screenshot 2025-03-16 060012

📜 Additional Notes

  • Currently, the payment process fails with a 401 Unauthorized error (likely wallet auth or backend setup), triggering the error toast. The success toast is implemented and will display once the API succeeds.

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.

[FEAT]: Add messages when handling the purchase process
1 participant