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 [textValue, setTextValue] = useState("");
const [errMsg, setErrMsg] = useState({
market: false,
manage: false,
});
const apiCall = useMemo(() => new usersService(), []);
const handleInputChange = ({ target: { value } }) => {
@@ -50,11 +54,14 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
setMarketMsg({ data: marketMessageRes, state: true });
} catch (error) {
setErrMsg({ market: true });
setMarketMsg({ loading: false, state: false });
throw new Error(error);
} finally {
setTextValue("");
setTimeout(() => {
setTextValue("");
setMarketMsg({ loading: false, state: false });
setErrMsg({ market: false });
}, 5000);
}
};
@@ -195,17 +202,20 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
If you have any questions about this task:
</label>
<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"
style={{ resize: "none" }}
placeholder="Enter message here ..."
value={textValue}
value={marketMsg.loading ? "Sending..." : textValue}
onChange={handleInputChange}
/>
</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">
{marketMsg.state && "Message Sent!"}
{errMsg.market && "Something went wrong"}
</span>
<button
className="self-end w-[150px] h-[48px] rounded-full text-base bg-yellow-500 text-white"