mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
switched from context to zustand
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import React, { useState, useContext } from 'react';
|
||||
import React from 'react';
|
||||
import useBoardStore from '../useBoardStore';
|
||||
import Modal from 'react-modal';
|
||||
import styled from 'styled-components';
|
||||
import { BoardContext } from '../App';
|
||||
|
||||
const StyledModal = styled(Modal)`
|
||||
@media (min-width: 480px) {
|
||||
@@ -70,7 +70,7 @@ const customOverlayStyles = {
|
||||
};
|
||||
|
||||
const CaptchaModal = ({ isOpen, closeModal, captchaImage }) => {
|
||||
const { captchaResponse, setCaptchaResponse } = useContext(BoardContext);
|
||||
const { captchaResponse, setCaptchaResponse } = useBoardStore(state => state);
|
||||
|
||||
const handleCloseModal = () => {
|
||||
closeModal();
|
||||
@@ -97,7 +97,8 @@ const CaptchaModal = ({ isOpen, closeModal, captchaImage }) => {
|
||||
autoComplete='off'
|
||||
placeholder="TYPE THE CAPTCHA HERE AND PRESS ENTER"
|
||||
value={captchaResponse}
|
||||
onChange={handleChallengeResponse} />
|
||||
onChange={handleChallengeResponse}
|
||||
autoFocus />
|
||||
</div>
|
||||
</StyledModal>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user