Skip to content

Commit

Permalink
Remove FC type return
Browse files Browse the repository at this point in the history
  • Loading branch information
skanderm committed Nov 28, 2023
1 parent fd0ed80 commit 4635b34
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
8 changes: 3 additions & 5 deletions ui/src/components/auth/RegisterForm.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Alert, Box, Button, Link, TextField } from "@mui/material";
import NextLink from "next/link";
import { FC, FormEvent, useState } from "react";
import { FormEvent, useState } from "react";

import { MutationError } from "@/graphql/generated";

Expand All @@ -15,7 +15,7 @@ type RegisterFormProps = {
errors: MutationError[];
}

const RegisterForm: FC<RegisterFormProps> = ({ onSubmit, errors }) => {
export default function RegisterForm({ onSubmit, errors }: RegisterFormProps) {
const [firstName, setFirstName] = useState("");
const [lastName, setLastName] = useState("");
const [email, setEmail] = useState("");
Expand Down Expand Up @@ -257,6 +257,4 @@ const RegisterForm: FC<RegisterFormProps> = ({ onSubmit, errors }) => {

const errorCodeToMessage = (_error: Pick<MutationError, "code">) => {
return "An unknown error occurred. Please try again and let us know if this keeps happening.";
};

export default RegisterForm;
};
12 changes: 5 additions & 7 deletions ui/src/components/auth/ResetPasswordForm.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { Alert, Button, TextField } from "@mui/material";
import { FC, FormEvent, useState } from "react";
import { FormEvent, useState } from "react";

import { MutationError } from "@/graphql/generated";

type ResetPasswordFormProps = {
onSubmit: (password: string, passworConfirmation: string) => void;
errors: MutationError[];
}
};

const ResetPasswordForm: FC<ResetPasswordFormProps> = ({
export default function ResetPasswordForm({
onSubmit,
errors,
}) => {
}: ResetPasswordFormProps) {
const [password, setPassword] = useState("");
const [passwordConfirmation, setPasswordConfirmation] = useState("");

Expand Down Expand Up @@ -123,7 +123,7 @@ const ResetPasswordForm: FC<ResetPasswordFormProps> = ({
</Button>
</form>
);
};
}

const errorToString = (
error?: Pick<MutationError, "code" | "message" | "vars" | "shortMessage">,
Expand Down Expand Up @@ -157,5 +157,3 @@ const errorToString = (
return `An unknown error occurred. Please try again and let us know if this keeps happening.`;
}
};

export default ResetPasswordForm;
12 changes: 5 additions & 7 deletions ui/src/components/auth/ResetPasswordRequestForm.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { Alert, Box, Button, Link, TextField } from "@mui/material";
import NextLink from "next/link";
import { FC, FormEvent, useState } from "react";
import { FormEvent, useState } from "react";

type ForgotPasswordFormProps = {
onSubmit: (email: string) => void;
message?: string;
}
};

const ForgotPasswordForm: FC<ForgotPasswordFormProps> = ({
export default function ForgotPasswordForm({
onSubmit,
message,
}) => {
}: ForgotPasswordFormProps) {
const [email, setEmail] = useState("");

const handleSubmit = (event: FormEvent<HTMLFormElement>) => {
Expand Down Expand Up @@ -96,6 +96,4 @@ const ForgotPasswordForm: FC<ForgotPasswordFormProps> = ({
</Button>
</form>
);
};

export default ForgotPasswordForm;
}

0 comments on commit 4635b34

Please sign in to comment.