-
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 #760 from haqq-network/dev
- Loading branch information
Showing
17 changed files
with
613 additions
and
37 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
26 changes: 26 additions & 0 deletions
26
apps/haqq-website/components/dynamic-link-redirect/dynamic-link-redirect.tsx
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,26 @@ | ||
'use client'; | ||
import { useEffect } from 'react'; | ||
import { redirect, useSearchParams } from 'next/navigation'; | ||
import { usePostHog } from 'posthog-js/react'; | ||
|
||
export function DynamicLinkRedirect() { | ||
const params = useSearchParams(); | ||
const posthog = usePostHog(); | ||
|
||
useEffect(() => { | ||
const goTo = params.get('go_to'); | ||
const distinctId = params.get('distinct_id'); | ||
|
||
if (distinctId && goTo) { | ||
if (distinctId !== 'undefined' && distinctId !== '') { | ||
posthog.identify(distinctId); | ||
|
||
if (goTo !== 'undefined' && goTo !== '') { | ||
redirect(goTo); | ||
} | ||
} | ||
} | ||
}, [params, posthog]); | ||
|
||
return null; | ||
} |
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,17 @@ | ||
export function QrCodeIcon({ className }: { className?: string }) { | ||
return ( | ||
<svg | ||
width="24" | ||
height="24" | ||
viewBox="0 0 24 24" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
className={className} | ||
> | ||
<path | ||
d="M4.68828 11.2678H8.5795C10.3996 11.2678 11.2678 10.41 11.2678 8.55858V4.71967C11.2678 2.8682 10.3996 2 8.5795 2H4.68828C2.8682 2 2 2.8682 2 4.71967V8.55858C2 10.41 2.8682 11.2678 4.68828 11.2678ZM15.4205 11.2678H19.3117C21.1318 11.2678 22 10.41 22 8.55858V4.71967C22 2.8682 21.1318 2 19.3117 2H15.4205C13.6004 2 12.7322 2.8682 12.7322 4.71967V8.55858C12.7322 10.41 13.6004 11.2678 15.4205 11.2678ZM4.5523 9.30126C4.14435 9.30126 3.96653 9.11297 3.96653 8.70502V4.56276C3.96653 4.15481 4.14435 3.96653 4.5523 3.96653H8.71548C9.11297 3.96653 9.30126 4.15481 9.30126 4.56276V8.70502C9.30126 9.11297 9.11297 9.30126 8.71548 9.30126H4.5523ZM15.2845 9.30126C14.8766 9.30126 14.6987 9.11297 14.6987 8.70502V4.56276C14.6987 4.15481 14.8766 3.96653 15.2845 3.96653H19.4477C19.8556 3.96653 20.0335 4.15481 20.0335 4.56276V8.70502C20.0335 9.11297 19.8556 9.30126 19.4477 9.30126H15.2845ZM5.62971 7.8682H7.62761C7.79498 7.8682 7.8682 7.80544 7.8682 7.59623V5.66109C7.8682 5.4728 7.79498 5.39958 7.62761 5.39958H5.62971C5.45188 5.39958 5.39958 5.4728 5.39958 5.66109V7.59623C5.39958 7.80544 5.45188 7.8682 5.62971 7.8682ZM16.3933 7.8682H18.3912C18.569 7.8682 18.6423 7.80544 18.6423 7.59623V5.66109C18.6423 5.4728 18.569 5.39958 18.3912 5.39958H16.3933C16.2259 5.39958 16.1632 5.4728 16.1632 5.66109V7.59623C16.1632 7.80544 16.2259 7.8682 16.3933 7.8682ZM4.68828 22H8.5795C10.3996 22 11.2678 21.1423 11.2678 19.2908V15.4519C11.2678 13.6004 10.3996 12.7322 8.5795 12.7322H4.68828C2.8682 12.7322 2 13.6004 2 15.4519V19.2908C2 21.1423 2.8682 22 4.68828 22ZM13.5063 15.6715H15.5042C15.682 15.6715 15.7552 15.6088 15.7552 15.3996V13.4644C15.7552 13.2761 15.682 13.2029 15.5042 13.2029H13.5063C13.3389 13.2029 13.2762 13.2761 13.2762 13.4644V15.3996C13.2762 15.6088 13.3389 15.6715 13.5063 15.6715ZM19.1862 15.6715H21.1841C21.3619 15.6715 21.4247 15.6088 21.4247 15.3996V13.4644C21.4247 13.2761 21.3619 13.2029 21.1841 13.2029H19.1862C19.0188 13.2029 18.9561 13.2761 18.9561 13.4644V15.3996C18.9561 15.6088 19.0188 15.6715 19.1862 15.6715ZM4.5523 20.0335C4.14435 20.0335 3.96653 19.8452 3.96653 19.4477V15.3054C3.96653 14.887 4.14435 14.6987 4.5523 14.6987H8.71548C9.11297 14.6987 9.30126 14.887 9.30126 15.3054V19.4477C9.30126 19.8452 9.11297 20.0335 8.71548 20.0335H4.5523ZM16.3724 18.5167H18.3703C18.5481 18.5167 18.6213 18.4435 18.6213 18.2448V16.2992C18.6213 16.1109 18.5481 16.0377 18.3703 16.0377H16.3724C16.205 16.0377 16.1423 16.1109 16.1423 16.2992V18.2448C16.1423 18.4435 16.205 18.5167 16.3724 18.5167ZM5.62971 18.6004H7.62761C7.79498 18.6004 7.8682 18.5377 7.8682 18.3285V16.3933C7.8682 16.205 7.79498 16.1318 7.62761 16.1318H5.62971C5.45188 16.1318 5.39958 16.205 5.39958 16.3933V18.3285C5.39958 18.5377 5.45188 18.6004 5.62971 18.6004ZM13.5063 21.3515H15.5042C15.682 21.3515 15.7552 21.2782 15.7552 21.0795V19.1444C15.7552 18.9456 15.682 18.8828 15.5042 18.8828H13.5063C13.3389 18.8828 13.2762 18.9456 13.2762 19.1444V21.0795C13.2762 21.2782 13.3389 21.3515 13.5063 21.3515ZM19.1862 21.3515H21.1841C21.3619 21.3515 21.4247 21.2782 21.4247 21.0795V19.1444C21.4247 18.9456 21.3619 18.8828 21.1841 18.8828H19.1862C19.0188 18.8828 18.9561 18.9456 18.9561 19.1444V21.0795C18.9561 21.2782 19.0188 21.3515 19.1862 21.3515Z" | ||
fill="currentColor" | ||
/> | ||
</svg> | ||
); | ||
} |
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.