icon bug solved in edit profile
This commit is contained in:
parent
9d0aca9f59
commit
c5a8cb33f4
@ -264,45 +264,28 @@ export const TextField = ({
|
|||||||
className="pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4"
|
className="pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{isPasswordField && showToggle && (
|
{isPasswordField && showToggle && (
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => setShowPassword((prev) => !prev)}
|
onClick={() => setShowPassword((prev) => !prev)}
|
||||||
className="absolute right-3 top-1/2 -translate-y-1/2 text-[#92722A] hover:text-[#7b5c1f]"
|
className="absolute right-3 top-1/2 -translate-y-1/2 text-[#92722A] hover:text-[#7b5c1f]"
|
||||||
aria-label={showPassword ? toggleLabels.hide : toggleLabels.show}
|
aria-label={showPassword ? toggleLabels.hide : toggleLabels.show}
|
||||||
title={showPassword ? toggleLabels.hide : toggleLabels.show}
|
title={showPassword ? toggleLabels.hide : toggleLabels.show}
|
||||||
>
|
>
|
||||||
{showPassword ? (
|
{showPassword ? (
|
||||||
<svg
|
<svg xmlns="http://www.w3.org/2000/svg" className="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
<path strokeLinecap="round" strokeLinejoin="round" d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8S1 12 1 12z" />
|
||||||
className="h-4 w-4"
|
<circle cx="12" cy="12" r="3" />
|
||||||
viewBox="0 0 24 24"
|
</svg>
|
||||||
fill="none"
|
) : (
|
||||||
stroke="currentColor"
|
<svg xmlns="http://www.w3.org/2000/svg" className="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||||
strokeWidth="2"
|
<path strokeLinecap="round" strokeLinejoin="round" d="M3 3l18 18" />
|
||||||
>
|
<path strokeLinecap="round" strokeLinejoin="round" d="M10.58 10.58A2 2 0 0012 14a2 2 0 001.42-.58M16.68 16.68C15.28 17.54 13.69 18 12 18 7 18 3.73 14.82 2 12c.58-.9 1.34-1.83 2.26-2.68M9.88 4.13C10.56 4.05 11.27 4 12 4c5 0 8.27 3.18 10 6-.46.72-1.03 1.43-1.71 2.1" />
|
||||||
<path strokeLinecap="round" strokeLinejoin="round" d="M3 3l18 18" />
|
</svg>
|
||||||
<path
|
)}
|
||||||
strokeLinecap="round"
|
</button>
|
||||||
strokeLinejoin="round"
|
)}
|
||||||
d="M10.58 10.58A2 2 0 0012 14a2 2 0 001.42-.58M16.68 16.68C15.28 17.54 13.69 18 12 18 7 18 3.73 14.82 2 12c.58-.9 1.34-1.83 2.26-2.68M9.88 4.13C10.56 4.05 11.27 4 12 4c5 0 8.27 3.18 10 6-.46.72-1.03 1.43-1.71 2.1"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
) : (
|
|
||||||
<svg
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
className="h-4 w-4"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
fill="none"
|
|
||||||
stroke="currentColor"
|
|
||||||
strokeWidth="2"
|
|
||||||
>
|
|
||||||
<path strokeLinecap="round" strokeLinejoin="round" d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8S1 12 1 12z" />
|
|
||||||
<circle cx="12" cy="12" r="3" />
|
|
||||||
</svg>
|
|
||||||
)}
|
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
{error && <p className="mt-1 text-xs text-[#B91C1C]">{error}</p>}
|
{error && <p className="mt-1 text-xs text-[#B91C1C]">{error}</p>}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -511,29 +511,28 @@ useEffect(() => {
|
|||||||
(Number(form.employmentEmiratiFemale) || 0) +
|
(Number(form.employmentEmiratiFemale) || 0) +
|
||||||
(Number(form.employmentNonEmiratiMale) || 0) +
|
(Number(form.employmentNonEmiratiMale) || 0) +
|
||||||
(Number(form.employmentNonEmiratiFemale) || 0),
|
(Number(form.employmentNonEmiratiFemale) || 0),
|
||||||
updated_by: 1
|
updated_by: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log("Payload sent:", establishmentData);
|
console.log("Payload sent:", establishmentData);
|
||||||
|
|
||||||
if (establishmentId) {
|
if (establishmentId) {
|
||||||
console.log('Updating establishment with ID:', establishmentId);
|
console.log("Updating establishment with ID:", establishmentId);
|
||||||
await updateEstablishment(establishmentId, establishmentData);
|
await updateEstablishment(establishmentId, establishmentData);
|
||||||
alert('Profile updated successfully!');
|
console.log("Profile updated successfully!");
|
||||||
onClose();
|
onClose();
|
||||||
} else {
|
} else {
|
||||||
console.error('No establishment ID provided for update');
|
console.error("No establishment ID provided for update");
|
||||||
alert('Error: No establishment ID provided for update');
|
alert("Error: No establishment ID provided for update");
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error saving profile:', error);
|
console.error("Error saving profile:", error);
|
||||||
alert('Failed to update profile. Please try again.');
|
alert("Failed to update profile. Please try again.");
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const renderStepContent = () => {
|
const renderStepContent = () => {
|
||||||
switch (activeStep) {
|
switch (activeStep) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -563,7 +562,7 @@ useEffect(() => {
|
|||||||
/>
|
/>
|
||||||
<div className="space-y-1">
|
<div className="space-y-1">
|
||||||
<TextField
|
<TextField
|
||||||
label="New Password"
|
label="Password"
|
||||||
value={form.userProfilePassword || ""}
|
value={form.userProfilePassword || ""}
|
||||||
onChange={(e) => handleFormChange("userProfilePassword", e.target.value)}
|
onChange={(e) => handleFormChange("userProfilePassword", e.target.value)}
|
||||||
placeholder="Enter password"
|
placeholder="Enter password"
|
||||||
@ -575,19 +574,6 @@ useEffect(() => {
|
|||||||
{passwordError && <p className="text-xs text-[#B91C1C]">{passwordError}</p>}
|
{passwordError && <p className="text-xs text-[#B91C1C]">{passwordError}</p>}
|
||||||
{passwordReuseError && <p className="text-xs text-[#B91C1C]">{passwordReuseError}</p>}
|
{passwordReuseError && <p className="text-xs text-[#B91C1C]">{passwordReuseError}</p>}
|
||||||
</div>
|
</div>
|
||||||
<div className="space-y-1">
|
|
||||||
<TextField
|
|
||||||
label="Confirm Password"
|
|
||||||
value={form.userProfileConfirmPassword || ""}
|
|
||||||
onChange={(e) => handleFormChange("userProfileConfirmPassword", e.target.value)}
|
|
||||||
placeholder="Confirm password"
|
|
||||||
width="100%"
|
|
||||||
type="password"
|
|
||||||
showToggle
|
|
||||||
className={confirmError ? 'border-red-500' : ''}
|
|
||||||
/>
|
|
||||||
{confirmError && <p className="text-xs text-[#B91C1C]">{confirmError}</p>}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user