profile page optional fields
All checks were successful
Deploy to Server / deploy (push) Successful in 30s

This commit is contained in:
2026-04-10 20:30:08 -05:00
parent cf09ba95dd
commit 508b1e8169

View File

@@ -47,10 +47,6 @@ export function ProfileSettings() {
setNameError(''); setNameError('');
setNameSaved(false); setNameSaved(false);
const trimmed = userName.trim(); const trimmed = userName.trim();
if (!trimmed) {
setNameError('Name is required.');
return;
}
setSavingName(true); setSavingName(true);
const { error: err } = await updateUser({ name: trimmed }); const { error: err } = await updateUser({ name: trimmed });
setSavingName(false); setSavingName(false);
@@ -67,10 +63,6 @@ export function ProfileSettings() {
setError(''); setError('');
setSaved(false); setSaved(false);
if (!piFirstName.trim() || !bldgCode.trim() || !lab.trim()) {
setError('PI first name, building code, and lab are required.');
return;
}
if (contact.trim() && !validatePhoneOrEmail(contact.trim())) { if (contact.trim() && !validatePhoneOrEmail(contact.trim())) {
setError('Contact must be a valid phone number or email address.'); setError('Contact must be a valid phone number or email address.');
return; return;
@@ -156,37 +148,34 @@ export function ProfileSettings() {
<CardContent className="space-y-4 pb-6"> <CardContent className="space-y-4 pb-6">
<div className="space-y-1"> <div className="space-y-1">
<Label htmlFor="pi"> <Label htmlFor="pi">
PI first name <span className="text-red-500">*</span> PI first name <span className="text-muted-foreground font-normal">(optional)</span>
</Label> </Label>
<Input <Input
id="pi" id="pi"
value={piFirstName} value={piFirstName}
onChange={e => setPiFirstName(e.target.value)} onChange={e => setPiFirstName(e.target.value)}
required
placeholder="e.g. Smith" placeholder="e.g. Smith"
/> />
</div> </div>
<div className="space-y-1"> <div className="space-y-1">
<Label htmlFor="bldg"> <Label htmlFor="bldg">
Building code <span className="text-red-500">*</span> Building code <span className="text-muted-foreground font-normal">(optional)</span>
</Label> </Label>
<Input <Input
id="bldg" id="bldg"
value={bldgCode} value={bldgCode}
onChange={e => setBldgCode(e.target.value)} onChange={e => setBldgCode(e.target.value)}
required
placeholder="e.g. EER" placeholder="e.g. EER"
/> />
</div> </div>
<div className="space-y-1"> <div className="space-y-1">
<Label htmlFor="lab"> <Label htmlFor="lab">
Lab <span className="text-red-500">*</span> Lab <span className="text-muted-foreground font-normal">(optional)</span>
</Label> </Label>
<Input <Input
id="lab" id="lab"
value={lab} value={lab}
onChange={e => setLab(e.target.value)} onChange={e => setLab(e.target.value)}
required
placeholder="e.g. 3.822" placeholder="e.g. 3.822"
/> />
</div> </div>