Last change
on this file was d7b7f00, checked in by Gorazd Biskoski <gorazdbiskoskii@…>, 4 weeks ago |
Add project
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[d7b7f00] | 1 | import React from 'react';
|
---|
| 2 | import styles from '../../css/RecipesCss/review-modal.module.css';
|
---|
| 3 |
|
---|
| 4 | const Modal = ({ isOpen, onClose, title, children, deleteReviewId, handleDeleteReview }) => {
|
---|
| 5 | if (!isOpen) return null;
|
---|
| 6 |
|
---|
| 7 | return (
|
---|
| 8 | <div className={styles.modalOverlay}>
|
---|
| 9 | <div className={styles.modalContent}>
|
---|
| 10 | <h2>{title}</h2>
|
---|
| 11 | <div>{children}</div>
|
---|
| 12 | <div>
|
---|
| 13 | {deleteReviewId && (
|
---|
| 14 | <button
|
---|
| 15 | onClick={handleDeleteReview}
|
---|
| 16 | className={`${styles.modalButton} ${styles.modalButtonDelete}`}
|
---|
| 17 | >
|
---|
| 18 | Yes, delete
|
---|
| 19 | </button>
|
---|
| 20 | )}
|
---|
| 21 | <button
|
---|
| 22 | onClick={onClose}
|
---|
| 23 | className={`${styles.modalButton} ${styles.modalButtonClose}`}
|
---|
| 24 | >
|
---|
| 25 | Close
|
---|
| 26 | </button>
|
---|
| 27 | </div>
|
---|
| 28 | </div>
|
---|
| 29 | </div>
|
---|
| 30 | );
|
---|
| 31 | };
|
---|
| 32 |
|
---|
| 33 | export default Modal;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.