mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fixed UI in posting modals
This commit is contained in:
@@ -11,7 +11,8 @@ const CaptchaModal = () => {
|
||||
pendingComment,
|
||||
selectedStyle,
|
||||
setCaptchaResponse,
|
||||
isCaptchaOpen, setIsCaptchaOpen
|
||||
isCaptchaOpen, setIsCaptchaOpen,
|
||||
selectedShortCid,
|
||||
} = useGeneralStore(state => state);
|
||||
|
||||
const [imageSources, setImageSources] = useState([]);
|
||||
@@ -57,7 +58,7 @@ const CaptchaModal = () => {
|
||||
<div className="modal-content" ref={nodeRef}>
|
||||
<div className="modal-header">
|
||||
{pendingComment.parentCid ?
|
||||
("Challenges for Reply c/" + pendingComment.cid) :
|
||||
("Challenges for Reply to c/" + selectedShortCid) :
|
||||
"Challenges for New Thread"}
|
||||
<button className="icon" onClick={() => setIsCaptchaOpen(false)} title="close" />
|
||||
</div>
|
||||
@@ -102,13 +103,19 @@ const CaptchaModal = () => {
|
||||
<span style={{lineHeight: '1.7'}}>
|
||||
Challenge {currentChallengeIndex + 1} of {totalChallenges}
|
||||
</span>
|
||||
<button id="nav" onClick={() => {
|
||||
setCurrentChallengeIndex((currentChallengeIndex + 1) % totalChallenges)
|
||||
}
|
||||
}>></button>
|
||||
<button id="nav" onClick={()=> {
|
||||
setCurrentChallengeIndex((currentChallengeIndex - 1 + totalChallenges) % totalChallenges)
|
||||
}}><</button>
|
||||
<button
|
||||
id="nav"
|
||||
onClick={() => {
|
||||
if (currentChallengeIndex + 1 < totalChallenges) {
|
||||
setCurrentChallengeIndex((currentChallengeIndex + 1) % totalChallenges);
|
||||
} else {
|
||||
setCaptchaResponse(responseRef.current.value);
|
||||
setIsCaptchaOpen(false);
|
||||
}
|
||||
}}
|
||||
>
|
||||
{currentChallengeIndex + 1 < totalChallenges ? "Next" : "Post"}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user