Merge branch 'popout-fix' of WrenchBoard/Users-Wrench into master
This commit is contained in:
@@ -24,12 +24,6 @@ export default function MemberList({
|
|||||||
|
|
||||||
const handleFieldsChange = ({ target: { name, value } }) => {
|
const handleFieldsChange = ({ target: { name, value } }) => {
|
||||||
setFields((prev) => ({ ...prev, [name]: value }));
|
setFields((prev) => ({ ...prev, [name]: value }));
|
||||||
// let error = requestState?.errors?.indexOf(name) //// checks if the input field was in error array and removes it when the input changes
|
|
||||||
// if(error >= 0){
|
|
||||||
// let oldErrorArr = requestState.errors
|
|
||||||
// let newErrorArr = oldErrorArr.splice(error, 1)
|
|
||||||
// setRequestState(prev => ({...prev, errors:oldErrorArr}))
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (value == "") {
|
if (value == "") {
|
||||||
setRequestState({
|
setRequestState({
|
||||||
@@ -89,6 +83,63 @@ export default function MemberList({
|
|||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
if(fields.firstname.length > 25){ // checks if firstname length is more than 25
|
||||||
|
setRequestState({
|
||||||
|
loading: false,
|
||||||
|
status: false,
|
||||||
|
message: "Firstname must not be more than 25 characters",
|
||||||
|
data: [],
|
||||||
|
errors: [],
|
||||||
|
});
|
||||||
|
return setTimeout(() => {
|
||||||
|
setRequestState({
|
||||||
|
loading: false,
|
||||||
|
status: false,
|
||||||
|
message: "",
|
||||||
|
data: [],
|
||||||
|
errors: [],
|
||||||
|
});
|
||||||
|
}, 3000);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(fields.lastname.length > 25){ // checks if lastname length is more than 25
|
||||||
|
setRequestState({
|
||||||
|
loading: false,
|
||||||
|
status: false,
|
||||||
|
message: "Lastname must not be more than 25 characters",
|
||||||
|
data: [],
|
||||||
|
errors: [],
|
||||||
|
});
|
||||||
|
return setTimeout(() => {
|
||||||
|
setRequestState({
|
||||||
|
loading: false,
|
||||||
|
status: false,
|
||||||
|
message: "",
|
||||||
|
data: [],
|
||||||
|
errors: [],
|
||||||
|
});
|
||||||
|
}, 3000);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(fields.email.length > 45){ // checks if email length is more than 45
|
||||||
|
setRequestState({
|
||||||
|
loading: false,
|
||||||
|
status: false,
|
||||||
|
message: "Email must not be more than 45 characters",
|
||||||
|
data: [],
|
||||||
|
errors: [],
|
||||||
|
});
|
||||||
|
return setTimeout(() => {
|
||||||
|
setRequestState({
|
||||||
|
loading: false,
|
||||||
|
status: false,
|
||||||
|
message: "",
|
||||||
|
data: [],
|
||||||
|
errors: [],
|
||||||
|
});
|
||||||
|
}, 3000);
|
||||||
|
}
|
||||||
|
|
||||||
//checks if email is a valid email address
|
//checks if email is a valid email address
|
||||||
let regEx = /^[^0-9][a-zA-Z0-9._%+-]+@[a-zA-Z]+(\.[a-zA-Z]+)+$/;
|
let regEx = /^[^0-9][a-zA-Z0-9._%+-]+@[a-zA-Z]+(\.[a-zA-Z]+)+$/;
|
||||||
if (!EmailValidator(fields.email)) {
|
if (!EmailValidator(fields.email)) {
|
||||||
@@ -201,7 +252,7 @@ export default function MemberList({
|
|||||||
{selectedGroup?.name}
|
{selectedGroup?.name}
|
||||||
</h1>
|
</h1>
|
||||||
<div className="w-full flex flex-col-reverse lg:flex-col">
|
<div className="w-full flex flex-col-reverse lg:flex-col">
|
||||||
<div className="py-3 w-full">
|
<div className="relative py-3 w-full">
|
||||||
<div className="relative grid grid-cols-1 sm:grid-cols-2 gap-2 place-content-center">
|
<div className="relative grid grid-cols-1 sm:grid-cols-2 gap-2 place-content-center">
|
||||||
<div className="input-item">
|
<div className="input-item">
|
||||||
<InputCom
|
<InputCom
|
||||||
@@ -268,10 +319,11 @@ export default function MemberList({
|
|||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="absolute top-full w-full my-1 text-center">
|
||||||
{!requestState.loading && requestState.message && (
|
{!requestState.loading && requestState.message && (
|
||||||
<p
|
<p
|
||||||
className={`text-lg absolute -bottom-7 left-0 ${
|
className={`text-base ${
|
||||||
requestState.status ? "text-green-500" : "text-red-500"
|
requestState.status ? "text-green-500" : "text-red-500"
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -119,8 +119,8 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
|
|||||||
return (
|
return (
|
||||||
<ModalCom action={onClose} situation={situation}>
|
<ModalCom action={onClose} situation={situation}>
|
||||||
<div className="logout-modal-wrapper w-11/12 md:w-[650px] md:h-[580px] h-full bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
<div className="logout-modal-wrapper w-11/12 md:w-[650px] md:h-[580px] h-full bg-white dark:bg-dark-white lg:rounded-2xl overflow-y-auto">
|
||||||
<div className="logout-modal-header w-full flex items-center justify-between lg:p-6 px-[30px] py-[23px]">
|
<div className="modal-header-con">
|
||||||
<h1 className="text-26 font-bold text-dark-gray dark:text-white tracking-wide">
|
<h1 className="modal-title">
|
||||||
{details.offer_code}
|
{details.offer_code}
|
||||||
</h1>
|
</h1>
|
||||||
<CloseIcon onClose={onClose} />
|
<CloseIcon onClose={onClose} />
|
||||||
@@ -153,7 +153,7 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
|
|||||||
},
|
},
|
||||||
].map(({ name, content, danger }, idx) => (
|
].map(({ name, content, danger }, idx) => (
|
||||||
<div className={`my-3 md:flex items-center`} key={idx}>
|
<div className={`my-3 md:flex items-center`} key={idx}>
|
||||||
<label className="w-full md:w-[19%] tracking-wide font-semibold whitespace-pre-wrap">
|
<label className="job-label w-full md:w-[19%]">
|
||||||
{name}
|
{name}
|
||||||
</label>
|
</label>
|
||||||
<div
|
<div
|
||||||
@@ -198,7 +198,7 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
|
|||||||
<hr />
|
<hr />
|
||||||
<div className="w-full flex flex-col gap-3">
|
<div className="w-full flex flex-col gap-3">
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<label className="w-full text-slate-900 dark:text-white tracking-wide font-semibold">
|
<label className="job-label w-full">
|
||||||
If you have any questions about this task:
|
If you have any questions about this task:
|
||||||
</label>
|
</label>
|
||||||
<textarea
|
<textarea
|
||||||
@@ -235,7 +235,7 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
|
|||||||
<div className="w-full md:w-[23%] h-full flex flex-col">
|
<div className="w-full md:w-[23%] h-full flex flex-col">
|
||||||
<div className="mx-auto bg-[#f1f8ff] dark:bg-[#C2C8D3] px-4 rounded-md md:min-h-[420px] flex flex-col justify-between">
|
<div className="mx-auto bg-[#f1f8ff] dark:bg-[#C2C8D3] px-4 rounded-md md:min-h-[420px] flex flex-col justify-between">
|
||||||
<div className="w-full flex flex-col justify-center pb-4 gap-2">
|
<div className="w-full flex flex-col justify-center pb-4 gap-2">
|
||||||
<p className="w-full text-slate-900 tracking-wide my-1 font-semibold">
|
<p className="job-label w-full">
|
||||||
Interested in the task?
|
Interested in the task?
|
||||||
</p>
|
</p>
|
||||||
<hr />
|
<hr />
|
||||||
@@ -270,10 +270,13 @@ const MarketPopUp = ({ details, onClose, situation, marketInt }) => {
|
|||||||
|
|
||||||
<div className="text-slate-900">
|
<div className="text-slate-900">
|
||||||
<p className="flex items-center tracking-wide">
|
<p className="flex items-center tracking-wide">
|
||||||
Interest: <b className="ml-1">{details.interest_count}</b>
|
<span className="job-label">Interest: </span> <b className="ml-1">{details.interest_count}</b>
|
||||||
</p>
|
</p>
|
||||||
<hr />
|
<hr />
|
||||||
<p className="my-1">Expire: {details.expire}</p>
|
<p className="my-1 flex flex-col">
|
||||||
|
<span className="job-label">Expire: </span>
|
||||||
|
<span> {new Date(details.expire).toLocaleString()} </span>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
@@ -296,7 +299,7 @@ export default MarketPopUp;
|
|||||||
const CloseIcon = ({ onClose }) => (
|
const CloseIcon = ({ onClose }) => (
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="text-[#374557] dark:text-red-500"
|
className="modal-close-btn"
|
||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
|
|||||||
Reference in New Issue
Block a user