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