Merge branch 'job-increse-bug-fix' of WrenchBoard/Users-Wrench into master

This commit is contained in:
2023-10-25 09:15:19 +00:00
committed by Gogs
@@ -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,11 +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 {
setTextValue("");
setTimeout(() => { setTimeout(() => {
setTextValue("");
setMarketMsg({ loading: false, state: false }); setMarketMsg({ loading: false, state: false });
setErrMsg({ market: false });
}, 5000); }, 5000);
} }
}; };
@@ -195,17 +202,20 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
If you have any questions about this task: If you have any questions about this task:
</label> </label>
<textarea <textarea
className={`p-1 w-full text-sm text-slate-900 dark:text-white bg-transparent outline-none border-2 border-slate-300 rounded-md`} className={`p-1 w-full text-sm text-slate-900 dark:text-white ${
marketMsg.loading && "italic text-[#9CA3AF]"
} bg-transparent outline-none border-2 border-slate-300 rounded-md`}
rows="3" rows="3"
style={{ resize: "none" }} style={{ resize: "none" }}
placeholder="Enter message here ..." placeholder="Enter message here ..."
value={textValue} value={marketMsg.loading ? "Sending..." : textValue}
onChange={handleInputChange} onChange={handleInputChange}
/> />
</div> </div>
<div className="relative flex w-full justify-end"> <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"