Skip to content

Commit

Permalink
setvisible false onclick outside the modal removed
Browse files Browse the repository at this point in the history
  • Loading branch information
Lvyshnevska committed Sep 3, 2024
1 parent acec200 commit 4847301
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const DeleteProfilePage = (props) => {
<button className={css['button__delete']} onClick={() => setModal(true)}>
Видалити
</button>
<MyModal visible={modal} setVisisble={setModal}>
<MyModal visible={modal}>
<DeleteProfileModal onCancel={cancelHandler} />
</MyModal>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ const ProfileContent = (props) => {

{blocker.state === 'blocked' &&
(
<MyModal visible={modal} setVisisble={setModal}>
<MyModal visible={modal}>
<WarnUnsavedDataModal onCancel={cancelNavigation} onConfirm={confirmNavigation} />
</MyModal>)
}
Expand Down
4 changes: 2 additions & 2 deletions FrontEnd/src/components/ProfilePage/UI/MyModal/MyModal.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import css from './MyModal.module.css';

const MyModal = ({children, visible, setVisisble}) => {
const MyModal = ({children, visible}) => {
const rootClasses = [css['myModal']];
if (visible) {
rootClasses.push(css['active']);
}

return (
<div className={rootClasses.join(' ')} onClick={() => setVisisble(false)}>
<div className={rootClasses.join(' ')}>
<div className={css['myModal__content']} onClick={(event) => event.stopPropagation()}>{children}</div>
</div>
);
Expand Down
1 change: 0 additions & 1 deletion FrontEnd/src/components/cookieacception/CookieMod.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const CookieMod = ({ active, setActive }) => {
return cookies.first ? null : (
<div
className={`${styles['modal-window']} ${active && styles['active']}`}
onClick={() => setActive(false)}
>
<div className={styles['modal-content']} data-testid="cookiemodal" onClick={(e) => e.stopPropagation()}>
<p className={styles['cookie-text']}>
Expand Down
2 changes: 1 addition & 1 deletion FrontEnd/src/components/moderation/ModerationModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export function ModerationModal() {
return (
<div>
<MainPage />
<MyModal visible={modalVisible} setVisisble={setModalVisible}>
<MyModal visible={modalVisible}>
<div className={classes['modal__content']}>{moderationStatus}</div>
<div className={classes['modal__footer']}>
<div className={classes['button-container']}>
Expand Down

0 comments on commit 4847301

Please sign in to comment.