mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
disable draggable for CaptchaModal mobile
This commit is contained in:
@@ -18,9 +18,22 @@ const CaptchaModal = () => {
|
||||
const [imageSources, setImageSources] = useState([]);
|
||||
const [currentChallengeIndex, setCurrentChallengeIndex] = useState(0);
|
||||
const [totalChallenges, setTotalChallenges] = useState(0);
|
||||
const [isMobile, setIsMobile] = useState(window.innerWidth <= 480);
|
||||
const responseRef = useRef();
|
||||
const nodeRef = useRef(null);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
const handleResize = () => setIsMobile(window.innerWidth <= 480);
|
||||
window.addEventListener('resize', handleResize);
|
||||
|
||||
// Cleanup function
|
||||
return () => {
|
||||
window.removeEventListener('resize', handleResize);
|
||||
};
|
||||
}, [setIsMobile]);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (challengesArray) {
|
||||
const challenges = challengesArray.challenges;
|
||||
@@ -71,7 +84,7 @@ const CaptchaModal = () => {
|
||||
shouldCloseOnOverlayClick={false}
|
||||
selectedStyle={selectedStyle}
|
||||
overlayClassName="hide-modal-overlay">
|
||||
<Draggable handle=".modal-header" nodeRef={nodeRef}>
|
||||
<Draggable handle=".modal-header" nodeRef={nodeRef} disabled={isMobile}>
|
||||
<div className="modal-content" ref={nodeRef}>
|
||||
<div className="modal-header">
|
||||
{pendingComment.parentCid ?
|
||||
|
||||
Reference in New Issue
Block a user