Compare commits

...

2 Commits

2 changed files with 29 additions and 4 deletions
+28 -3
View File
@@ -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 (
<Formik
initialValues={IV}
initialValues={initialValues}
validationSchema={validationSchema}
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`}
onChange={props.handleChange}
onBlur={props.handleBlur}
disabled={walletDetails.data.length == 1}
>
{walletDetails?.loading ? (
<option className="text-slate-500 text-lg" value="">
Loading...
</option>
) : walletDetails.data.length ? (
) : walletDetails.data.length > 1 ? (
<>
<option className="text-slate-500 text-lg" value="">
Select a currency
@@ -125,7 +138,19 @@ function AddJob({ popUpHandler, categories }) {
</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="">
No Options Found! Try Again
</option>
+1 -1
View File
@@ -22,7 +22,7 @@ export default function WalletBox({ wallet, payment, countries }) {
</div>
) : (
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} />
</div>
))