diff --git a/src/components/Review/ReviewButton.tsx b/src/components/Review/ReviewButton.tsx index ca1209a5..11885da3 100644 --- a/src/components/Review/ReviewButton.tsx +++ b/src/components/Review/ReviewButton.tsx @@ -1,7 +1,7 @@ import { ButtonPrimary } from '@components/common/button/Button'; -import { useState, useEffect } from 'react'; -import { contentState, keywordsState, ratingState } from '@recoil/review'; -import { useRecoilState, useRecoilValue } from 'recoil'; +import { ratingState } from '@recoil/review'; +import { useEffect, useState } from 'react'; +import { useRecoilValue } from 'recoil'; interface ButtonProps { onClick: () => void; @@ -9,29 +9,9 @@ interface ButtonProps { const ReviewButton = (props: ButtonProps) => { const { onClick } = props; - const [content] = useRecoilState(contentState); - const keywords = useRecoilValue(keywordsState); const rating = useRecoilValue(ratingState); - const [isContentValid, setIsContentValid] = useState(false); - const [isKeywordsValid, setIsKeywordsValid] = useState(false); const [isRatingValid, setIsRatingValid] = useState(false); - useEffect(() => { - if (content.length >= 10) { - setIsContentValid(true); - } else if (content.length < 10) { - setIsContentValid(false); - } - }, [content]); - - useEffect(() => { - if (keywords.length > 0) { - setIsKeywordsValid(true); - } else if (keywords.length <= 0) { - setIsKeywordsValid(false); - } - }, [keywords]); - useEffect(() => { if (rating > 0) { setIsRatingValid(true); @@ -41,28 +21,19 @@ const ReviewButton = (props: ButtonProps) => { }, [rating]); return ( -