From f12a239e26c1b9f026e8c51686dac5e230ba1f36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IT=E7=8B=97?= Date: Tue, 21 Jul 2026 22:41:45 +0800 Subject: [PATCH] =?UTF-8?q?StatusBadge:=20drop=20holiday=20suffix=20chip?= =?UTF-8?q?=20=E2=80=94=20main=20badge=20already=20says=20=E5=85=AC?= =?UTF-8?q?=E5=81=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous '🎉香港特別行政區成立紀念日' chip wrapped to 7 lines on mobile and duplicated info already conveyed by the '公假' main badge. Keep leave chips (+SL2h, +AL4h, etc.) since the basic-status badge doesn't reveal the leave type, but skip holiday decoration entirely. --- frontend/src/components/StatusBadge.jsx | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/frontend/src/components/StatusBadge.jsx b/frontend/src/components/StatusBadge.jsx index f0edc04..8d3a8b4 100644 --- a/frontend/src/components/StatusBadge.jsx +++ b/frontend/src/components/StatusBadge.jsx @@ -32,9 +32,10 @@ export default function StatusBadge({ code = '', text = '', size = 'sm' }) { ) - // Extract leave/holiday suffix from status_text: + // Extract leave suffix from status_text (holiday suffix dropped — the main + // badge already says 公假, so repeating the long name like + // '香港特別行政區成立紀念日' clutters the row). // '異常-遲到48分 + SL2h' → ['SL2h'] - // '缺勤 (🎉香港特別行政區成立紀念日)' → ['🎉香港特別行政區成立紀念日'] // 'OT3分 + AL4h + SL3h' → ['AL4h', 'SL3h'] // '正常 + CL4h' → ['CL4h'] const t = String(text || '') @@ -44,25 +45,17 @@ export default function StatusBadge({ code = '', text = '', size = 'sm' }) { for (let i = 1; i < split.length; i++) { noteParts.push(split[i].replace(/^\(|\)$/g, '').trim()) } - } else if (t.includes('🎉')) { - const m = t.match(/🎉[^)\s]+(?:\s[^)\s]+)*/) - if (m) noteParts.push(m[0]) } const noteChips = noteParts.filter(Boolean).map((part, idx) => { - // Strip trailing ')' - const clean = part.replace(/\)+$/, '') - const isHoliday = clean.startsWith('🎉') - const cls = isHoliday - ? 'bg-indigo-50 text-indigo-600 border border-indigo-200' - : 'bg-violet-50 text-violet-600 border border-violet-200' + const cls = 'bg-violet-50 text-violet-600 border border-violet-200' return ( - {isHoliday ? clean : `+${clean}`} + +{part} ) })