Modal. js
import React from "react";
const Modal = ({ isOpen, handleClose, children }) => {
return isOpen ? (
<div className="fixed z-10 inset-0 overflow-y-auto">
<div className="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
<div
className="fixed inset-0 transition-opacity"
aria-hidden="true"
onClick={handleClose}
>
<div className="absolute inset-0 bg-gray-500 opacity-75"></div>
</div>
<div
className="inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full"
role="dialog"
aria-modal="true"
aria-labelledby="modal-headline"
>
<div className="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
<div className="flex justify-between items-center pb-3">
<h2 className="text-2xl font-bold">댓글 달기</h2>
<button className="text-black close-modal" onClick={handleClose}>×</button>
</div>
{children}
</div>
</div>
</div>
</div>
) : null;
};
export default Modal;
본 후기는 유데미-스나이퍼팩토리 10주 완성 프로젝트캠프 학습 일지 후기로 작성 되었습니다.
#프로젝트캠프 #프로젝트캠프후기 #유데미 #스나이퍼팩토리 #웅진씽크빅 #인사이드아웃 #IT개발캠프 #개발자부트캠프 #리액트 #react #부트캠프 #리액트캠프
정보가 많아서 도움이 많이 됐습니다.