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

feat: New syrup pool cards #874

Merged
Merged
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
6e5bc69
feat(syrup-pool-v2): Update PageHeader and TabButtons
ChefHutch Apr 13, 2021
a72465a
feat(syrup-pool-v2): Reorg component structure and add new styledCard…
ChefHutch Apr 13, 2021
3efb72d
feat(syrup-pool-v2): Yeet some sheet
ChefHutch Apr 13, 2021
b99f8fa
feat(syrup-pool-v2): Add finished sash and handle finished state of c…
ChefHutch Apr 13, 2021
70ca891
feat(syrup-pool-v2): Create APR row comp
ChefHutch Apr 13, 2021
8292e86
Merge branch 'develop' into feature/syrup-pool-new-cards
ChefHutch Apr 14, 2021
ee5a35e
feat(syrup-pool-v2): Tidy up & restyling of footer
ChefHutch Apr 14, 2021
f5c1e51
fix(syrup-pool-v2): Fix merge conflicts
ChefHutch Apr 19, 2021
e5f7df2
feat(syrup-pool-v2): Finish up various footer comps
ChefHutch Apr 19, 2021
a82d259
feat(syrup-pool-v2): Upgrade ApyCalculatorModal to handle different e…
ChefHutch Apr 19, 2021
affa828
feat(syrup-pool-v2): Loading states for footer and APR
ChefHutch Apr 19, 2021
215f482
Merge branch 'develop' into feature/syrup-pool-new-cards
ChefHutch Apr 20, 2021
3cdb0b9
fix(syrup-pool-v2): Fix merge conflicts
ChefHutch Apr 20, 2021
8b69e2f
fix(syrup-pool-v2): Fix lint error
ChefHutch Apr 20, 2021
1ce5132
chore(syrup-pool-v2): Break CardActions into its own component and re…
ChefHutch Apr 20, 2021
c188ea3
feat(syrup-pool-v2): Create separate Staking / HarvestActions comps
ChefHutch Apr 20, 2021
32adaa8
feat(syrup-pool-v2): Approval and Staking actions
ChefHutch Apr 20, 2021
9f30bfc
Merge branch 'develop' into feature/syrup-pool-new-cards
ChefHutch Apr 21, 2021
55bb60b
feat(pool-stake-modal): Basics of stake modal laid out
ChefHutch Apr 21, 2021
41a6b0d
feat(syrup-pool-v2): Styling of cards and improvements to error repor…
ChefHutch Apr 21, 2021
057967b
feat(syrup-pool-v2): Add proper USD calculation
ChefHutch Apr 21, 2021
886c428
Merge branch 'develop' of https://github.com/pancakeswap/pancake-fron…
ChefHutch Apr 22, 2021
40846f1
feat(syrup-pool-v2): Adding unstaking buttons and rough modal operations
ChefHutch Apr 22, 2021
fcbb1e4
feat(syrup-pool-v2): Refactor footer for performance and add HarvestA…
ChefHutch Apr 22, 2021
43044fa
feat(syrup-pool-v2): Basic harvest modal and functionality added
ChefHutch Apr 22, 2021
278ed66
feat(syrup-pool-v2): Styling fixes and pass account down from pool view
ChefHutch Apr 22, 2021
40922fd
feat(syrup-pool-v2): Styling and tooltip for compounding modal
ChefHutch Apr 22, 2021
c81e054
feat(syrup-pool-v2): Finish compounding modal
ChefHutch Apr 22, 2021
db54948
feat(syrup-pool-v2): Style for promoted pool (& cake) and organising …
ChefHutch Apr 22, 2021
d8d575e
fix(syrup-pool-v2): Fix merge conflicts
ChefHutch Apr 23, 2021
1d918dc
feat(syrup-pool-v2): Massive proptypes tidy up
ChefHutch Apr 23, 2021
c7eb515
chore(syrup-pool-v2): Del unused SVG
ChefHutch Apr 23, 2021
a8be471
Merge branch 'develop' of https://github.com/pancakeswap/pancake-fron…
ChefHutch Apr 24, 2021
9b56b02
feat(syrup-pool-v2): Add loading states for different card elements
ChefHutch Apr 24, 2021
7b7ec7b
feat(syrup-pool-v2): Add bunny img
ChefHutch Apr 24, 2021
df92291
feat(syrup-pool-v2): Fix high price token showing 0% APR
ChefHutch Apr 24, 2021
b5e02c9
chore(syrup-pool-v2): Cleanup white space
ChefHutch Apr 24, 2021
1d4806f
chore(syrup-pool-v2): Re-add usePersistState
ChefHutch Apr 24, 2021
8890e77
chore(syrup-pool-v2): Add comments to help
ChefHutch Apr 24, 2021
2fb7cc7
Merge branch 'develop' into feature/syrup-pool-new-cards
ChefHutch Apr 26, 2021
6130692
chore(syrup-pool-v2): Remove unused components
ChefHutch Apr 26, 2021
2791d21
Merge branch 'develop' of https://github.com/pancakeswap/pancake-fron…
ChefHutch Apr 27, 2021
49daf7c
fix(syrup-pool-v2): Fix useToast
ChefHutch Apr 27, 2021
db1d8dd
feat(syrup-pool-v2): Move help to pooltabbuttons bar
ChefHutch Apr 27, 2021
9fe4356
feat(syrup-pool-v2): Disabled button when stakeAmount is zero or unset
ChefHutch Apr 28, 2021
6475897
Merge branch 'develop' of https://github.com/pancakeswap/pancake-fron…
ChefHutch Apr 28, 2021
dbd1706
Merge branch 'develop' of https://github.com/pancakeswap/pancake-fron…
ChefHutch Apr 28, 2021
dfa6bc5
fix(pool-cards-v2): Amendments based on Doge's CR comments
ChefHutch Apr 28, 2021
0097dcc
fix(pool-cards-v2): Proper finished handling on staking actions
ChefHutch Apr 28, 2021
91f9de5
fix(pool-cards-v2): Follow up CR comments
ChefHutch Apr 29, 2021
7cc8518
feat(syrup-pool-v2): Add new uikit version
ChefHutch Apr 29, 2021
6799004
Merge branch 'develop' of https://github.com/pancakeswap/pancake-fron…
ChefHutch Apr 29, 2021
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
Prev Previous commit
Next Next commit
feat(syrup-pool-v2): Move help to pooltabbuttons bar
ChefHutch committed Apr 27, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit db1d8dd0d8f5401a7f0d241221b6f30a2bebe772
62 changes: 47 additions & 15 deletions src/views/Pools/components/PoolTabButtons.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,61 @@
import React from 'react'
import styled from 'styled-components'
import { useRouteMatch, Link } from 'react-router-dom'
import { ButtonMenu, ButtonMenuItem, Toggle, Text, Flex, NotificationDot } from '@pancakeswap-libs/uikit'
import {
ButtonMenu,
ButtonMenuItem,
Button,
HelpIcon,
Toggle,
Text,
Flex,
NotificationDot,
} from '@pancakeswap-libs/uikit'
import useI18n from 'hooks/useI18n'

