From aa520441b19d2d7a0ed0ac48271a5c01445ac886 Mon Sep 17 00:00:00 2001 From: Michal Date: Mon, 20 Jan 2025 13:23:07 +0000 Subject: [PATCH 1/8] Add fade in animation --- .../useCases/NotificationUIHandler.tsx | 19 +++++++++++++++++-- .../useCases/NotificationsDevScreen.tsx | 5 +++-- .../useCases/common/SwipeOutWrapper.tsx | 18 ++++++++++++++++-- .../src/legacy/Dashboard/UserSummary.json | 16 ++++++++-------- 4 files changed, 44 insertions(+), 14 deletions(-) diff --git a/apps/wallet-mobile/src/features/Notifications/useCases/NotificationUIHandler.tsx b/apps/wallet-mobile/src/features/Notifications/useCases/NotificationUIHandler.tsx index 6fb4491e31..0fce0c3d69 100644 --- a/apps/wallet-mobile/src/features/Notifications/useCases/NotificationUIHandler.tsx +++ b/apps/wallet-mobile/src/features/Notifications/useCases/NotificationUIHandler.tsx @@ -38,8 +38,22 @@ export const NotificationUIHandler = () => { const useCollectNewNotifications = ({enabled}: {enabled: boolean}) => { const manager = useNotificationManager() const walletManager = useWalletManager() - const selectedWalletId = walletManager.selected.wallet?.id - const [events, setEvents] = React.useState([]) + const selectedWalletId = walletManager.selected.wallet?.id ?? '' + const [events, setEvents] = React.useState([ + { + date: '2025-01-16T15:26:33.213Z', + id: 8930536706311822, + isRead: false, + metadata: { + isSentByUser: false, + nextTxsCounter: 9, + previousTxsCounter: 8, + txId: '977441499aef81a5e4f93bc8a9d0de68526c09b58f8cfb62dbaf53549942e7bb', + walletId: '85dd7b5e-682b-4240-9b19-5020dafd772e', + }, + trigger: 'TransactionReceived' as any, + }, + ]) React.useEffect(() => { if (!enabled) return @@ -49,6 +63,7 @@ const useCollectNewNotifications = ({enabled}: {enabled: boolean}) => { } const subscription = manager.newEvents$.subscribe((event) => { + console.log('new event', event) if (event.trigger === Notifications.Trigger.RewardsUpdated && event.metadata.walletId === selectedWalletId) { pushEvent(event) } diff --git a/apps/wallet-mobile/src/features/Notifications/useCases/NotificationsDevScreen.tsx b/apps/wallet-mobile/src/features/Notifications/useCases/NotificationsDevScreen.tsx index 43efc4f63a..3c0d51e360 100644 --- a/apps/wallet-mobile/src/features/Notifications/useCases/NotificationsDevScreen.tsx +++ b/apps/wallet-mobile/src/features/Notifications/useCases/NotificationsDevScreen.tsx @@ -30,7 +30,8 @@ export const NotificationsDevScreen = () => { const Screen = () => { const manager = useNotificationManager() const walletManager = useWalletManager() - const selectedWalletId = walletManager.selected.wallet?.id ?? 'walletId' + const selectedWalletId = walletManager.selected.wallet?.id ?? '' + console.log('selectedWalletId', selectedWalletId) const handleOnTriggerTransactionReceived = () => { manager.events.push( @@ -50,7 +51,7 @@ const Screen = () => { Notifications Playground -