Skip to content

Commit

Permalink
fixed eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
NwinNwin committed Aug 27, 2023
1 parent e8b3f07 commit ab2c2f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions src/components/CreateModal/CreateModal.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import { useState, useContext, useEffect } from "react";
import { useState, useContext, useEffect, useCallback } from "react";
import {
Image,
Button,
Expand Down Expand Up @@ -56,13 +56,12 @@ export default function CreateModal({
uploadImg,
upload,
}) {
const oldNewAddedItem = newAddedItem;
const { user } = UserAuth();
const { onLoginModalOpen } = useContext(DataContext);
const { isOpen, onOpen, onClose } = useDisclosure();
const [isLoading, setIsLoading] = useState(false);

const uploadFile = () => {
const uploadFile = useCallback(() => {
if (!newAddedItem.image) return;

const time = new Date().getTime();
Expand All @@ -86,14 +85,14 @@ export default function CreateModal({
}
});
});
};
}, [newAddedItem.image, setUploadImg, setNewAddedItem, setIsLoading]);

useEffect(() => {
if (newAddedItem.image && typeof newAddedItem.image !== "string") {
setIsLoading(true);
uploadFile();
}
}, [newAddedItem.image]);
}, [newAddedItem.image, uploadFile]);

const [date, setDate] = useState(new Date());

Expand Down Expand Up @@ -377,7 +376,7 @@ export default function CreateModal({
) : (
<Image
width="40%"
src={uploadImg == "" ? img_placeholder : uploadImg}
src={uploadImg === "" ? img_placeholder : uploadImg}
/>
)}
</Flex>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Type/TypeCard.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { Flex, Image, Text, Button } from "@chakra-ui/react";
import { Image, Text, Button } from "@chakra-ui/react";

export default function TypeCard({
type,
Expand Down

0 comments on commit ab2c2f2

Please sign in to comment.