style adjustment

This commit was merged in pull request #686.
This commit is contained in:
victorAnumudu
2024-04-01 11:41:29 +01:00
parent a4307310ad
commit cab461bd2e
9 changed files with 814 additions and 198 deletions
@@ -56,7 +56,7 @@ export default function AssignMediaTask({
amount: "",
job_description: "",
timeline_days: "",
media_uid: activeMedia.uid,
media_uid: activeMedia?.uid,
family_uid: family_uid,
media_type: "COMMON"
};
@@ -89,7 +89,7 @@ export default function AssignMediaTask({
className={`job-action-modal-body w-full min-h-[450px] max-h-[450px] overflow-y-auto md:grid md:grid-cols-2`}
>
<div className="p-4 pt-0">
<div className="p-4 w-full min-h-[400px] max-h-[400px] overflow-y-auto bg-slate-100 rounded-md dark:bg-[#11131f] dark:text-white">
<div className="p-4 w-full min-h-[410px] max-h-[410px] overflow-y-auto bg-slate-100 rounded-md dark:bg-[#11131f] dark:text-white">
{commonMedia?.data?.length ? (
commonMedia?.data?.map((item, index) => (
<div
@@ -140,12 +140,12 @@ export default function AssignMediaTask({
</Suspense>
</div>
</div>
<div className="grid grid-cols-2 gap-3">
<div className="grid grid-cols-3 gap-3">
{/* Price */}
<div className="field w-full">
<label htmlFor="price" className="job-label flex gap-1">
Price
<span className='text-red-500 text-[10px]'>{props.errors.amount && props.touched.amount && props.errors.amount}</span>
<span className='text-red-500 text-base'>{props.errors.amount && props.touched.amount && '*'}</span>
</label>
<InputCom
fieldClass="px-6 text-right"
@@ -168,7 +168,7 @@ export default function AssignMediaTask({
className="job-label flex gap-1"
>
Currency
{props.errors.currency && props.touched.currency && <span className="text-[10px] text-red-500">{props.errors.currency}</span>}
{props.errors.currency && props.touched.currency && <span className="text-base text-red-500">*</span>}
</label>
<select
id="currency"
@@ -184,7 +184,7 @@ export default function AssignMediaTask({
) : walletDetails.data.length ? (
<>
<option className="text-slate-500 text-[13.975px]" value="">
Currency
Select
</option>
{walletDetails.data?.map((item, index) => (
<option
@@ -203,48 +203,48 @@ export default function AssignMediaTask({
)}
</select>
</div>
</div>
{/* Duration */}
<div className="field w-full">
<label
htmlFor="timeline_days"
className="job-label flex gap-1"
>
Timeline
{props.errors.timeline_days && props.touched.timeline_days && <span className="text-[12px] text-red-500">{props.errors.timeline_days}</span>}
</label>
<select
id="timeline_days"
name="timeline_days"
value={props.values.timeline_days}
className={`input-field w-full h-[42px] flex items-center px-2 mt-2 rounded-full placeholder:text-base text-dark-gray dark:text-white bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-none`}
onChange={props.handleChange}
>
{publicArray.length && (
<>
<option className="text-slate-500 text-[13.975px]" value="">
Duration
</option>
{publicArray.map(({ name, duration }, idx) => (
<option
key={idx}
className="text-slate-500 text-[13.975px]"
value={duration}
>
{name}
{/* Duration */}
<div className="field w-full">
<label
htmlFor="timeline_days"
className="job-label flex gap-1"
>
Timeline
{props.errors.timeline_days && props.touched.timeline_days && <span className="text-base text-red-500">*</span>}
</label>
<select
id="timeline_days"
name="timeline_days"
value={props.values.timeline_days}
className={`input-field w-full h-[42px] flex items-center px-2 mt-2 rounded-full placeholder:text-base text-dark-gray dark:text-white bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-none`}
onChange={props.handleChange}
>
{publicArray.length && (
<>
<option className="text-slate-500 text-[13.975px]" value="">
Duration
</option>
))}
</>
)}
</select>
{publicArray.map(({ name, duration }, idx) => (
<option
key={idx}
className="text-slate-500 text-[13.975px]"
value={duration}
>
{name}
</option>
))}
</>
)}
</select>
</div>
</div>
{/* Delivery Detail */}
<div className="my-3">
<label className="w-full job-label flex gap-1">
Delivery Detail
{props.errors.job_description && props.touched.job_description && <span className="text-[12px] text-red-500">{props.errors.job_description}</span>}
{props.errors.job_description && props.touched.job_description && <span className="text-base text-red-500">*</span>}
</label>
<textarea
className={`p-1 w-full text-sm text-slate-900 dark:text-white bg-transparent outline-none border border-slate-300 rounded-md`}
@@ -36,7 +36,7 @@ export default function AssignPrevNewTask({
taskType !== "new" ? "md:grid-cols-2" : "md:grid-cols-1"
}`}
>
<div className="p-4 pt-0">
<div className="px-4">
<div className="mb-2 w-full flex items-center gap-4">
<div className="flex items-center gap-2 text-sky-blue text-base">
<input
@@ -96,7 +96,7 @@ export default function AssignPrevNewTask({
</div>
)}
{taskType == "new" && (
<div className="p-4 w-full h-full">
<div className="px-4 w-full">
<NewTasks
formState={formState}
setFormState={setFormState}
@@ -109,9 +109,9 @@ export default function AssignPrevNewTask({
{taskType == "select" && (
<>
{jobList?.data?.length > 0 ? (
<div className="p-4 pt-0 h-full">
<div className="px-4">
<div className="w-full">
<p className="text-lg font-bold text-dark-gray dark:text-white tracking-wide border-b-2">
<p className="text-lg font-bold text-dark-gray dark:text-white tracking-wide border-b-2 max-h-[50px] overflow-y-auto">
{activeTask?.data?.title}
</p>
{/* <div className="my-3">
@@ -124,7 +124,7 @@ export default function AssignPrevNewTask({
<label className="job-label">
Description
</label>
<p className="p-1 text-sm text-slate-900 dark:text-white">
<p className="p-1 text-sm text-slate-900 dark:text-white max-h-[100px] overflow-y-auto">
{activeTask?.data?.description}
</p>
</div>
@@ -261,7 +261,13 @@ const AssignTaskPopout = ({
apiCall.parentAssignMediaTask(reqData).then(res => { // API CALL TO ASSIGN MEDIA TASK
if(res.status != 200 || res.data.internal_return < 0){
setRequestStatus({ loading: false, status: false, message: "Failed to Assign Task" });
let error = errorMsg[res?.data?.error_msg] || ''
setRequestStatus({
loading: false,
status: false,
message: error? error : "failed to assign task",
});
return setTimeout(()=>{
setRequestStatus({ loading: false, status: false, message: "" });
}, 3000)
@@ -74,21 +74,6 @@ export default function NewTasks({ formState, setFormState }) {
</div>
{/* Description */}
{/* <div className="field w-full mb-[5px]">
<label htmlFor="description" className="job-label">Description</label>
<InputCom
fieldClass="px-6"
// label="Description"
// labelClass="tracking-wide"
inputBg="bg-slate-100"
type="text"
name="description"
value={formState.description}
inputHandler={handleInputChange}
// blurHandler={props.handleBlur}
// error={props.errors.description && props.touched.description && props.errors.description}
/>
</div> */}
<div className="field flex flex-col sm:flex-row w-full gap-2">
<div className="w-full">
<label
@@ -100,7 +85,7 @@ export default function NewTasks({ formState, setFormState }) {
<textarea
id="description"
rows="5"
className={`input-field px-3 py-2 placeholder:text-base text-dark-gray dark:text-white w-full h-[100px] bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-[#dce4e9] rounded-[10px]`}
className={`input-field px-3 py-2 placeholder:text-base text-dark-gray dark:text-white w-full h-[80px] bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-[#dce4e9] rounded-[10px]`}
style={{ resize: "none" }}
name="description"
value={formState.description}
@@ -136,66 +121,68 @@ export default function NewTasks({ formState, setFormState }) {
{/* inputs starts here */}
<div className="w-full flex flex-col gap-2">
{/* Currency */}
<div className="field w-full">
<label
htmlFor="country"
className="job-label"
>
Currency
{/* {props.errors.country && props.touched.country && <span className="text-[12px] text-red-500">{props.errors.country}</span>} */}
</label>
<select
id="country"
name="country"
value={formState.country}
className={`input-field w-full h-[42px] flex items-center px-2 mt-2 rounded-full placeholder:text-base text-dark-gray dark:text-white bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-none`}
onChange={handleInputChange}
// onBlur={props.handleBlur}
>
{walletDetails?.loading ? (
<option className="text-slate-500 text-[13.975px]" value="">
Loading...
</option>
) : walletDetails.data.length ? (
<>
<option className="text-slate-500 text-[13.975px]" value="">
Currency
</option>
{walletDetails.data?.map((item, index) => (
<option
key={index}
className="text-slate-500 text-lg"
value={item?.country}
>
{item?.code}
</option>
))}
</>
) : (
<option className="text-slate-500 text-lg" value="">
No Options Found! Try Again
</option>
)}
</select>
</div>
<div className="grid grid-cols-2 gap-3">
{/* Price */}
<div className="field w-full">
<label htmlFor="price" className="job-label">Reward</label>
<InputCom
fieldClass="px-6 text-right"
// label="Price"
// labelClass="tracking-wide"
inputBg="bg-slate-100"
type="number"
name="price"
placeholder="0"
value={formState.price}
inputHandler={handleInputChange}
// blurHandler={props.handleBlur}
// error={props.errors.price && props.touched.price && props.errors.price}
/>
</div>
{/* Price */}
<div className="field w-full">
<label htmlFor="price" className="job-label">Price</label>
<InputCom
fieldClass="px-6 text-right"
// label="Price"
// labelClass="tracking-wide"
inputBg="bg-slate-100"
type="number"
name="price"
placeholder="0"
value={formState.price}
inputHandler={handleInputChange}
// blurHandler={props.handleBlur}
// error={props.errors.price && props.touched.price && props.errors.price}
/>
{/* Currency */}
<div className="field w-full">
<label
htmlFor="country"
className="job-label"
>
Currency
{/* {props.errors.country && props.touched.country && <span className="text-[12px] text-red-500">{props.errors.country}</span>} */}
</label>
<select
id="country"
name="country"
value={formState.country}
className={`input-field w-full h-[42px] flex items-center px-2 mt-2 rounded-full placeholder:text-base text-dark-gray dark:text-white bg-slate-100 dark:bg-[#11131F] focus:ring-0 focus:outline-none`}
onChange={handleInputChange}
// onBlur={props.handleBlur}
>
{walletDetails?.loading ? (
<option className="text-slate-500 text-[13.975px]" value="">
Loading...
</option>
) : walletDetails.data.length ? (
<>
<option className="text-slate-500 text-[13.975px]" value="">
Select
</option>
{walletDetails.data?.map((item, index) => (
<option
key={index}
className="text-slate-500 text-lg"
value={item?.country}
>
{item?.code}
</option>
))}
</>
) : (
<option className="text-slate-500 text-lg" value="">
No Options Found! Try Again
</option>
)}
</select>
</div>
</div>
{/* Duration */}