Skip to content

Commit 643db80

Browse files
committed
Fix linting errors
1 parent 0bff4dd commit 643db80

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

frontend/src/features/pet-profile/pages/AddPetForm.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
import { ChevronRightIcon } from "lucide-react";
1414
import React, { useEffect, useState } from "react";
1515
import { Controller, useForm } from "react-hook-form";
16-
import { useHistory, useParams } from "react-router-dom";
1716
import { PencilIcon } from "../../../assets/icons";
1817
import Button from "../../../components/common/Button";
1918
import ColourStarIcon from "../../../components/common/ColourStarIcon";
@@ -85,7 +84,6 @@ const validateDate = (month: string, date: string, year: string) => {
8584
};
8685

8786
const AddPetForm = (): React.ReactElement => {
88-
const history = useHistory();
8987
const toast = useToast();
9088
const [localProfilePhoto, setLocalProfilePhoto] = useState<
9189
string | undefined
@@ -115,7 +113,6 @@ const AddPetForm = (): React.ReactElement => {
115113
handleSubmit,
116114
setValue,
117115
getValues,
118-
reset,
119116
formState: { errors },
120117
} = useForm<FormData>({
121118
defaultValues: {
@@ -208,11 +205,13 @@ const AddPetForm = (): React.ReactElement => {
208205
if (!files || files.length === 0) return;
209206
const file = files[0];
210207
const reader = new FileReader();
208+
setIsUploading(true);
211209
reader.onloadend = () => {
212210
setLocalProfilePhoto(reader.result as string);
213211
setValue("profilePhoto", reader.result as string, {
214212
shouldValidate: true,
215213
});
214+
setIsUploading(false);
216215
};
217216
reader.readAsDataURL(file);
218217
};
@@ -675,7 +674,7 @@ const AddPetForm = (): React.ReactElement => {
675674
// add implementation here
676675
}}
677676
handleSecondaryButtonClick={closeAddPetModal}
678-
></AddPetModal>
677+
/>
679678
</>
680679
);
681680
};

frontend/src/features/pet-profile/pages/AddPetModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FC } from "react";
1+
import React, { FC } from "react";
22
import PopupModal from "../../../components/common/PopupModal";
33

44
interface AddPetModalProps {

frontend/src/features/pet-profile/pages/QuitEditingModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { FC } from "react";
2-
import PopupModal from "../../../components/common/PopupModal";
1+
import React, { FC } from "react";
32
import { useHistory } from "react-router-dom";
3+
import PopupModal from "../../../components/common/PopupModal";
44

55
interface QuitEditingModalProps {
66
isOpen: boolean; // Whether the modal should be visible

0 commit comments

Comments
 (0)