const ButtonText = styled(Text)`
display: none;
${({ theme }) => theme.mediaQueries.lg} {
display: block;
}
`

const PoolTabButtons = ({ stakedOnly, setStakedOnly, hasStakeInFinishedPools }) => {
const { url, isExact } = useRouteMatch()
const TranslateString = useI18n()

return (
<Flex alignItems="center" justifyContent="center" mb="32px">
<ButtonMenu activeIndex={isExact ? 0 : 1} scale="sm" variant="subtle">
<ButtonMenuItem as={Link} to={`${url}`}>
{TranslateString(1198, 'Live')}
</ButtonMenuItem>
<NotificationDot show={hasStakeInFinishedPools}>
<ButtonMenuItem as={Link} to={`${url}/history`}>
{TranslateString(388, 'Finished')}
<Flex alignItems="center">
<ButtonMenu activeIndex={isExact ? 0 : 1} scale="sm" variant="subtle">
<ButtonMenuItem as={Link} to={`${url}`}>
{TranslateString(1198, 'Live')}
</ButtonMenuItem>
</NotificationDot>
</ButtonMenu>
<Flex ml="24px" justifyContent="center" alignItems="center">
<Toggle scale="sm" checked={stakedOnly} onChange={() => setStakedOnly(!stakedOnly)} />
<Text ml="8px" color={`${stakedOnly ? 'body' : 'textDisabled'}`}>
{TranslateString(999, 'Staked only')}
</Text>
<NotificationDot show={hasStakeInFinishedPools}>
<ButtonMenuItem as={Link} to={`${url}/history`}>
{TranslateString(388, 'Finished')}
</ButtonMenuItem>
</NotificationDot>
</ButtonMenu>
<Flex ml="24px" justifyContent="center" alignItems="center">
<Toggle scale="sm" checked={stakedOnly} onChange={() => setStakedOnly(!stakedOnly)} />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

() => setStakedOnly(!stakedOnly) is absolutely forbidden !!
(prev) => setStakedOnly(!prev)

<Text ml="8px" color={`${stakedOnly ? 'body' : 'textDisabled'}`}>
{TranslateString(999, 'Staked only')}
</Text>
</Flex>
</Flex>
<Flex ml="24px" alignItems="center" justifyContent="flex-end">
<Button
px={['14px', null, null, null, '20px']}
variant="subtle"
as="a"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link, with external props

href="https://docs.pancakeswap.finance/syrup-pools/syrup-pool"
>
<ButtonText color="backgroundAlt" bold fontSize="16px">
{TranslateString(999, 'Help')}
</ButtonText>
<HelpIcon color="backgroundAlt" ml={[null, null, null, 0, '6px']} />
</Button>
</Flex>
</Flex>
)
21 changes: 1 addition & 20 deletions src/views/Pools/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React, { useMemo } from 'react'
import { Route, useRouteMatch } from 'react-router-dom'
import BigNumber from 'bignumber.js'
import styled from 'styled-components'
import { useWeb3React } from '@web3-react/core'
import { Heading, Flex, Button, HelpIcon, Text, Image } from '@pancakeswap-libs/uikit'
import { Heading, Flex, Image } from '@pancakeswap-libs/uikit'
import orderBy from 'lodash/orderBy'
import partition from 'lodash/partition'
import useI18n from 'hooks/useI18n'
@@ -15,13 +14,6 @@ import PageHeader from 'components/PageHeader'
import PoolCard from './components/PoolCard'
import PoolTabButtons from './components/PoolTabButtons'

const ButtonText = styled(Text)`
display: none;
${({ theme }) => theme.mediaQueries.lg} {
display: block;
}
`

const Pools: React.FC = () => {
const { path } = useRouteMatch()
const TranslateString = useI18n()
@@ -58,17 +50,6 @@ const Pools: React.FC = () => {
{TranslateString(999, 'High APR, low risk.')}
</Heading>
</Flex>
<Button
px={['14px', null, null, null, '24px']}
variant="subtle"
as="a"
href="https://docs.pancakeswap.finance/syrup-pools/syrup-pool"
>
<ButtonText color="backgroundAlt" bold fontSize="16px">
{TranslateString(999, 'Help')}
</ButtonText>
<HelpIcon color="backgroundAlt" ml={[null, null, null, 0, '6px']} />
</Button>
</Flex>
</PageHeader>
<Page>