Skip to content

Commit

Permalink
Fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
dominik-zeglen committed Dec 20, 2021
1 parent 670c2ba commit 2816618
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/auth/components/LoginPage/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const LoginCard: React.FC<LoginCardProps> = props => {

return (
<LoginForm onSubmit={onSubmit}>
{({ change: handleChange, data,submit }) => (
{({ change: handleChange, data, submit }) => (
<>
{error && (
<div className={classes.panel} data-test="loginErrorMessage">
Expand Down
8 changes: 2 additions & 6 deletions src/auth/components/LoginPage/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface UseLoginFormResult {
change: FormChange;
data: LoginFormData;
hasChanged: boolean;
submit: (event: React.FormEvent<HTMLFormElement>) => Promise<boolean>;
submit: () => Promise<boolean>;
}

export interface LoginFormProps {
Expand Down Expand Up @@ -53,11 +53,7 @@ function useLoginForm(
return errors;
};

const submit = async (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault();

return handleFormSubmit(data, handleSubmit, setChanged);
};
const submit = async () => handleFormSubmit(data, handleSubmit, setChanged);

return {
change: handleChange,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ const OrderCustomerAddressesSearch: React.FC<OrderCustomerAddressesSearchProps>
<FormattedMessage {...buttonMessages.cancel} />
</Button>
<ConfirmButton
variant="contained"
color="primary"
variant="primary"
transitionState="default"
onClick={handleSelect}
>
Expand Down

0 comments on commit 2816618

Please sign in to comment.