Web: Login: fix oAuth, modified types
This commit is contained in:
parent
7735e0b0a3
commit
2f70694632
4
packages/login/index.d.ts
vendored
4
packages/login/index.d.ts
vendored
@ -104,4 +104,8 @@ declare global {
|
||||
[Login: string]: { [key: any]: string };
|
||||
};
|
||||
}
|
||||
|
||||
type HTMLElementEvent<T extends HTMLElement> = Event & {
|
||||
target: T;
|
||||
};
|
||||
}
|
||||
|
@ -77,12 +77,19 @@ const Login: React.FC<ILoginProps> = ({
|
||||
};
|
||||
|
||||
const onSocialButtonClick = useCallback(
|
||||
(e: React.SyntheticEvent<EventTarget>) => {
|
||||
if (!(e.target instanceof HTMLButtonElement)) {
|
||||
return;
|
||||
(e: HTMLElementEvent<HTMLButtonElement | HTMLElement>) => {
|
||||
const { target } = e;
|
||||
let targetElement = target;
|
||||
|
||||
if (
|
||||
!(targetElement instanceof HTMLButtonElement) &&
|
||||
target.parentElement
|
||||
) {
|
||||
targetElement = target.parentElement;
|
||||
console.log(targetElement);
|
||||
}
|
||||
const providerName = e.target.dataset.providername;
|
||||
const url = e.target.dataset.url || "";
|
||||
const providerName = targetElement.dataset.providername;
|
||||
const url = targetElement.dataset.url || "";
|
||||
|
||||
try {
|
||||
const tokenGetterWin = isDesktopEditor
|
||||
|
@ -51,7 +51,9 @@ interface IMoreLoginNodalProps {
|
||||
visible: boolean;
|
||||
onClose: VoidFunction;
|
||||
providers: ProvidersType;
|
||||
onSocialLoginClick: (e: React.SyntheticEvent<EventTarget>) => void;
|
||||
onSocialLoginClick: (
|
||||
e: HTMLElementEvent<HTMLButtonElement | HTMLElement>
|
||||
) => void;
|
||||
ssoLabel: string;
|
||||
ssoUrl: string;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user