Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9ca4ba3199 | |||
| e5fa6544a5 |
@@ -72,9 +72,21 @@ function AddJob({ popUpHandler, categories }) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// For form initial values
|
||||||
|
const initialValues = {
|
||||||
|
// initial values for formik
|
||||||
|
country: walletDetails.data.length == 1 ? walletDetails.data[0].country : '',
|
||||||
|
price: "",
|
||||||
|
title: "",
|
||||||
|
description: "",
|
||||||
|
job_detail: "",
|
||||||
|
timeline_days: "",
|
||||||
|
category: [],
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Formik
|
<Formik
|
||||||
initialValues={IV}
|
initialValues={initialValues}
|
||||||
validationSchema={validationSchema}
|
validationSchema={validationSchema}
|
||||||
onSubmit={handleAddJob}
|
onSubmit={handleAddJob}
|
||||||
>
|
>
|
||||||
@@ -105,12 +117,13 @@ function AddJob({ popUpHandler, categories }) {
|
|||||||
className={`input-field p-2 mt-3 rounded-md placeholder:text-base text-dark-gray dark:text-white w-full h-10 bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-none border`}
|
className={`input-field p-2 mt-3 rounded-md placeholder:text-base text-dark-gray dark:text-white w-full h-10 bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-none border`}
|
||||||
onChange={props.handleChange}
|
onChange={props.handleChange}
|
||||||
onBlur={props.handleBlur}
|
onBlur={props.handleBlur}
|
||||||
|
disabled={walletDetails.data.length == 1}
|
||||||
>
|
>
|
||||||
{walletDetails?.loading ? (
|
{walletDetails?.loading ? (
|
||||||
<option className="text-slate-500 text-lg" value="">
|
<option className="text-slate-500 text-lg" value="">
|
||||||
Loading...
|
Loading...
|
||||||
</option>
|
</option>
|
||||||
) : walletDetails.data.length ? (
|
) : walletDetails.data.length > 1 ? (
|
||||||
<>
|
<>
|
||||||
<option className="text-slate-500 text-lg" value="">
|
<option className="text-slate-500 text-lg" value="">
|
||||||
Select a currency
|
Select a currency
|
||||||
@@ -125,7 +138,19 @@ function AddJob({ popUpHandler, categories }) {
|
|||||||
</option>
|
</option>
|
||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
) : (
|
) : walletDetails.data.length == 1 ?
|
||||||
|
<>
|
||||||
|
{walletDetails.data?.map((item, index) => (
|
||||||
|
<option
|
||||||
|
key={index}
|
||||||
|
className="text-slate-500 text-lg"
|
||||||
|
value={item?.country}
|
||||||
|
>
|
||||||
|
{item?.description}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
:(
|
||||||
<option className="text-slate-500 text-lg" value="">
|
<option className="text-slate-500 text-lg" value="">
|
||||||
No Options Found! Try Again
|
No Options Found! Try Again
|
||||||
</option>
|
</option>
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export default function WalletBox({ wallet, payment, countries }) {
|
|||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
data.length > 0 && data.map((item) => (
|
data.length > 0 && data.map((item) => (
|
||||||
<div key={item.wallet_uid} className="lg:w-full h-full mb-10 lg:mb-0">
|
<div key={item.wallet_uid} className="max-w-[450px] w-full h-full mb-10 lg:mb-0">
|
||||||
<WalletItemCard walletItem={item} payment={payment} countries={countries} />
|
<WalletItemCard walletItem={item} payment={payment} countries={countries} />
|
||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
|
|||||||
Reference in New Issue
Block a user