Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: add wordpress loading #1605

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions packages/extension-polkagate/src/components/Progress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,30 @@
// SPDX-License-Identifier: Apache-2.0

import { Grid, useTheme } from '@mui/material';
//@ts-ignore
import { Circle, CubeGrid, WanderingCubes } from 'better-react-spinkit';
// @ts-ignore
import { Circle, CubeGrid, WanderingCubes, Wordpress } from 'better-react-spinkit';
Nick-1979 marked this conversation as resolved.
Show resolved Hide resolved
import React from 'react';

interface Props {
direction?: 'column' | 'row'
fontSize?: number;
titlePaddingTop?: number;
titlePaddingLeft?: number;
title?: string;
pt?: number | string;
size?: number;
gridSize?: number;
type?: 'circle' | 'cubes' | 'grid';
type?: 'circle' | 'cubes' | 'grid' | 'wordpress';
}

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

return (
<Grid
alignItems='center'
container
direction='column'
direction={direction}
justifyContent='center'
pt={pt}
>
Expand All @@ -34,6 +37,12 @@ function Progress ({ fontSize = 13, gridSize = 135, pt = '50px', size = 25, titl
size={size}
/>
}
{type === 'wordpress' &&
<Wordpress
color={theme.palette.primary.main}
size={size}
/>
}
{type === 'cubes' &&
<WanderingCubes
color={theme.palette.primary.main}
Expand All @@ -55,7 +64,11 @@ function Progress ({ fontSize = 13, gridSize = 135, pt = '50px', size = 25, titl
{title &&
<Grid
item
sx={{ fontSize, paddingTop: '20px' }}
sx={{
fontSize,
pl: `${titlePaddingLeft}px`,
pt: `${titlePaddingTop}px`
}}
Nick-1979 marked this conversation as resolved.
Show resolved Hide resolved
>
{title}
</Grid>
Expand Down
10 changes: 9 additions & 1 deletion packages/extension-polkagate/src/popup/history/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,15 @@ export default function TransactionHistory (): React.ReactElement {
// staking transaction history is saved locally
tabIndex !== TAB_MAP.STAKING &&
((transfersTx?.hasMore)
? 'loading...'
? <Progress
direction='row'
pt='5px'
size={15}
title={t('Loading...')}
titlePaddingLeft={5}
titlePaddingTop={0}
type='wordpress'
/>
: !!tabHistory?.length &&
<Box fontSize={11}>
{t('No more transactions to load')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,15 @@ export default function HistoryModal ({ address, setDisplayPopup }: Props): Reac
// staking transaction history is saved locally
tabIndex !== TAB_MAP.STAKING &&
((transfersTx?.hasMore)
? 'loading...'
? <Progress
direction='row'
pt='5px'
size={15}
title={t('Loading...')}
titlePaddingLeft={5}
titlePaddingTop={0}
type='wordpress'
/>
: !!tabHistory?.length &&
<Box fontSize={11}>
{t('No more transactions to load')}
Expand Down
Loading