Skip to content

Commit e43344a

Browse files
committed
style: add wordpress loading
1 parent 8744720 commit e43344a

File tree

3 files changed

+37
-8
lines changed

3 files changed

+37
-8
lines changed

packages/extension-polkagate/src/components/Progress.tsx

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,30 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
import { Grid, useTheme } from '@mui/material';
5-
//@ts-ignore
6-
import { Circle, CubeGrid, WanderingCubes } from 'better-react-spinkit';
5+
// @ts-ignore
6+
import { Circle, CubeGrid, WanderingCubes, Wordpress } from 'better-react-spinkit';
77
import React from 'react';
88

99
interface Props {
10+
direction?: 'column' | 'row'
1011
fontSize?: number;
12+
titlePaddingTop?: number;
13+
titlePaddingLeft?: number;
1114
title?: string;
1215
pt?: number | string;
1316
size?: number;
1417
gridSize?: number;
15-
type?: 'circle' | 'cubes' | 'grid';
18+
type?: 'circle' | 'cubes' | 'grid' | 'wordpress';
1619
}
1720

18-
function Progress ({ fontSize = 13, gridSize = 135, pt = '50px', size = 25, title, type = 'circle' }: Props): React.ReactElement<Props> {
21+
function Progress ({ direction = 'column', fontSize = 13, gridSize = 135, pt = '50px', size = 25, title, titlePaddingTop = 20, titlePaddingLeft = 0, type = 'circle' }: Props): React.ReactElement<Props> {
1922
const theme = useTheme();
2023

2124
return (
2225
<Grid
2326
alignItems='center'
2427
container
25-
direction='column'
28+
direction={direction}
2629
justifyContent='center'
2730
pt={pt}
2831
>
@@ -34,6 +37,12 @@ function Progress ({ fontSize = 13, gridSize = 135, pt = '50px', size = 25, titl
3437
size={size}
3538
/>
3639
}
40+
{type === 'wordpress' &&
41+
<Wordpress
42+
color={theme.palette.primary.main}
43+
size={size}
44+
/>
45+
}
3746
{type === 'cubes' &&
3847
<WanderingCubes
3948
color={theme.palette.primary.main}
@@ -55,7 +64,11 @@ function Progress ({ fontSize = 13, gridSize = 135, pt = '50px', size = 25, titl
5564
{title &&
5665
<Grid
5766
item
58-
sx={{ fontSize, paddingTop: '20px' }}
67+
sx={{
68+
fontSize,
69+
pl: `${titlePaddingLeft}px`,
70+
pt: `${titlePaddingTop}px`
71+
}}
5972
>
6073
{title}
6174
</Grid>

packages/extension-polkagate/src/popup/history/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,15 @@ export default function TransactionHistory (): React.ReactElement {
7878
// staking transaction history is saved locally
7979
tabIndex !== TAB_MAP.STAKING &&
8080
((transfersTx?.hasMore)
81-
? 'loading...'
81+
? <Progress
82+
direction='row'
83+
pt='5px'
84+
size={15}
85+
title={t('Loading...')}
86+
titlePaddingLeft={5}
87+
titlePaddingTop={0}
88+
type='wordpress'
89+
/>
8290
: !!tabHistory?.length &&
8391
<Box fontSize={11}>
8492
{t('No more transactions to load')}

packages/extension-polkagate/src/popup/history/modal/HistoryModal.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,15 @@ export default function HistoryModal ({ address, setDisplayPopup }: Props): Reac
8585
// staking transaction history is saved locally
8686
tabIndex !== TAB_MAP.STAKING &&
8787
((transfersTx?.hasMore)
88-
? 'loading...'
88+
? <Progress
89+
direction='row'
90+
pt='5px'
91+
size={15}
92+
title={t('Loading...')}
93+
titlePaddingLeft={5}
94+
titlePaddingTop={0}
95+
type='wordpress'
96+
/>
8997
: !!tabHistory?.length &&
9098
<Box fontSize={11}>
9199
{t('No more transactions to load')}

0 commit comments

Comments
 (0)