feat(me): inline profile editing in the Profile tab (P3b)
Wires existing updateMyProfile + discloseAffiliations into an editable form (name, handle, phone, bio, skills, interests, willing-to, affiliations). Affiliations re-disclosed only when changed so the COI timestamp is not reset on every save. Added bio to the updateMyProfile param type (schema + column already supported it). 521 tests; build clean (UI not browser-tested from here).
This commit is contained in:
@@ -11,6 +11,7 @@ import { SIGNUP_STATUS_LABEL, SESSION_STATUS_LABEL } from '@/lib/classes-logic'
|
||||
import { RESERVATION_STATUS_LABEL } from '@/lib/equipment-logic'
|
||||
import { presenceStatus } from '@/lib/presence-logic'
|
||||
import { DuesCard } from '@/components/billing/dues-card'
|
||||
import { ProfileForm, type ProfileInitial } from './profile-form'
|
||||
|
||||
const STATUS_VARIANT: Record<CertStatus, 'default' | 'outline'> = {
|
||||
active: 'default',
|
||||
@@ -53,6 +54,7 @@ export type HeldPermission = { code: string; label: string }
|
||||
export type Billing = { status: string | null; currentPeriodEnd: string | null; hasCustomer: boolean } | null
|
||||
|
||||
type Props = {
|
||||
profile: ProfileInitial
|
||||
grants: Grant[]
|
||||
held: HeldPermission[]
|
||||
billing: Billing
|
||||
@@ -66,6 +68,7 @@ type Props = {
|
||||
const sectionH = 'font-mono text-[10px] uppercase tracking-widest text-muted-foreground mb-3'
|
||||
|
||||
export function MePortalClient({
|
||||
profile,
|
||||
grants,
|
||||
held,
|
||||
billing,
|
||||
@@ -94,6 +97,11 @@ export function MePortalClient({
|
||||
</TabsList>
|
||||
|
||||
<TabsContent value="profile" className="space-y-8">
|
||||
<section>
|
||||
<h2 className={sectionH}>Profile</h2>
|
||||
<ProfileForm initial={profile} />
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2 className={sectionH}>My permissions</h2>
|
||||
{held.length === 0 ? (
|
||||
|
||||
Reference in New Issue
Block a user