Skip to content

Commit 6dcd364

Browse files
committed
feat: 문의하기 등록버튼 비활성화 적용
1 parent f5fd8eb commit 6dcd364

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

vite-project/src/pages/ItemDetailPage/ItemComments.jsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export default function ItemComments({ commentInfo }) {
1515
const [dropdown, setDropdown] = useState(null);
1616
const [editId, setEditId] = useState(null);
1717
const [editContent, setEditContent] = useState("");
18+
const [inquiry, setInquiry] = useState("");
1819

1920
const handleEdit = (comment) => {
2021
setEditId(comment.id);
@@ -38,9 +39,16 @@ export default function ItemComments({ commentInfo }) {
3839
className="resize-none rounded-[12px] bg-[#f3f4f6] px-[24px] py-[16px] mt-3"
3940
name="inquiry"
4041
id="inquiry"
42+
value={inquiry}
43+
onChange={(e) => setInquiry(e.target.value)}
4144
placeholder="개인정보를 공유 및 요청하거나, 명예 회손, 무단 광고, 불법 정보 유포시 모니터링 후 삭제될 수 있으며, 이에 대한 민형사상 책임은 게시자에게 있습니다."
4245
></textarea>
43-
<button className="flex justify-center items-center mt-4 ml-auto rounded-lg bg-[#9ca3af] w-[74px] h-[42px] font-semibold text-[16px] text-[#f3f4f6]">
46+
<button
47+
disabled={inquiry.trim() === ""}
48+
className={`flex justify-center items-center mt-4 ml-auto rounded-lg w-[74px] h-[42px] font-semibold text-[16px] text-[#f3f4f6] ${
49+
inquiry.trim() === "" ? "bg-[#9ca3af]" : "bg-[#3692ff]"
50+
}`}
51+
>
4452
등록
4553
</button>
4654
{commentInfo.list?.length > 0 ? (

0 commit comments

Comments
 (0)