fix(ui): unify delay color handling in ProxyItem and TestItem components #6829

This commit is contained in:
Tunglies 2026-04-17 21:29:35 +08:00
parent 4718c80498
commit 0e6d1d2476
No known key found for this signature in database
GPG Key ID: B9B01B389469B3E8
3 changed files with 11 additions and 11 deletions

View File

@ -248,12 +248,12 @@ export const ProxyItemMini = (props: Props) => {
e.stopPropagation() e.stopPropagation()
onDelay() onDelay()
}} }}
color={delayManager.formatDelayColor(delayValue, timeout)} sx={({ palette }) => ({
sx={({ palette }) => color: delayManager.formatDelayColor(delayValue, timeout),
!proxy.provider ...(!proxy.provider
? { ':hover': { bgcolor: alpha(palette.primary.main, 0.15) } } ? { ':hover': { bgcolor: alpha(palette.primary.main, 0.15) } }
: {} : {}),
} })}
> >
{delayManager.formatDelay(delayValue, timeout)} {delayManager.formatDelay(delayValue, timeout)}
</Widget> </Widget>

View File

@ -214,12 +214,12 @@ export const ProxyItem = (props: Props) => {
e.stopPropagation() e.stopPropagation()
onDelay() onDelay()
}} }}
color={delayManager.formatDelayColor(delayValue, timeout)} sx={({ palette }) => ({
sx={({ palette }) => color: delayManager.formatDelayColor(delayValue, timeout),
!proxy.provider ...(!proxy.provider
? { ':hover': { bgcolor: alpha(palette.primary.main, 0.15) } } ? { ':hover': { bgcolor: alpha(palette.primary.main, 0.15) } }
: {} : {}),
} })}
> >
{delayManager.formatDelay(delayValue, timeout)} {delayManager.formatDelay(delayValue, timeout)}
</Widget> </Widget>

View File

@ -187,8 +187,8 @@ export const TestItem = ({
e.stopPropagation() e.stopPropagation()
onDelay() onDelay()
}} }}
color={delayManager.formatDelayColor(delay)}
sx={({ palette }) => ({ sx={({ palette }) => ({
color: delayManager.formatDelayColor(delay),
':hover': { ':hover': {
bgcolor: alpha(palette.primary.main, 0.15), bgcolor: alpha(palette.primary.main, 0.15),
}, },