From 71da2b53fe60482d19441fb7d8074fc450dbb9d4 Mon Sep 17 00:00:00 2001 From: payacom <59262811+payacom@users.noreply.github.com> Date: Wed, 16 Sep 2026 14:22:51 +0330 Subject: [PATCH] Add coin-flies-to-wallet animation to the gift reveal modal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Web mirror of the RN change — same timing constants, same idea: the amount flies from its pop-in position toward a wallet badge that pulses on arrival, and the "credited" hint fades in at that moment instead of showing immediately. Wallet crediting itself was already correctly deferred server-side until POST /gifts/:id/open. Co-Authored-By: Claude Sonnet 5 --- src/components/chat/GiftRevealModal.tsx | 60 +++++++++++++++++++++---- src/locales/en/common.json | 3 +- src/locales/fa/common.json | 3 +- 3 files changed, 56 insertions(+), 10 deletions(-) diff --git a/src/components/chat/GiftRevealModal.tsx b/src/components/chat/GiftRevealModal.tsx index a3c6815..16ba423 100644 --- a/src/components/chat/GiftRevealModal.tsx +++ b/src/components/chat/GiftRevealModal.tsx @@ -7,6 +7,11 @@ import RoundedButton from "@/components/elements/RoundedButton"; import { useTranslation } from "react-i18next"; const PARTICLES = ["🎉", "🎊", "✨", "🎈", "🎁"]; +// طبقِ خواسته‌ی کاربر: بعدِ باز شدنِ کادو، مبلغ به‌صورتِ انیمیشنی «پرواز» می‌کنه و توی +// آیکونِ کیف‌پول فرود میاد — همون زمان‌بندی نسخه‌ی اندروید (GiftRevealModal.tsx: Reanimated) +const COIN_FLY_DELAY_S = 0.75; +const COIN_FLY_DURATION_S = 0.55; +const WALLET_ARRIVAL_S = COIN_FLY_DELAY_S + COIN_FLY_DURATION_S; type Particle = { id: number; @@ -89,14 +94,46 @@ export default function GiftRevealModal({ 🎁 - + + {amount.toLocaleString()} {t("settings.toman")} + + + 🪙 + + + + - {amount.toLocaleString()} {t("settings.toman")} - + + 👛 + + + {t("chats.gift.walletLabel")} + + {message ? ( ) : null} -

{t("chats.gift.creditedHint")}

+ + {t("chats.gift.creditedHint")} +