Skip to content

Commit 5dcc87a

Browse files
theredmooseclaude
andcommitted
Fix: stat row grouping using inline style instead of dynamic Tailwind class
Split statRows into two explicit groups; apply marginTop via inline style on the first item of group 2 to avoid Tailwind v4 purge of dynamic classes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent ea549db commit 5dcc87a

1 file changed

Lines changed: 10 additions & 12 deletions

File tree

src/components/MemberDetail.tsx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -282,21 +282,19 @@ export function MemberDetail({
282282
? `${Math.round(m.weight * 2.2046)} lbs`
283283
: `${m.weight} kg`;
284284

285-
const statRows = [
285+
type StatRow = { label: string; value: string; badge?: string | null; onToggle?: () => void; action?: () => void };
286+
287+
const statGroup1: StatRow[] = [
286288
{ label: 'Age', value: `${age} yrs` },
287289
{ label: 'Height', value: heightDisplay, badge: growthBadgeReason, onToggle: () => setHeightUnit(u => u === 'cm' ? 'ft' : 'cm') },
288290
{ label: 'Weight', value: weightDisplay, onToggle: () => setWeightUnit(u => u === 'kg' ? 'lbs' : 'kg') },
289-
{ label: 'Head', value: headDisplay, spaceBefore: true },
291+
];
292+
293+
const statGroup2: StatRow[] = [
294+
{ label: 'Head', value: headDisplay },
290295
...(showHand ? [{ label: 'Hand', value: handDisplay }] : []),
291296
...(showFoot ? [{ label: 'Foot', value: shoeDisplay, action: footLength > 0 ? onOpenConverter : undefined, onToggle: footLength > 0 ? () => setFootUnit(u => u === 'cm' ? 'in' : 'cm') : undefined }] : []),
292-
] as Array<{
293-
label: string;
294-
value: string;
295-
badge?: string | null;
296-
onToggle?: () => void;
297-
action?: () => void;
298-
spaceBefore?: boolean;
299-
}>;
297+
];
300298

301299
return (
302300
<div className="member-detail flex flex-col min-h-screen">
@@ -341,8 +339,8 @@ export function MemberDetail({
341339
</div>
342340

343341
<div className="mb-3 mt-[11px]">
344-
{statRows.map((row) => (
345-
<div key={row.label} className={`flex items-center border-b border-slate-100 py-2.5${row.spaceBefore ? ' mt-3' : ''}`}>
342+
{[...statGroup1, ...statGroup2].map((row, i) => (
343+
<div key={row.label} className="flex items-center border-b border-slate-100 py-2.5" style={i === statGroup1.length ? { marginTop: '8px' } : undefined}>
346344
<span className="flex-1 pl-4 text-[11px] text-slate-400 font-bold tracking-widest">
347345
{row.label}
348346
</span>

0 commit comments

Comments
 (0)