Skip to content

Commit e92b8cd

Browse files
Nanle-codeclaude
andcommitted
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

frontend/messages/en.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,7 @@
595595
"good": "Good",
596596
"fair": "Fair",
597597
"poor": "Poor"
598+
},
598599
"darkModeTheme": {
599600
"loading": "Loading theme settings",
600601
"errorCleared": "Error cleared. Attempting to toggle theme.",
@@ -685,5 +686,21 @@
685686
"emptyAllocation": "No allocation data available yet.",
686687
"emptyAssets": "No portfolio assets available yet.",
687688
"emptyHistory": "No performance history available yet."
689+
},
690+
"payment": {
691+
"successTitle": "Payment Successful!",
692+
"successMessage": "Your payment has been processed successfully. The transaction is now confirmed on the Stellar network.",
693+
"amountReceived": "Amount Received",
694+
"transactionId": "Transaction ID",
695+
"successAnnounce": "Payment successful! {amount} {asset} has been received.",
696+
"networkConfirmed": "Payment confirmed on the Stellar network.",
697+
"dismissing": "Processing…",
698+
"optimisticNote": "Transaction submitted — awaiting network confirmation.",
699+
"successHint": "Press Escape or the close button to dismiss this message."
700+
},
701+
"common": {
702+
"close": "Close success animation",
703+
"continue": "Continue",
704+
"error": "Something went wrong. Please try again."
688705
}
689706
}

frontend/messages/es.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,5 +664,21 @@
664664
"emptyAllocation": "Todavia no hay datos de asignacion.",
665665
"emptyAssets": "Todavia no hay activos en el portafolio.",
666666
"emptyHistory": "Todavia no hay historial de rendimiento."
667+
},
668+
"payment": {
669+
"successTitle": "¡Pago exitoso!",
670+
"successMessage": "Tu pago se ha procesado correctamente. La transacción ya está confirmada en la red Stellar.",
671+
"amountReceived": "Importe recibido",
672+
"transactionId": "ID de transacción",
673+
"successAnnounce": "¡Pago exitoso! Se han recibido {amount} {asset}.",
674+
"networkConfirmed": "Pago confirmado en la red Stellar.",
675+
"dismissing": "Procesando…",
676+
"optimisticNote": "Transacción enviada, esperando confirmación de la red.",
677+
"successHint": "Presiona Escape o el botón de cerrar para descartar este mensaje."
678+
},
679+
"common": {
680+
"close": "Cerrar animación de éxito",
681+
"continue": "Continuar",
682+
"error": "Algo salió mal. Inténtalo de nuevo."
667683
}
668684
}

frontend/messages/pt.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,5 +664,21 @@
664664
"emptyAllocation": "Ainda nao ha dados de alocacao.",
665665
"emptyAssets": "Ainda nao ha ativos no portafolio.",
666666
"emptyHistory": "Ainda nao ha historico de desempenho."
667+
},
668+
"payment": {
669+
"successTitle": "Pagamento realizado com sucesso!",
670+
"successMessage": "Seu pagamento foi processado com sucesso. A transação já está confirmada na rede Stellar.",
671+
"amountReceived": "Valor recebido",
672+
"transactionId": "ID da transação",
673+
"successAnnounce": "Pagamento realizado com sucesso! {amount} {asset} foram recebidos.",
674+
"networkConfirmed": "Pagamento confirmado na rede Stellar.",
675+
"dismissing": "Processando…",
676+
"optimisticNote": "Transação enviada — aguardando confirmação da rede.",
677+
"successHint": "Pressione Esc ou o botão fechar para dispensar esta mensagem."
678+
},
679+
"common": {
680+
"close": "Fechar animação de sucesso",
681+
"continue": "Continuar",
682+
"error": "Algo deu errado. Tente novamente."
667683
}
668684
}

0 commit comments

Comments
 (0)