Modal close when clicking outside
This commit is contained in:
parent
01a4a29e45
commit
468de2a4a4
@ -102,11 +102,11 @@ const ProjectModal: NextPage = () => {
|
|||||||
return <div className={styles.pageSelector}>{prev}<span style={{visibility: currentPage > 0 ? "visible" : "hidden"}}> | </span>{select}<span style={{visibility: currentPage < currentContent.entries.length ? "visible" : "hidden"}}> | </span>{next}</div>;
|
return <div className={styles.pageSelector}>{prev}<span style={{visibility: currentPage > 0 ? "visible" : "hidden"}}> | </span>{select}<span style={{visibility: currentPage < currentContent.entries.length ? "visible" : "hidden"}}> | </span>{next}</div>;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
return <div className={styles.modal}>
|
return <div className={styles.modal} onClick={() => setVisible(false)}>
|
||||||
<a onClick={() => setVisible(false)} className={styles.fakeLink}>
|
<a onClick={() => setVisible(false)} className={styles.fakeLink}>
|
||||||
<div className={styles.modalClose}><div className={styles.modalCloseAlign}>X</div></div>
|
<div className={styles.modalClose}><div className={styles.modalCloseAlign}>X</div></div>
|
||||||
</a>
|
</a>
|
||||||
<div className={styles.modalContainer}>
|
<div className={styles.modalContainer} onClick={(event) => event.stopPropagation()}>
|
||||||
{nextPageSelector}
|
{nextPageSelector}
|
||||||
<div className={`${styles.modalText} asciidoc`} ref={containerRef} dangerouslySetInnerHTML={{ __html: HTMLContent ? HTMLContent : projectEmpty }}>
|
<div className={`${styles.modalText} asciidoc`} ref={containerRef} dangerouslySetInnerHTML={{ __html: HTMLContent ? HTMLContent : projectEmpty }}>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user