ae6db7e16f
Onboarding asks explicitly for one or two parents and shows one card per parent for balances; the balance form is per parent with inline validation; the partner can be filled from the FK deduction or added from it. Settings and Dashboard reuse the same form. CSS: bare buttons carry no colour any more; buttons, cards, choice cards, fields, alerts, badges, eyebrow and modal chrome are defined once in primitives.css. Media queries live only in responsive.css. A style guard test blocks hex, !important and stray media queries. Bilingual fixes: calendar selects size by content, header no longer wraps. Vitest is capped at four workers. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
23 lines
856 B
TypeScript
23 lines
856 B
TypeScript
import type { PersonalData } from '@/types'
|
|
|
|
/** True when `member` is the signed-in user identified by `personalDataUuid`. */
|
|
export function isSelf(member: PersonalData, personalDataUuid: string | null): boolean {
|
|
return personalDataUuid !== null && member.uuid === personalDataUuid
|
|
}
|
|
|
|
/**
|
|
* Stable-sorts `members` so the signed-in user (if present among them) comes
|
|
* first, leaving every other member in their original relative order.
|
|
*
|
|
* Used to put "your" `ParentBalanceForm` ahead of a partner's in any UI that
|
|
* lists both — see `ParentBalanceForm.tsx`.
|
|
*/
|
|
export function orderSelfFirst(
|
|
members: PersonalData[],
|
|
personalDataUuid: string | null,
|
|
): PersonalData[] {
|
|
const self = members.filter((m) => isSelf(m, personalDataUuid))
|
|
const others = members.filter((m) => !isSelf(m, personalDataUuid))
|
|
return [...self, ...others]
|
|
}
|