tiny bug fix and checker added
This commit was merged in pull request #458.
This commit is contained in:
@@ -7,6 +7,10 @@ import LoadingSpinner from "../../Spinners/LoadingSpinner";
|
|||||||
|
|
||||||
const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
|
const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
|
||||||
const [textValue, setTextValue] = useState("");
|
const [textValue, setTextValue] = useState("");
|
||||||
|
const [errMsg, setErrMsg] = useState({
|
||||||
|
market: false,
|
||||||
|
manage: false,
|
||||||
|
});
|
||||||
const apiCall = useMemo(() => new usersService(), []);
|
const apiCall = useMemo(() => new usersService(), []);
|
||||||
|
|
||||||
const handleInputChange = ({ target: { value } }) => {
|
const handleInputChange = ({ target: { value } }) => {
|
||||||
@@ -50,13 +54,14 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
|
|||||||
|
|
||||||
setMarketMsg({ data: marketMessageRes, state: true });
|
setMarketMsg({ data: marketMessageRes, state: true });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
setErrMsg({ market: true });
|
||||||
|
setMarketMsg({ loading: false, state: false });
|
||||||
throw new Error(error);
|
throw new Error(error);
|
||||||
} finally {
|
} finally {
|
||||||
setTimeout(() => {
|
setTextValue("");
|
||||||
setTextValue("");
|
|
||||||
}, 2000);
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
setMarketMsg({ loading: false, state: false });
|
setMarketMsg({ loading: false, state: false });
|
||||||
|
setErrMsg({ market: false });
|
||||||
}, 5000);
|
}, 5000);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -210,6 +215,7 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
|
|||||||
<div className="relative flex w-full justify-end mt-0 sm:mt-[1.4rem]">
|
<div className="relative flex w-full justify-end mt-0 sm:mt-[1.4rem]">
|
||||||
<span className="text-sm text-[#57cd89] absolute left-[8rem] top-4">
|
<span className="text-sm text-[#57cd89] absolute left-[8rem] top-4">
|
||||||
{marketMsg.state && "Message Sent!"}
|
{marketMsg.state && "Message Sent!"}
|
||||||
|
{errMsg.market && "Something went wrong"}
|
||||||
</span>
|
</span>
|
||||||
<button
|
<button
|
||||||
className="self-end w-[150px] h-[48px] rounded-full text-base bg-yellow-500 text-white"
|
className="self-end w-[150px] h-[48px] rounded-full text-base bg-yellow-500 text-white"
|
||||||
|
|||||||
Reference in New Issue
Block a user