mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
enable overlay for ReplyModal mobile
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user