mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-02-18 18:50:49 +08:00
feat(quota): improve refresh button functionality and update translations
- Added a new `isRefreshing` state to streamline loading logic for the refresh button. - Updated the refresh button's disabled and loading states for better user experience. - Simplified the refresh button content display. - Revised translations for the refresh action in both English and Chinese locales. - Enhanced styles for button alignment and SVG display.
This commit is contained in:
@@ -211,6 +211,8 @@ export function QuotaSection<TState extends QuotaStatusState, TData>({
|
||||
</div>
|
||||
);
|
||||
|
||||
const isRefreshing = sectionLoading || loading;
|
||||
|
||||
return (
|
||||
<Card
|
||||
title={titleNode}
|
||||
@@ -242,14 +244,12 @@ export function QuotaSection<TState extends QuotaStatusState, TData>({
|
||||
variant="secondary"
|
||||
size="sm"
|
||||
onClick={handleRefresh}
|
||||
disabled={disabled || sectionLoading || loading || filteredFiles.length === 0}
|
||||
loading={sectionLoading || loading}
|
||||
disabled={disabled || isRefreshing || filteredFiles.length === 0}
|
||||
loading={isRefreshing}
|
||||
title={t('quota_management.refresh_files_and_quota')}
|
||||
aria-label={t('quota_management.refresh_files_and_quota')}
|
||||
>
|
||||
<span className={styles.refreshButtonContent}>
|
||||
{!sectionLoading && !loading && <IconRefreshCw size={18} />}
|
||||
{t('quota_management.refresh_files_and_quota')}
|
||||
</span>
|
||||
{!isRefreshing && <IconRefreshCw size={16} />}
|
||||
</Button>
|
||||
</div>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user