-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #771 from haqq-network/dev
- Loading branch information
Showing
20 changed files
with
1,481 additions
and
1,740 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
'use client'; | ||
import { useEffect } from 'react'; | ||
import { usePostHog } from 'posthog-js/react'; | ||
import type { WindowProvider } from 'wagmi'; | ||
|
||
declare global { | ||
interface Window { | ||
ethereum?: WindowProvider; | ||
__HAQQWALLET__?: { | ||
POSTHOG_DISTINCT_ID?: string; | ||
}; | ||
} | ||
} | ||
|
||
export function IdentifyWalletUsers() { | ||
const posthog = usePostHog(); | ||
|
||
useEffect(() => { | ||
if (typeof window !== 'undefined') { | ||
const isHaqqWallet = Boolean(window.ethereum?.isHaqqWallet); | ||
|
||
if (isHaqqWallet) { | ||
const distinctId = | ||
window.__HAQQWALLET__?.POSTHOG_DISTINCT_ID ?? | ||
posthog.get_distinct_id(); | ||
|
||
posthog.identify(distinctId); | ||
} | ||
} | ||
}, [posthog]); | ||
|
||
return null; | ||
} |
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
'use client'; | ||
import { useEffect } from 'react'; | ||
import { usePostHog } from 'posthog-js/react'; | ||
import type { WindowProvider } from 'wagmi'; | ||
|
||
declare global { | ||
interface Window { | ||
ethereum?: WindowProvider; | ||
__HAQQWALLET__?: { | ||
POSTHOG_DISTINCT_ID?: string; | ||
}; | ||
} | ||
} | ||
|
||
export function IdentifyWalletUsers() { | ||
const posthog = usePostHog(); | ||
|
||
useEffect(() => { | ||
if (typeof window !== 'undefined') { | ||
const isHaqqWallet = Boolean(window.ethereum?.isHaqqWallet); | ||
|
||
if (isHaqqWallet) { | ||
const distinctId = | ||
window.__HAQQWALLET__?.POSTHOG_DISTINCT_ID ?? | ||
posthog.get_distinct_id(); | ||
|
||
posthog.identify(distinctId); | ||
} | ||
} | ||
}, [posthog]); | ||
|
||
return null; | ||
} |
File renamed without changes.
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
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
Oops, something went wrong.