enable overlay for ReplyModal mobile

This commit is contained in:
Tom
2023-05-11 15:24:46 +02:00
parent 4f6b6d18cb
commit 46228ffa5d
3 changed files with 3 additions and 7 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ const CaptchaModal = () => {
const [imageSources, setImageSources] = useState([]);
const [currentChallengeIndex, setCurrentChallengeIndex] = useState(0);
const [totalChallenges, setTotalChallenges] = useState(0);
const [isMobile, setIsMobile] = useState(window.innerWidth <= 480);
const [isMobile, setIsMobile] = useState(window.innerWidth <= 480);
const responseRef = useRef();
const nodeRef = useRef(null);
+2 -2
View File
@@ -205,9 +205,9 @@ const ReplyModal = ({ isOpen, closeModal }) => {
onRequestClose={closeModal}
contentLabel="Reply Modal"
shouldCloseOnEsc={false}
shouldCloseOnOverlayClick={false}
shouldCloseOnOverlayClick={isMobile}
selectedStyle={selectedStyle}
overlayClassName="hide-modal-overlay">
style={isMobile ? ({ overlay: { backgroundColor: "rgba(0,0,0,.25)" }}) : ({ overlay: { backgroundColor: "rgba(0,0,0,0)" }})}>
<Draggable handle=".modal-header" nodeRef={nodeRef} disabled={isMobile}>
<div className="modal-content" ref={nodeRef}>
<div className="modal-header">
@@ -2,10 +2,6 @@ import styled from "styled-components";
import Modal from "react-modal";
export const StyledModal = styled(Modal)`
.hide-modal-overlay {
display: none;
}
.modal-content {
position: fixed;
top: calc(50% - 150px);