-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
131 additions
and
139 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import {showNotification} from "./ui/notifications" | ||
import {isMobile} from "./utils" | ||
import mobileIcon from "./ui/assets/mobile.png" | ||
|
||
export async function withRequestNotification( | ||
service: any, | ||
user: any, | ||
openDeeplink: (uid: string) => void | ||
) { | ||
const authnService = user?.services?.find((s: any) => s.type === "authn") | ||
const walletProvider = authnService?.provider | ||
|
||
const {close: closePrompt} = showNotification({ | ||
title: walletProvider?.name || "Mobile Wallet", | ||
message: isMobile() | ||
? "Tap to view request in app" | ||
: "Pending request on your mobile device", | ||
icon: walletProvider?.icon || mobileIcon, | ||
onClick: service.uid | ||
? () => { | ||
openDeeplink(service.uid) | ||
} | ||
: undefined, | ||
}) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,7 @@ | ||
import {Provider} from "@onflow/typedefs" | ||
|
||
export type AppInfo = { | ||
name?: string | ||
icon?: string | ||
} | ||
|
||
export type NotificationInfo = { | ||
walletProvider?: Provider | ||
title: string | ||
message: string | ||
icon?: string | ||
onClick?: () => void | ||
onClose?: () => void | ||
} | ||
|
||
export type ActiveNotificationInfo = NotificationInfo & {id: number} |
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
52 changes: 0 additions & 52 deletions
52
packages/fcl-wc/src/ui/components/NotificationProvider.tsx
This file was deleted.
Oops, something went wrong.
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