-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add walletconnect notify api (#2512) * initialize notify client * notify client store * register and subscribe to notifications * implement test subscription * improve initialization * subscribe to gm walletconnect * create notify manager class Co-authored-by: Nicole O'Brien <[email protected]> Co-authored-by: Tuditi <[email protected]> * set notifications to store * update yarn lock * initialize notifications and subscriptions Co-authored-by: Tuditi <[email protected]> Co-authored-by: Nicole O'Brien <[email protected]> * cleanup handlers Co-authored-by: Tuditi <[email protected]> Co-authored-by: Nicole O'Brien <[email protected]> Co-authored-by: Jean Ribeiro <[email protected]> --------- Co-authored-by: Nicole O'Brien <[email protected]> Co-authored-by: Tuditi <[email protected]> Co-authored-by: Jean Ribeiro <[email protected]> * chore: cleanup notification manager init (#2513) * cleanup notification manager initialization Co-authored-by: Nicole O'Brien <[email protected]> * add message handler --------- Co-authored-by: Nicole O'Brien <[email protected]> * fix: fix notify client (#2516) * fix notify client initialize * fix dependencies Co-authored-by: Jean Ribeiro <[email protected]> --------- Co-authored-by: Jean Ribeiro <[email protected]> * feat: add notification components (#2514) * WIP * improve notification popup * use dapp icon as main image * add small badge * add notificationavatar * only show fixed amount + add localizations Co-authored-by: Jean Ribeiro <[email protected]> * add time test * cleanup --------- Co-authored-by: Jean Ribeiro <[email protected]> * feat: adds Link in NotificationTile (#2528) * feat: highlight unread notifications (#2527) * chore: refactor for multi chain support (#2511) * chore: remove BASE_TOKEN_CONTRACT_ADDRESS map * chore: rename getL1Network to getStardustNetwork * fix: type * feat: highlight unread notification * fix incoming notifications * restructure --------- Co-authored-by: Tuditi <[email protected]> Co-authored-by: Mark Nardi <[email protected]> * feat: mark notification as read if visible (#2532) * fix: removes view all button and show all notifications in dropdown * feat: mark notifications as read if visible * chore: update @bloomwalletio/ui * fix: updates notifications store only after closing the dropdown * decrease threshold --------- Co-authored-by: Mark Nardi <[email protected]> * fix: type errors * feat: notifications unread tab (#2540) * feat: notifications unread tab * add optional chain --------- Co-authored-by: Mark Nardi <[email protected]> * enhancement: uses VirtualList in notifications (#2541) * enhancement: uses VirtualList in notifications * fix merge issue --------- Co-authored-by: Mark Nardi <[email protected]> * cleanup * feat: notification details popup (#2554) * show basetoken amount on smartcontract popups (#2549) * feat: adds notification details popup Co-authored-by: Mark Nardi <[email protected]> Co-authored-by: Nicole O'Brien <[email protected]> Co-authored-by: Tuditi <[email protected]> * fix: PopupComponentMap type --------- Co-authored-by: Mark Nardi <[email protected]> Co-authored-by: Nicole O'Brien <[email protected]> Co-authored-by: Tuditi <[email protected]> * fix linter * fix: notification read state Co-authored-by: Mark Nardi <[email protected]> * polish nav bar with notification button * split notification components * remove notification tabs * enable notifications for multiple networks * fix notifications initialization * improve siwe validation check * fix: notification tile hover * fix: popover closing behaviour for notifications * ui: empty placeholder in notifications * enable notifications in network drawer * fix notification toggle state * improve notification registering Co-authored-by: Mark Nardi <[email protected]> * register for notifications on some generate addresses * register account on evm address generation * only register if not registered * fix login if account is unregistered * Fix notification registration on onboarding Co-authored-by: Nicole O'Brien <[email protected]> * remove mulitple instances of notifiation body * WIP * fix: whitelist notification links * fix tracked address initialization * remove console logs * ui: polish notification details popup Co-authored-by: Mark Nardi <[email protected]> * ui: polish notification tile * improve logic in complete onboarding Co-authored-by: Mark Nardi <[email protected]> * chore: fix formatting --------- Co-authored-by: Nicole O'Brien <[email protected]> Co-authored-by: Tuditi <[email protected]> Co-authored-by: Jean Ribeiro <[email protected]> Co-authored-by: Tuditi <[email protected]> Co-authored-by: Nicole O'Brien <[email protected]>
- Loading branch information
1 parent
ba2e2e7
commit a1a8a86
Showing
52 changed files
with
1,243 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
packages/desktop/components/popup/popups/NotificationDetailsPopup.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<script lang="ts"> | ||
import { Pill, Text } from '@bloomwalletio/ui' | ||
import { openUrlInBrowser } from '@core/app/utils' | ||
import { formatDate, localize } from '@core/i18n' | ||
import { NotificationSubscriptionInfo } from '@ui' | ||
import { NotifyClientTypes } from '@walletconnect/notify-client' | ||
import PopupTemplate from '../PopupTemplate.svelte' | ||
export let notification: NotifyClientTypes.NotifyNotification | ||
export let subscription: NotifyClientTypes.NotifySubscription | ||
$: notificationType = subscription?.scope[notification.type] | ||
function onVisitClick(url: string): void { | ||
openUrlInBrowser(url) | ||
} | ||
</script> | ||
|
||
<PopupTemplate | ||
continueButton={notification.url | ||
? { | ||
text: localize('actions.visit'), | ||
onClick: () => onVisitClick(notification.url ?? ''), | ||
} | ||
: undefined} | ||
> | ||
<NotificationSubscriptionInfo | ||
slot="banner" | ||
metadata={subscription.metadata} | ||
classes="bg-surface-1 dark:bg-surface-1-dark pb-4" | ||
></NotificationSubscriptionInfo> | ||
|
||
<div class="space-y-2"> | ||
<div class="flex flex-row items-center justify-between gap-2"> | ||
<Pill compact color="primary">{notificationType.name}</Pill> | ||
<Text size="sm" textColor="secondary"> | ||
{formatDate(new Date(notification.sentAt), { dateStyle: 'long', timeStyle: 'short' })} | ||
</Text> | ||
</div> | ||
<div class="space-y-1"> | ||
<Text type="body1">{notification.title}</Text> | ||
<Text type="sm" textColor="secondary">{notification.body}</Text> | ||
</div> | ||
</div> | ||
</PopupTemplate> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
packages/desktop/lib/auxiliary/popup/types/popup-component-map.type.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import { SvelteComponent } from 'svelte' | ||
import { PopupId } from '../enums' | ||
|
||
export type PopupComponentMap = { [key in PopupId]: SvelteComponent } | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
export type PopupComponentMap = { [key in PopupId]: typeof SvelteComponent<any> } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
packages/desktop/views/dashboard/notifications/NotificationsButton.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<script lang="ts"> | ||
import { notificationsManager } from '@auxiliary/wallet-connect/notifications' | ||
import { IconButton, IconName, Indicator } from '@bloomwalletio/ui' | ||
import { localize } from '@core/i18n' | ||
import NotificationsPopoverContent from './NotificationsPopoverContent.svelte' | ||
const notifications = notificationsManager.notificationsPerSubscription | ||
$: hasUnreadNotifications = Object.values($notifications).some((notifications) => | ||
notifications.some((notification) => !notification.isRead) | ||
) | ||
let anchor: HTMLElement | undefined = undefined | ||
</script> | ||
|
||
<button bind:this={anchor} type="button" class="relative flex items-center"> | ||
<IconButton | ||
icon={IconName.Bell} | ||
tooltip={localize('views.dashboard.dappNotifications.title')} | ||
textColor="primary" | ||
size="sm" | ||
/> | ||
{#if hasUnreadNotifications} | ||
<Indicator | ||
size="sm" | ||
class="absolute top-0 right-0 box-content rounded-full | ||
border-2 border-solid border-surface dark:border-surface-dark" | ||
/> | ||
{/if} | ||
</button> | ||
|
||
<NotificationsPopoverContent {anchor} /> |
Oops, something went wrong.