@react-oauth/google
Advanced tools
Comparing version
@@ -93,2 +93,4 @@ /// <reference types="react" /> | ||
locale?: string; | ||
/** If set, this [function](https://developers.google.com/identity/gsi/web/reference/js-reference#click_listener) will be called when the Sign in with Google button is clicked. */ | ||
click_listener?: () => void; | ||
} | ||
@@ -294,3 +296,3 @@ interface PromptMomentNotification { | ||
} & Omit<IdConfiguration, 'client_id' | 'callback'> & GsiButtonConfiguration; | ||
declare function GoogleLogin({ onSuccess, onError, useOneTap, promptMomentNotification, type, theme, size, text, shape, logo_alignment, width, locale, ...props }: GoogleLoginProps): JSX.Element; | ||
declare function GoogleLogin({ onSuccess, onError, useOneTap, promptMomentNotification, type, theme, size, text, shape, logo_alignment, width, locale, click_listener, ...props }: GoogleLoginProps): JSX.Element; | ||
@@ -297,0 +299,0 @@ declare function googleLogout(): void; |
@@ -60,3 +60,3 @@ import React, { useState, useRef, useEffect, createContext, useMemo, useContext, useCallback } from 'react'; | ||
const containerHeightMap = { large: 40, medium: 32, small: 20 }; | ||
function GoogleLogin({ onSuccess, onError, useOneTap, promptMomentNotification, type = 'standard', theme = 'outline', size = 'large', text, shape, logo_alignment, width, locale, ...props }) { | ||
function GoogleLogin({ onSuccess, onError, useOneTap, promptMomentNotification, type = 'standard', theme = 'outline', size = 'large', text, shape, logo_alignment, width, locale, click_listener, ...props }) { | ||
const btnContainerRef = useRef(null); | ||
@@ -99,2 +99,3 @@ const { clientId, scriptLoadedSuccessfully } = useGoogleOAuth(); | ||
locale, | ||
click_listener, | ||
}); | ||
@@ -101,0 +102,0 @@ if (useOneTap) |
@@ -68,3 +68,3 @@ 'use strict'; | ||
const containerHeightMap = { large: 40, medium: 32, small: 20 }; | ||
function GoogleLogin({ onSuccess, onError, useOneTap, promptMomentNotification, type = 'standard', theme = 'outline', size = 'large', text, shape, logo_alignment, width, locale, ...props }) { | ||
function GoogleLogin({ onSuccess, onError, useOneTap, promptMomentNotification, type = 'standard', theme = 'outline', size = 'large', text, shape, logo_alignment, width, locale, click_listener, ...props }) { | ||
const btnContainerRef = React.useRef(null); | ||
@@ -107,2 +107,3 @@ const { clientId, scriptLoadedSuccessfully } = useGoogleOAuth(); | ||
locale, | ||
click_listener, | ||
}); | ||
@@ -109,0 +110,0 @@ if (useOneTap) |
{ | ||
"name": "@react-oauth/google", | ||
"version": "0.5.1", | ||
"version": "0.6.0", | ||
"description": "Google OAuth2 using Google Identity Services for React 🚀", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
68440
0.48%792
0.51%