Skip to content

Commit 64e9967

Browse files
committed
feat(googlelogin): add container props to div button container
1 parent 5156b09 commit 64e9967

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ $ npm install @react-oauth/google@latest
1212
$ yarn add @react-oauth/google@latest
1313
```
1414

15-
## Demo
15+
## Demo & How to use to fetch user details
1616

1717
https://react-oauth.vercel.app/
1818

packages/@react-oauth/google/src/GoogleLogin.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export type GoogleLoginProps = {
1717
onError?: () => void;
1818
promptMomentNotification?: MomentListener;
1919
useOneTap?: boolean;
20+
containerProps?: React.ComponentPropsWithoutRef<'div'>;
2021
} & Omit<IdConfiguration, 'client_id' | 'callback'> &
2122
GsiButtonConfiguration;
2223

@@ -34,6 +35,7 @@ export default function GoogleLogin({
3435
width,
3536
locale,
3637
click_listener,
38+
containerProps,
3739
...props
3840
}: GoogleLoginProps) {
3941
const btnContainerRef = useRef<HTMLDivElement>(null);
@@ -102,6 +104,10 @@ export default function GoogleLogin({
102104
]);
103105

104106
return (
105-
<div ref={btnContainerRef} style={{ height: containerHeightMap[size] }} />
107+
<div
108+
{...containerProps}
109+
ref={btnContainerRef}
110+
style={{ height: containerHeightMap[size], ...containerProps?.style }}
111+
/>
106112
);
107113
}

0 commit comments

Comments
 (0)