Commit e92b8cd
feat(frontend): make PaymentSuccessAnimation RSC-ready, localized, and lighter
Splits PaymentSuccessAnimation into a server-safe wrapper (PaymentSuccessAnimation.tsx)
and the interactive implementation (PaymentSuccessAnimationClient.tsx), so the
"use client" boundary sits at the animation itself rather than forcing every
importer into client-only code (#1175).
Adds PaymentSuccessSkeleton as the next/dynamic loading fallback, replacing the
bare Suspense fallback={null} with a real placeholder while the client bundle
streams in (#1176).
Adds real payment/common translations to en/es/pt messages, replacing the
hardcoded English fallback strings the component previously fell back to (#1177).
Migrates the animation from framer-motion to the lighter motion/react package and
removes the unused confetti and react-confetti dependencies, which were never
imported anywhere in the codebase (#1178).
Also fixes a real bug found while touching this component: usePrefersReducedMotion
computed its initial state via useEffect, so the confetti-trigger effect (which
runs in the same mount commit) always saw the stale default before the OS
preference loaded, meaning reduced-motion users still got a confetti burst on
first render. Switched to a lazy useState initializer that reads matchMedia
synchronously.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>1 parent bb8bb0c commit e92b8cd
11 files changed
Lines changed: 793 additions & 754 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
595 | 595 | | |
596 | 596 | | |
597 | 597 | | |
| 598 | + | |
598 | 599 | | |
599 | 600 | | |
600 | 601 | | |
| |||
685 | 686 | | |
686 | 687 | | |
687 | 688 | | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
688 | 705 | | |
689 | 706 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
664 | 664 | | |
665 | 665 | | |
666 | 666 | | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
667 | 683 | | |
668 | 684 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
664 | 664 | | |
665 | 665 | | |
666 | 666 | | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
667 | 683 | | |
668 | 684 | | |
0 commit comments