Skip to content

Commit

Permalink
(fix): change event type
Browse files Browse the repository at this point in the history
  • Loading branch information
senthil-athiban committed Jul 30, 2024
1 parent 7ae368d commit d618e94
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/ui/AuthProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Button } from "./Button/Button";
interface AuthProvider {
handleGoogleSubmit?: () => void;
handleGithubSubmit?: (
event: React.FormEvent<HTMLFormElement>,
event: React.MouseEvent<HTMLButtonElement>,
) => Promise<void>;
}

Expand Down
4 changes: 3 additions & 1 deletion frontend/src/components/ui/Card/CardWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ interface CardWrapperProps {
backButtonHref: string;
showProvider?: boolean;
loginWithGoogle?: () => void;
loginWithGithub?: (event: React.FormEvent<HTMLFormElement>) => Promise<void>;
loginWithGithub?: (
event: React.MouseEvent<HTMLButtonElement>,
) => Promise<void>;
}

const CardWrapper = ({
Expand Down
7 changes: 5 additions & 2 deletions frontend/src/pages/auth/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { humanReadableError } from "constants/backend";
import { useAlertQueue } from "hooks/alerts";
import { api } from "hooks/api";
import { useAuthentication } from "hooks/auth";
import { FormEvent, useEffect, useState } from "react";
import { useEffect, useState } from "react";
import { Spinner } from "react-bootstrap";
import { Eye } from "react-bootstrap-icons";
import { SubmitHandler, useForm } from "react-hook-form";
Expand Down Expand Up @@ -42,7 +42,10 @@ const Login = () => {
console.log(data);
};

const handleGithubSubmit = async (event: FormEvent<HTMLFormElement>) => {
const handleGithubSubmit = async (
event: React.MouseEvent<HTMLButtonElement>,
) => {
console.log("event : ", event);
event.preventDefault();
const redirectUrl = await auth_api.sendRegisterGithub();
window.open(redirectUrl, "_self");
Expand Down

0 comments on commit d618e94

Please sign in to comment.