icon bug solved in edit profile

This commit is contained in:
Senthamilselvi 2025-11-06 17:12:02 +05:30
parent 9d0aca9f59
commit c5a8cb33f4
2 changed files with 33 additions and 64 deletions

View File

@ -273,36 +273,19 @@ export const TextField = ({
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"
className="h-4 w-4"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
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"
/>
</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" /> <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" /> <circle cx="12" cy="12" r="3" />
</svg> </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="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" />
</svg>
)} )}
</button> </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>

View File

@ -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>