From 0e6d1d2476b1e7e0a21e94a5dfcbfd76e7000e96 Mon Sep 17 00:00:00 2001 From: Tunglies <77394545+Tunglies@users.noreply.github.com> Date: Fri, 17 Apr 2026 21:29:35 +0800 Subject: [PATCH] fix(ui): unify delay color handling in ProxyItem and TestItem components #6829 --- src/components/proxy/proxy-item-mini.tsx | 10 +++++----- src/components/proxy/proxy-item.tsx | 10 +++++----- src/components/test/test-item.tsx | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/components/proxy/proxy-item-mini.tsx b/src/components/proxy/proxy-item-mini.tsx index 7594fceed..79fc7015b 100644 --- a/src/components/proxy/proxy-item-mini.tsx +++ b/src/components/proxy/proxy-item-mini.tsx @@ -248,12 +248,12 @@ export const ProxyItemMini = (props: Props) => { e.stopPropagation() onDelay() }} - color={delayManager.formatDelayColor(delayValue, timeout)} - sx={({ palette }) => - !proxy.provider + sx={({ palette }) => ({ + color: delayManager.formatDelayColor(delayValue, timeout), + ...(!proxy.provider ? { ':hover': { bgcolor: alpha(palette.primary.main, 0.15) } } - : {} - } + : {}), + })} > {delayManager.formatDelay(delayValue, timeout)} diff --git a/src/components/proxy/proxy-item.tsx b/src/components/proxy/proxy-item.tsx index be422bee3..254477e53 100644 --- a/src/components/proxy/proxy-item.tsx +++ b/src/components/proxy/proxy-item.tsx @@ -214,12 +214,12 @@ export const ProxyItem = (props: Props) => { e.stopPropagation() onDelay() }} - color={delayManager.formatDelayColor(delayValue, timeout)} - sx={({ palette }) => - !proxy.provider + sx={({ palette }) => ({ + color: delayManager.formatDelayColor(delayValue, timeout), + ...(!proxy.provider ? { ':hover': { bgcolor: alpha(palette.primary.main, 0.15) } } - : {} - } + : {}), + })} > {delayManager.formatDelay(delayValue, timeout)} diff --git a/src/components/test/test-item.tsx b/src/components/test/test-item.tsx index 746271dd1..a208d7d7c 100644 --- a/src/components/test/test-item.tsx +++ b/src/components/test/test-item.tsx @@ -187,8 +187,8 @@ export const TestItem = ({ e.stopPropagation() onDelay() }} - color={delayManager.formatDelayColor(delay)} sx={({ palette }) => ({ + color: delayManager.formatDelayColor(delay), ':hover': { bgcolor: alpha(palette.primary.main, 0.15), },