-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: empty connect button module for non-browser env
- Loading branch information
1 parent
1e0b5db
commit daaef7b
Showing
5 changed files
with
79 additions
and
32 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,2 @@ | ||
export const isBrowser = () => | ||
![typeof window, typeof document].includes('undefined') |
30 changes: 30 additions & 0 deletions
30
packages/dapp-toolkit/src/modules/connect-button/connect-button-noop.module.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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { NEVER } from 'rxjs' | ||
import { ConnectButtonModuleOutput } from './types' | ||
|
||
export const ConnectButtonNoopModule = (): ConnectButtonModuleOutput => { | ||
return { | ||
status$: NEVER, | ||
onConnect$: NEVER, | ||
onDisconnect$: NEVER, | ||
onUpdateSharedData$: NEVER, | ||
onShowPopover$: NEVER, | ||
onCancelRequestItem$: NEVER, | ||
onLinkClick$: NEVER, | ||
setStatus: () => {}, | ||
setMode: () => {}, | ||
setTheme: () => {}, | ||
setActiveTab: () => {}, | ||
setIsMobile: () => {}, | ||
setIsWalletLinked: () => {}, | ||
setIsExtensionAvailable: () => {}, | ||
setConnected: () => {}, | ||
setLoggedInTimestamp: () => {}, | ||
setRequestItems: () => {}, | ||
setAccounts: () => {}, | ||
setPersonaData: () => {}, | ||
setPersonaLabel: () => {}, | ||
setDappName: () => {}, | ||
destroy: () => {}, | ||
disconnect: () => {}, | ||
} | ||
} |
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