fix: make loading indicator for pools nft card use a shine rather than spinner (#7071)

fix: make loading indicator for pools nft card use a shine rather than spinner and fill the full height
This commit is contained in:
Nate Wienert 2023-08-09 08:14:08 -10:00 committed by GitHub
parent b1c99d4b37
commit f6b66c759a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 13 deletions

@ -9,22 +9,26 @@ export const loadingAnimation = keyframes`
} }
` `
const shimmerMixin = css`
animation: ${loadingAnimation} 1.5s infinite;
animation-fill-mode: both;
background: linear-gradient(
to left,
${({ theme }) => theme.deprecated_bg1} 25%,
${({ theme }) => theme.backgroundInteractive} 50%,
${({ theme }) => theme.deprecated_bg1} 75%
);
background-size: 400%;
will-change: background-position;
`
export const LoadingRows = styled.div` export const LoadingRows = styled.div`
display: grid; display: grid;
& > div { & > div {
animation: ${loadingAnimation} 1.5s infinite; ${shimmerMixin}
animation-fill-mode: both;
background: linear-gradient(
to left,
${({ theme }) => theme.deprecated_bg1} 25%,
${({ theme }) => theme.backgroundInteractive} 50%,
${({ theme }) => theme.deprecated_bg1} 75%
);
background-size: 400%;
border-radius: 12px; border-radius: 12px;
height: 2.4em; height: 2.4em;
will-change: background-position;
} }
` `
@ -37,3 +41,9 @@ export const loadingOpacityMixin = css<{ $loading: boolean }>`
export const LoadingOpacityContainer = styled.div<{ $loading: boolean }>` export const LoadingOpacityContainer = styled.div<{ $loading: boolean }>`
${loadingOpacityMixin} ${loadingOpacityMixin}
` `
export const LoadingFullscreen = styled.div`
${shimmerMixin}
inset: 0;
position: absolute;
`

@ -12,7 +12,7 @@ import { ButtonConfirmed, ButtonGray, ButtonPrimary } from 'components/Button'
import { DarkCard, LightCard } from 'components/Card' import { DarkCard, LightCard } from 'components/Card'
import { AutoColumn } from 'components/Column' import { AutoColumn } from 'components/Column'
import DoubleCurrencyLogo from 'components/DoubleLogo' import DoubleCurrencyLogo from 'components/DoubleLogo'
import Loader from 'components/Icons/LoadingSpinner' import { LoadingFullscreen } from 'components/Loader/styled'
import CurrencyLogo from 'components/Logo/CurrencyLogo' import CurrencyLogo from 'components/Logo/CurrencyLogo'
import { RowBetween, RowFixed } from 'components/Row' import { RowBetween, RowFixed } from 'components/Row'
import { Dots } from 'components/swap/styleds' import { Dots } from 'components/swap/styleds'
@ -716,7 +716,8 @@ function PositionPageContent() {
<ResponsiveRow align="flex-start"> <ResponsiveRow align="flex-start">
<HideSmall <HideSmall
style={{ style={{
marginRight: '12px', height: '100%',
marginRight: 12,
}} }}
> >
{'result' in metadata ? ( {'result' in metadata ? (
@ -744,9 +745,11 @@ function PositionPageContent() {
height="100%" height="100%"
style={{ style={{
minWidth: '340px', minWidth: '340px',
position: 'relative',
overflow: 'hidden',
}} }}
> >
<Loader /> <LoadingFullscreen />
</DarkCard> </DarkCard>
)} )}
</HideSmall> </HideSmall>