Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

Commit ebd4a1b

Browse files
committed
add loading indicator
1 parent 1bd9907 commit ebd4a1b

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

ts/pages/staking/staking_pool.tsx

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { useSelector } from 'react-redux';
66
import { Redirect, RouteChildrenProps, useParams } from 'react-router-dom';
77
import styled from 'styled-components';
88

9+
import { Loading } from 'ts/components/portal/loading';
910
import { DashboardHero } from 'ts/components/staking/dashboard_hero';
1011
import { HistoryChart } from 'ts/components/staking/history_chart';
1112
import { StakingPageLayout } from 'ts/components/staking/layout/staking_page_layout';
@@ -36,6 +37,10 @@ const Container = styled.div`
3637
padding: 0 20px;
3738
`;
3839

40+
const LoadingContainer = styled.div`
41+
padding: 100px 0;
42+
`;
43+
3944
const Heading = styled.h2`
4045
font-size: var(--defaultHeading);
4146
line-height: 1.35;
@@ -249,6 +254,11 @@ export const StakingPool: React.FC<StakingPoolProps & RouteChildrenProps> = (pro
249254
]}
250255
/>
251256
)}
257+
{!stakingPool && (
258+
<LoadingContainer>
259+
<Loading isLoading={true} content={null} />
260+
</LoadingContainer>
261+
)}
252262
{/* TODO(johnrjj) Copy from account page when finished */}
253263
{/* <ActionsWrapper>
254264
<ActionsInner>
@@ -285,18 +295,17 @@ export const StakingPool: React.FC<StakingPoolProps & RouteChildrenProps> = (pro
285295
</Actions>
286296
</ActionsInner>
287297
</ActionsWrapper> */}
288-
<Container>
289-
<GraphHeading>Historical Details</GraphHeading>
290-
{historicalEpochs && (
298+
{historicalEpochs && (
299+
<Container>
300+
<GraphHeading>Historical Details</GraphHeading>
291301
<HistoryChart
292302
totalRewards={historicalEpochs.map((e) => e.totalRewardsPaidInEth)}
293303
memberRewards={historicalEpochs.map((e) => e.membersRewardsPaidInEth)}
294304
epochs={historicalEpochs.map((e) => e.epochId)}
295305
labels={historicalEpochs.map((e) => format(new Date(e.epochEndTimestamp), 'd MMM'))}
296306
/>
297-
)}
298-
{/* TODO(johnrjj) Trading pairs after launch */}
299-
{/* <Heading>Trading Pairs</Heading>
307+
{/* TODO(johnrjj) Trading pairs after launch */}
308+
{/* <Heading>Trading Pairs</Heading>
300309
<div>
301310
{tradingPairs.map(({ price, currency, firstCurrency, secondCurrency, id, url }) => {
302311
return (
@@ -314,7 +323,8 @@ export const StakingPool: React.FC<StakingPoolProps & RouteChildrenProps> = (pro
314323
);
315324
})}
316325
</div> */}
317-
</Container>
326+
</Container>
327+
)}
318328
</StakingPageLayout>
319329
);
320330
};

0 commit comments

Comments
 (0)