mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-04-28 17:47:56 +00:00
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:
@@ -9,6 +9,7 @@ import { Badge } from '../ui/badge';
|
||||
import { Progress } from '../ui/progress';
|
||||
import { usePolkadot } from '../../contexts/PolkadotContext';
|
||||
import { formatBalance } from '@pezkuwi/lib/wallet';
|
||||
import { LoadingState } from '@pezkuwi/components/AsyncComponent';
|
||||
|
||||
interface GovernanceStats {
|
||||
activeProposals: number;
|
||||
@@ -123,6 +124,10 @@ const GovernanceOverview: React.FC = () => {
|
||||
}
|
||||
};
|
||||
|
||||
if (loading) {
|
||||
return <LoadingState message="Loading governance data..." />;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
{/* Stats Grid */}
|
||||
|
||||
@@ -7,6 +7,7 @@ import { Progress } from '../ui/progress';
|
||||
import { Alert, AlertDescription } from '../ui/alert';
|
||||
import { useGovernance } from '@/hooks/useGovernance';
|
||||
import { formatNumber } from '@/lib/utils';
|
||||
import { LoadingState } from '@pezkuwi/components/AsyncComponent';
|
||||
|
||||
interface Proposal {
|
||||
id: number;
|
||||
@@ -84,12 +85,7 @@ const ProposalsList: React.FC = () => {
|
||||
};
|
||||
|
||||
if (loading) {
|
||||
return (
|
||||
<div className="flex items-center justify-center py-12">
|
||||
<Loader2 className="h-8 w-8 animate-spin text-primary mr-3" />
|
||||
<span className="text-muted-foreground">Loading proposals from blockchain...</span>
|
||||
</div>
|
||||
);
|
||||
return <LoadingState message="Loading proposals from blockchain..." />;
|
||||
}
|
||||
|
||||
if (error) {
|
||||
|
||||
Reference in New Issue
Block a user