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

Earn page react-loading-skeleton #581

Merged
merged 8 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
1 change: 1 addition & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import Bolts from './containers/Bolts'
import { Fuul } from '@fuul/sdk'
import EarnDetails from './containers/Earn/EarnDetails'
import Marketplace from './containers/Marketplace'
import 'react-loading-skeleton/dist/skeleton.css'

Sentry.init({
dsn: process.env.REACT_APP_SENTRY_DSN,
Expand Down
4 changes: 3 additions & 1 deletion src/containers/Earn/PoolBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export default PoolBlock

const BlockContainer = styled.div`
border-radius: 4px;
margin-bottom: 29px;
background: white;
box-shadow: 0px 4px 6px 0px #0d4b9d33;
position: relative;
Expand All @@ -71,6 +70,9 @@ const BlockContainer = styled.div`
&.empty {
background: white;
}
&:not(:last-child) {
margin-bottom: 29px;
}
`

const BlockHeader = styled.div`
Expand Down
9 changes: 6 additions & 3 deletions src/containers/Earn/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { useStoreActions, useStoreState } from '~/store'
import { useActiveWeb3React } from '~/hooks'
import { useEffect, useMemo, useState } from 'react'
import useGeb from '~/hooks/useGeb'
import Loader from '~/components/Loader'
import Button from '~/components/Button'
import { ExternalLink } from 'react-feather'
import { POOLS } from '~/utils'
import PoolBlock from './PoolBlock'
import { JSX } from 'react/jsx-runtime'
import { PoolData } from '@opendollar/sdk'
import Skeleton from 'react-loading-skeleton'

interface Cache {
[key: string]: PoolData
Expand Down Expand Up @@ -91,9 +91,10 @@ const Earn = () => {
) => <PoolBlock {...pool} nitroPoolData={nitroPools[i]} key={`${pool.nitroPoolAddress}-pool`} />
)
) : (
<Loader width="50px" color="#1A74EC" />
<Skeleton height={50} count={2} baseColor={'#89B3FB'} highlightColor="#2871FD" />
)}
</Pools>

<BtnWrapper>
<Button data-test-id="steps-btn" id={'suggest-pool-btn'} secondary onClick={handleClick}>
suggest a new pool <ExternalLink />
Expand Down Expand Up @@ -157,7 +158,9 @@ const PoolsHeader = styled.h2`
margin-bottom: 20px;
`

const Pools = styled.div``
const Pools = styled.div`
margin-bottom: 30px;
`

const BtnWrapper = styled.div`
width: max-content;
Expand Down
Loading
Loading