feat(thank-you-page): convert to client component with confetti and UI enhancements
- Changed from server to client component to enable interactive features like confetti animation - Removed server-side translations and hardcoded Portuguese text for simplicity - Added confetti effect on page load and improved success icon with animations - Updated buttons and share functionality for better user experience - This enhances the donation thank you page with celebratory elements and client-side interactivity
This commit is contained in:
1 parent
ad62dd0de2
commit
8271d1fa31
7 files changed
+191
-54
No files matched your search
@@ -0,0 +1,47 @@
|
||||
// Cache simples em memória (Map) para armazenar status de pagamentos
|
||||
// Em produção, trocar por Redis ou banco de dados
|
||||
|
||||
interface PaymentStatus {
|
||||
paid: boolean;
|
||||
paidAt?: string;
|
||||
amount: number;
|
||||
anonymous: boolean;
|
||||
customer?: any;
|
||||
}
|
||||
|
||||
const paymentCache = new Map<string, PaymentStatus>();
|
||||
|
||||
export function markAsPaid(
|
||||
pixId: string,
|
||||
data: {
|
||||
paidAt: string;
|
||||
amount: number;
|
||||
anonymous: boolean;
|
||||
customer?: any;
|
||||
}
|
||||
) {
|
||||
paymentCache.set(pixId, {
|
||||
paid: true,
|
||||
paidAt: data.paidAt,
|
||||
amount: data.amount,
|
||||
anonymous: data.anonymous,
|
||||
customer: data.customer,
|
||||
});
|
||||
|
||||
console.log(`✅ Pagamento marcado como pago no cache: ${pixId}`);
|
||||
|
||||
// Limpar após 1 hora
|
||||
setTimeout(() => {
|
||||
paymentCache.delete(pixId);
|
||||
console.log(`🗑️ Cache expirado para: ${pixId}`);
|
||||
}, 3600000);
|
||||
}
|
||||
|
||||
export function getPaymentStatus(pixId: string): PaymentStatus | undefined {
|
||||
return paymentCache.get(pixId);
|
||||
}
|
||||
|
||||
// Limpar cache expirado periodicamente (a cada 5 minutos)
|
||||
setInterval(() => {
|
||||
console.log(`📊 Cache atual: ${paymentCache.size} pagamentos armazenados`);
|
||||
}, 300000);
|
||||
Reference in new issue
Block a user