Skip to content

Commit

Permalink
feat: icon success color when updating
Browse files Browse the repository at this point in the history
  • Loading branch information
Zephyruso authored and Zephyruso committed Sep 5, 2023
1 parent e6facf1 commit 6575e73
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
11 changes: 5 additions & 6 deletions src/pages/Proxies.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,16 @@ export default () => {
>
<IconBrandSpeedtest
class={twMerge(
speedTestingMap()[proxy.name] && 'animate-pulse',
speedTestingMap()[proxy.name] &&
'animate-pulse text-success',
)}
/>
</Button>
</div>
<div class="text-sm text-slate-500">
{proxy.type} {proxy.now?.length > 0 && ` :: ${proxy.now}`}
</div>
<Show when={!collapsedMap()[`group-${proxy.name}`]}>
<Show when={!collapsedMap()[proxy.name]}>
<ProxyNodePreview
proxyNameList={sortedProxyNames}
now={proxy.now}
Expand All @@ -93,12 +94,10 @@ export default () => {

return (
<Collapse
isOpen={collapsedMap()[`group-${proxy.name}`]}
isOpen={collapsedMap()[proxy.name]}
title={title}
content={content}
onCollapse={(val) =>
setCollapsedMap(`group-${proxy.name}`, val)
}
onCollapse={(val) => setCollapsedMap(proxy.name, val)}
/>
)
})}
Expand Down
17 changes: 9 additions & 8 deletions src/pages/ProxyProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ export default () => {
onClick={(e) => onUpdateAllProviderClick(e)}
>
<IconReload
class={twMerge(allProviderIsUpdating() && 'animate-spin')}
class={twMerge(
allProviderIsUpdating() && 'animate-spin text-success',
)}
/>
</Button>
</h1>
Expand All @@ -88,7 +90,8 @@ export default () => {
>
<IconReload
class={twMerge(
updateingMap()[proxyProvider.name] && 'animate-spin',
updateingMap()[proxyProvider.name] &&
'animate-spin text-success',
)}
/>
</Button>
Expand All @@ -100,7 +103,7 @@ export default () => {
<IconBrandSpeedtest
class={twMerge(
healthCheckingMap()[proxyProvider.name] &&
'animate-pulse',
'animate-pulse text-success',
)}
/>
</Button>
Expand All @@ -113,7 +116,7 @@ export default () => {
{proxyProvider.vehicleType} :: {t('updated')}{' '}
{formatTimeFromNow(proxyProvider.updatedAt)}
</div>
<Show when={!collapsedMap()[`provider-${proxyProvider.name}`]}>
<Show when={!collapsedMap()[proxyProvider.name]}>
<ProxyNodePreview proxyNameList={sortedProxyNames} />
</Show>
</>
Expand All @@ -123,12 +126,10 @@ export default () => {

return (
<Collapse
isOpen={collapsedMap()[`provider-${proxyProvider.name}`]}
isOpen={collapsedMap()[proxyProvider.name]}
title={title}
content={content}
onCollapse={(val) =>
setCollapsedMap(`provider-${proxyProvider.name}`, val)
}
onCollapse={(val) => setCollapsedMap(proxyProvider.name, val)}
/>
)
})}
Expand Down
7 changes: 5 additions & 2 deletions src/pages/Rules.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ export default () => {
onClick={(e) => onUpdateAllProviderClick(e)}
>
<IconReload
class={twMerge(allProviderIsUpdating() && 'animate-spin')}
class={twMerge(
allProviderIsUpdating() && 'animate-spin text-success',
)}
/>
</Button>
</h1>
Expand All @@ -95,7 +97,8 @@ export default () => {
>
<IconReload
class={twMerge(
updatingMap()[rulesProvider.name] && 'animate-spin',
updatingMap()[rulesProvider.name] &&
'animate-spin text-success',
)}
/>
</Button>
Expand Down

0 comments on commit 6575e73

Please sign in to comment.