Skip to content

Commit 2217cc5

Browse files
authored
Feat/use google one tap login prompt parent (#249)
* feat(usegoogleonetaplogin): add prompt_parent_id to change the prompts default position * chore: add changeset
1 parent 23d98a2 commit 2217cc5

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.changeset/eleven-bikes-raise.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@react-oauth/google': minor
3+
---
4+
5+
add prompt_parent_id to change the prompt default's position

packages/@react-oauth/google/src/hooks/useGoogleOneTapLogin.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ interface UseGoogleOneTapLoginOptions {
1313
onError?: () => void;
1414
promptMomentNotification?: MomentListener;
1515
cancel_on_tap_outside?: boolean;
16+
prompt_parent_id?: string;
1617
hosted_domain?: string;
1718
disabled?: boolean;
1819
}
@@ -22,6 +23,7 @@ export default function useGoogleOneTapLogin({
2223
onError,
2324
promptMomentNotification,
2425
cancel_on_tap_outside,
26+
prompt_parent_id,
2527
hosted_domain,
2628
disabled,
2729
}: UseGoogleOneTapLoginOptions): void {
@@ -60,6 +62,7 @@ export default function useGoogleOneTapLogin({
6062
},
6163
hosted_domain,
6264
cancel_on_tap_outside,
65+
prompt_parent_id,
6366
});
6467

6568
window?.google?.accounts?.id?.prompt(promptMomentNotificationRef.current);
@@ -71,6 +74,7 @@ export default function useGoogleOneTapLogin({
7174
clientId,
7275
scriptLoadedSuccessfully,
7376
cancel_on_tap_outside,
77+
prompt_parent_id,
7478
hosted_domain,
7579
disabled,
7680
]);

0 commit comments

Comments
 (0)