-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cash payouts GA Frontend Updates #426
base: master
Are you sure you want to change the base?
Changes from 86 commits
2508a52
3d1bc0c
cb855fe
b71f125
5fd66c2
5f8ded6
0bd896d
e50b2f0
3b279cf
039c3e4
98f87e2
87f29f6
c5cabd4
2556acd
9bb44c0
21f95a2
0eb441a
195855a
8c5aa5b
4b2308e
d130b2c
165061a
64d23aa
154c9cb
fc35e14
8642745
da6f0d8
d80f9ff
7752c6d
a837dcf
3b2c0f4
575aa37
23a085b
09e7e13
a2bed79
dfdcab1
beba336
5c6fb22
3f8c163
d7ae703
b249db1
b015203
efe553a
9eaa040
501dfa7
c0523fc
4300873
e3f1fe5
82a7172
78f30c2
f18036d
f996f12
5065018
978d38c
ce00189
dfbc8f2
089a556
3aed72d
61487fa
a06c584
66ecf85
4223a10
26528da
ad8231c
7b0b5df
1c06e42
aab8531
170b782
56fe461
1ce6f86
0b06261
5c4ec8e
2ce5f7e
563fc1b
8d14bc8
f105847
8e2e6ad
24c1d3f
972fcdc
96e7056
7ae6453
f6d0dcb
b04dcd4
685c782
69f0506
38687f4
1732d18
a2658a7
a8da29c
7dcff95
3b3b543
f86a8a5
6b5ee88
107d46c
7499dcd
84b5759
b4cb29b
bbb95e0
f1f29bc
66fa6c1
4abf323
e20e276
d24327e
a36074c
5c97343
b1f77b3
01798c0
294bf40
d3a3998
ba4ab2e
140474c
1bb0006
0de2922
26150d5
16d9a79
d1972b6
76ca6be
2512549
9438916
9e1dad9
93d8128
2f3954f
0edbde3
84b38f6
f96a830
0a772cf
e64865f
914fa56
1cd55a9
f587910
3d508a0
1ab3454
43159af
06a6d1c
2d477f3
10c6a57
f4146e5
8d48914
672af18
6d8d24f
57e4e53
924189e
3fcfb57
3d04d4d
77bca00
15376f1
5be95f0
8ab9b68
b876be4
8c70c73
0b15002
a9c1558
64466e7
ec07452
309c1f7
547998a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@saasquatch/component-boilerplate", | ||
"version": "1.6.7", | ||
"version": "1.6.8-0", | ||
"private": false, | ||
"description": "Boilerplate for writing web components for the SaaSquatch widget environments", | ||
"source": "src/index.ts", | ||
|
@@ -40,7 +40,7 @@ | |
}, | ||
"dependencies": { | ||
"@formatjs/intl": "^1.8.2", | ||
"@saasquatch/component-environment": "^1.0.8", | ||
"@saasquatch/component-environment": "^1.0.9-0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bump after releasing package |
||
"@saasquatch/dom-context-hooks": "^1.0.5", | ||
"@saasquatch/stencil-hooks": "^2.0.2", | ||
"@saasquatch/universal-hooks": "^1.0.0", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { useUserIdentity } from "./useUserIdentity"; | ||
import { useVerificationContext } from "./useVerificationContext"; | ||
|
||
export function useQueryToken() { | ||
const verificationToken = useVerificationContext()?.token; | ||
const userJwt = useUserIdentity()?.jwt; | ||
|
||
return verificationToken || userJwt; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { | ||
checkVerificationToken, | ||
isDemo, | ||
lazilyStartVerificationContext, | ||
setVerificationContext, | ||
VERIFICATION_CONTEXT_NAME, | ||
VerificationContext, | ||
} from "@saasquatch/component-environment"; | ||
import { useDomContext } from "@saasquatch/dom-context-hooks"; | ||
import { useHost } from "../useHost"; | ||
|
||
export function useVerificationContext(): VerificationContext | undefined { | ||
lazilyStartVerificationContext(); | ||
const host = useHost(); | ||
const context = useDomContext(host, VERIFICATION_CONTEXT_NAME) as | ||
| VerificationContext | ||
| undefined; | ||
|
||
const valid = checkVerificationToken(context?.token); | ||
if (!isDemo() && context && !valid) { | ||
setVerificationContext(undefined); | ||
return undefined; | ||
} | ||
|
||
return context; | ||
} | ||
|
||
export function useVerificationToken() { | ||
return useVerificationContext()?.token; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@saasquatch/component-environment", | ||
"version": "1.0.8", | ||
"version": "1.0.9-0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needs real version bumber |
||
"description": "Environment and contexts for SaaSquatch components", | ||
"main": "dist/index.js", | ||
"module": "dist/index.mjs", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a real version number before release