fix(usercenter/overview): 4 处格式调整

1. 顶栏 Sign out 按钮加 whiteSpace:nowrap,不再折成两行。
2. 近 7 日柱状图数字保留 2 位有效数字(Number(v.toPrecision(2))),不再显示
   9.285392755642533 这种长数。
3. 英文星期标签 M/T/W/T/F/S/S → Mon/Tue/Wed/Thu/Fri/Sat/Sun(消歧义;中文
   一~日 本就清晰不改)。
4. 图表卡与 Quick actions 卡 alignItems start→stretch,两卡等高、上下对齐。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-07-08 11:09:51 +08:00
parent 37258e1cb2
commit 620d8148f3
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -24,7 +24,7 @@ export default function Overview({
const free = me.plan === 'free';
const vals = me.weeklyGB;
const max = Math.max(...vals, 0.1);
const labels = lang === 'zh' ? ['一', '二', '三', '四', '五', '六', '日'] : ['M', 'T', 'W', 'T', 'F', 'S', 'S'];
const labels = lang === 'zh' ? ['一', '二', '三', '四', '五', '六', '日'] : ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
const stats: [string, string, string, string][] = [
['clock', t('quotaToday'), free ? String(me.quotaTodayMin ?? 0) : '∞', free ? 'min' : ''],
@@ -76,13 +76,13 @@ export default function Overview({
</div>
{/* usage chart + quick actions */}
<div style={{ display: 'grid', gridTemplateColumns: mobile ? '1fr' : '1.6fr 1fr', gap: 14, alignItems: 'start' }}>
<div style={{ display: 'grid', gridTemplateColumns: mobile ? '1fr' : '1.6fr 1fr', gap: 14, alignItems: 'stretch' }}>
<div style={{ ...card, padding: '18px 22px' }}>
<div style={{ fontSize: 13.5, fontWeight: 600, color: 'var(--fg1)', marginBottom: 16 }}>{t('usageTitle')}</div>
<div style={{ display: 'flex', alignItems: 'flex-end', gap: 14, height: 110 }}>
{vals.map((v, i) => (
<div key={i} style={{ flex: 1, display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 6 }}>
<div style={{ fontFamily: 'var(--font-mono)', fontSize: 9.5, color: 'var(--fg3)' }}>{v}</div>
<div style={{ fontFamily: 'var(--font-mono)', fontSize: 9.5, color: 'var(--fg3)' }}>{Number(v.toPrecision(2))}</div>
<div style={{ width: '100%', maxWidth: 30, height: `${(v / max) * 76}px`, background: 'var(--accent)', borderRadius: '5px 5px 0 0', opacity: 0.85 }} />
<div style={{ fontSize: 10.5, color: 'var(--fg3)' }}>{labels[i]}</div>
</div>
+1 -1
View File
@@ -180,7 +180,7 @@ export default function UserCenter() {
<Icon name={theme === 'dark' ? 'sun' : 'moon'} size={17} color="var(--fg3)" />
</button>
<LangSeg lang={lang} setLang={setLang} />
<button onClick={signOut} style={{ display: 'inline-flex', alignItems: 'center', gap: 7, border: 'none', background: 'transparent', cursor: 'pointer', color: 'var(--fg2)', fontSize: 13, fontWeight: 600, padding: 6 }}>
<button onClick={signOut} style={{ display: 'inline-flex', alignItems: 'center', gap: 7, border: 'none', background: 'transparent', cursor: 'pointer', color: 'var(--fg2)', fontSize: 13, fontWeight: 600, padding: 6, whiteSpace: 'nowrap' }}>
<Icon name="log-out" size={15} color="var(--fg3)" />
{!mobile && t('signOut')}
</button>