Standardize loading states across all components

Replaced custom loading spinners with standardized LoadingState component from AsyncComponent.tsx. This ensures consistent UX for all data-loading operations.

Changes:
- web/src/components/staking/StakingDashboard.tsx: LoadingState for staking data
- web/src/components/governance/GovernanceOverview.tsx: LoadingState for governance data
- web/src/components/governance/ProposalsList.tsx: LoadingState for proposals
- web/src/components/dex/PoolBrowser.tsx: LoadingState for liquidity pools
- web/src/components/delegation/DelegationManager.tsx: LoadingState for delegation data
- web/src/components/forum/ForumOverview.tsx: LoadingState for forum threads
- web/src/components/treasury/TreasuryOverview.tsx: LoadingState for treasury data

All components now show:
- Kurdistan green animated spinner (Loader2)
- Contextual loading messages
- Consistent padding and centering
- Professional appearance

Button loading states (auth, wallet modals) left as-is since they appropriately disable during actions.
This commit is contained in:
Claude
2025-11-16 22:03:46 +00:00
parent 385039e228
commit 4f2c96bb56
7 changed files with 17 additions and 36 deletions
@@ -13,6 +13,7 @@ import DelegateProfile from './DelegateProfile';
import { useDelegation } from '@/hooks/useDelegation';
import { usePolkadot } from '@/contexts/PolkadotContext';
import { formatNumber } from '@/lib/utils';
import { LoadingState } from '@pezkuwi/components/AsyncComponent';
const DelegationManager: React.FC = () => {
const { t } = useTranslation();
@@ -37,14 +38,7 @@ const DelegationManager: React.FC = () => {
};
if (loading) {
return (
<div className="container mx-auto px-4 py-8 max-w-7xl">
<div className="flex items-center justify-center py-12">
<Loader2 className="h-8 w-8 animate-spin text-green-600 mr-3" />
<span className="text-lg">Loading delegation data from blockchain...</span>
</div>
</div>
);
return <LoadingState message="Loading delegation data from blockchain..." />;
}
if (error) {