Skip to content

Commit 9dc248f

Browse files
committed
fix(profile): 余额记录弹窗表格宽度优化
- 弹窗最大宽度从 750px 调整为 900px - 金额和余额变动列不换行,备注列超长截断并 hover 显示全文
1 parent f19074e commit 9dc248f

1 file changed

Lines changed: 13 additions & 9 deletions

File tree

web/src/pages/user/ProfilePage.tsx

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ function MyBalanceHistoryModal({ open, balance, onClose }: { open: boolean; bala
304304
<Modal.Container placement="center" scroll="inside" size="md">
305305
<Modal.Dialog
306306
className="ag-elevation-modal"
307-
style={{ maxWidth: '750px', width: 'min(100%, calc(100vw - 2rem))' }}
307+
style={{ maxWidth: '900px', width: 'min(100%, calc(100vw - 2rem))' }}
308308
>
309309
<Modal.Header>
310310
<Modal.Heading>{t('profile.balance_history')}</Modal.Heading>
@@ -323,12 +323,12 @@ function MyBalanceHistoryModal({ open, balance, onClose }: { open: boolean; bala
323323
<HeroTable.Column id="action" isRowHeader style={{ width: 96 }}>
324324
{t('users.action_type')}
325325
</HeroTable.Column>
326-
<HeroTable.Column id="amount">{t('users.amount')}</HeroTable.Column>
327-
<HeroTable.Column id="balance_change">
326+
<HeroTable.Column id="amount" style={{ whiteSpace: 'nowrap' }}>{t('users.amount')}</HeroTable.Column>
327+
<HeroTable.Column id="balance_change" style={{ whiteSpace: 'nowrap' }}>
328328
{t('users.before_balance')}{t('users.after_balance')}
329329
</HeroTable.Column>
330-
<HeroTable.Column id="remark">{t('users.remark')}</HeroTable.Column>
331-
<HeroTable.Column id="created_at">{t('users.created_at')}</HeroTable.Column>
330+
<HeroTable.Column id="remark" style={{ minWidth: 100 }}>{t('users.remark')}</HeroTable.Column>
331+
<HeroTable.Column id="created_at" style={{ whiteSpace: 'nowrap' }}>{t('users.created_at')}</HeroTable.Column>
332332
</HeroTable.Header>
333333
<HeroTable.Body>
334334
{isLoading ? (
@@ -358,17 +358,21 @@ function MyBalanceHistoryModal({ open, balance, onClose }: { open: boolean; bala
358358
</Chip>
359359
</HeroTable.Cell>
360360
<HeroTable.Cell>
361-
<span className={`font-mono text-xs font-semibold ${row.action === 'add' ? 'text-success' : row.action === 'subtract' ? 'text-danger' : 'text-info'}`}>
361+
<span className={`font-mono text-xs font-semibold whitespace-nowrap ${row.action === 'add' ? 'text-success' : row.action === 'subtract' ? 'text-danger' : 'text-info'}`}>
362362
{row.action === 'add' ? '+' : row.action === 'subtract' ? '-' : '='}{row.amount.toFixed(2)}
363363
</span>
364364
</HeroTable.Cell>
365365
<HeroTable.Cell>
366-
<span className="font-mono text-xs text-text-secondary">
367-
${row.before_balance.toFixed(2)} → ${row.after_balance.toFixed(2)}
366+
<span className="font-mono text-xs text-text-secondary whitespace-nowrap">
367+
${row.before_balance.toFixed(2)}
368+
<span className="text-text-tertiary"></span>
369+
${row.after_balance.toFixed(2)}
368370
</span>
369371
</HeroTable.Cell>
370372
<HeroTable.Cell>
371-
<span className="text-xs text-text-tertiary">{row.remark || '-'}</span>
373+
<span className="text-xs text-text-tertiary block max-w-[200px] truncate" title={row.remark || undefined}>
374+
{row.remark || '-'}
375+
</span>
372376
</HeroTable.Cell>
373377
<HeroTable.Cell>
374378
<span className="text-xs text-text-secondary">

0 commit comments

Comments
 (0)