Skip to content

Commit

Permalink
Merge branch 'main' into e2e-test-report
Browse files Browse the repository at this point in the history
  • Loading branch information
ltthienn authored Sep 20, 2023
2 parents 078fde4 + 23a3f00 commit 2762eb7
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 8 deletions.
16 changes: 16 additions & 0 deletions src/assets/svg/partner-farm.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/components/YieldPools/ElasticFarmGroup/FarmCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { Swap as SwapIcon } from 'components/Icons'
import Harvest from 'components/Icons/Harvest'
import InfoHelper from 'components/InfoHelper'
import { MouseoverTooltip } from 'components/Tooltip'
import { PartnerFarmTag } from 'components/YieldPools/PartnerFarmTag'
import { APP_PATHS, ELASTIC_BASE_FEE_UNIT } from 'constants/index'
import { TOBE_EXTENDED_FARMING_POOLS } from 'constants/v2'
import { useActiveWeb3React } from 'hooks'
Expand Down Expand Up @@ -125,6 +126,7 @@ const FarmCard = ({
</Link>

<FeeTag style={{ fontSize: '12px' }}>FEE {(pool.pool.fee * 100) / ELASTIC_BASE_FEE_UNIT}%</FeeTag>
<PartnerFarmTag farmPoolAddress={pool.poolAddress} />
</Flex>

<Flex sx={{ gap: '4px' }}>
Expand Down
7 changes: 5 additions & 2 deletions src/components/YieldPools/ElasticFarmGroup/Row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { MoneyBag, Swap2 as SwapIcon } from 'components/Icons'
import Harvest from 'components/Icons/Harvest'
import InfoHelper from 'components/InfoHelper'
import { MouseoverTooltip, MouseoverTooltipDesktopOnly } from 'components/Tooltip'
import { PartnerFarmTag } from 'components/YieldPools/PartnerFarmTag'
import { APP_PATHS, ELASTIC_BASE_FEE_UNIT } from 'constants/index'
import { TOBE_EXTENDED_FARMING_POOLS } from 'constants/v2'
import { useActiveWeb3React } from 'hooks'
Expand Down Expand Up @@ -337,8 +338,10 @@ const Row = ({
</MouseoverTooltip>
</Link>
</Text>

<FeeTag>FEE {(farmingPool.pool.fee * 100) / ELASTIC_BASE_FEE_UNIT}%</FeeTag>
<Flex flexDirection="column" sx={{ gap: '8px' }}>
<FeeTag>FEE {(farmingPool.pool.fee * 100) / ELASTIC_BASE_FEE_UNIT}%</FeeTag>
<PartnerFarmTag farmPoolAddress={farmingPool.poolAddress} />
</Flex>
</Flex>

<Flex
Expand Down
39 changes: 39 additions & 0 deletions src/components/YieldPools/PartnerFarmTag.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { Trans } from '@lingui/macro'

import { ReactComponent as PartnerFarmSvg } from 'assets/svg/partner-farm.svg'
import { MouseoverTooltip } from 'components/Tooltip'
import { FeeTag } from 'components/YieldPools/ElasticFarmGroup/styleds'
import { FRAX_FARMS } from 'constants/index'
import { useActiveWeb3React } from 'hooks'
import { ExternalLink } from 'theme'

export const PartnerFarmTag = ({ farmPoolAddress }: { farmPoolAddress: string }) => {
const { chainId } = useActiveWeb3React()
const isFraxFarm = FRAX_FARMS[chainId]?.map(address => address.toLowerCase()).includes(farmPoolAddress.toLowerCase())
if (!isFraxFarm) return null

return (
<div style={{ cursor: 'pointer' }}>
<MouseoverTooltip
text={
<Trans>
KyberSwap Frax farms do not currently receive KNC incentives. They are continuously available for staking so
that users can participate in KyberSwap Frax gauges to earn FXS emissions. The amount of FXS emissions
depends on the results of each weekly Frax gauge voting cycle. More info:{' '}
<ExternalLink href="https://app.frax.finance/gauge">https://app.frax.finance/gauge</ExternalLink> and{' '}
<ExternalLink href="https://docs.frax.finance/vefxs/gauge">
https://docs.frax.finance/vefxs/gauge
</ExternalLink>
</Trans>
}
placement="top"
width="300px"
>
<FeeTag>
<PartnerFarmSvg />
Partner Farm
</FeeTag>
</MouseoverTooltip>
</div>
)
}
4 changes: 2 additions & 2 deletions src/components/YieldPools/styleds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export const TableHeader = styled.div<{ fade?: boolean; oddRow?: boolean }>`

export const ProMMFarmTableHeader = styled(TableHeader)`
padding: 16px;
grid-template-columns: 230px 0.5fr 0.5fr 1fr 1fr 0.75fr 120px;
grid-template-columns: 280px 0.5fr 0.5fr 1fr 1fr 0.75fr 120px;
grid-template-areas: 'token_pairs staked_tvl apr ending_in my_deposit reward action';
grid-gap: 2rem;
Expand All @@ -215,7 +215,7 @@ export const ProMMFarmTableHeader = styled(TableHeader)`
background-color: ${({ theme }) => theme.buttonGray};
${({ theme }) => theme.mediaWidth.upToLarge`
grid-template-columns: 170px 0.5fr 0.75fr 1fr 1fr 0.75fr 120px;
grid-template-columns: 250px 0.5fr 0.75fr 1fr 1fr 0.75fr 120px;
grid-gap: 1rem;
`};
`
Expand Down
11 changes: 11 additions & 0 deletions src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,3 +380,14 @@ export const ICON_IDS = [
'discord',
] as const
export type ICON_ID = typeof ICON_IDS[number]

export const FRAX_FARMS: { [chainId in ChainId]?: string[] } = {
[ChainId.MAINNET]: [
'0xe5379f5ee90d70a0f9de0ed8b3cdde3b9427524a',
'0xfd7b111aa83b9b6f547e617c7601efd997f64703',
'0x36240069ff26cecbde04d9e49a2af8d39146263e',
],
[ChainId.MATIC]: ['0xa5ebdde0f2e657d77bebeda085dd49f6decf8504'],
[ChainId.ARBITRUM]: ['0x6a7dccf168fba624a81b293c2538d31427b5b4bd'],
[ChainId.OPTIMISM]: ['0xa837d04a64acf66912d05cfd9b951e4e399ab680'],
}
11 changes: 7 additions & 4 deletions src/pages/Farm/ElasticFarmv2/components/FarmCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { MouseoverTooltip } from 'components/Tooltip'
import TransactionConfirmationModal, { TransactionErrorContent } from 'components/TransactionConfirmationModal'
import { FeeTag } from 'components/YieldPools/ElasticFarmGroup/styleds'
import { APRTooltipContent } from 'components/YieldPools/FarmingPoolAPRCell'
import { PartnerFarmTag } from 'components/YieldPools/PartnerFarmTag'
import { APP_PATHS, ELASTIC_BASE_FEE_UNIT } from 'constants/index'
import { useActiveWeb3React } from 'hooks'
import useTheme from 'hooks/useTheme'
Expand Down Expand Up @@ -229,10 +230,12 @@ function FarmCard({
<Share2 size={14} fill="currentcolor" />
</IconButton>
</RowFit>

<FeeTag style={{ marginLeft: 0 }}>
FEE {farm?.pool?.fee ? (farm?.pool?.fee * 100) / ELASTIC_BASE_FEE_UNIT : 0.03}%
</FeeTag>
<Flex flexDirection="row">
<FeeTag style={{ marginLeft: 0 }}>
FEE {farm?.pool?.fee ? (farm?.pool?.fee * 100) / ELASTIC_BASE_FEE_UNIT : 0.03}%
</FeeTag>
<PartnerFarmTag farmPoolAddress={farm.poolAddress} />
</Flex>
</Flex>

<DoubleCurrencyLogo size={44} currency0={farm.token0} currency1={farm.token1} />
Expand Down
2 changes: 2 additions & 0 deletions src/pages/Farm/ElasticFarmv2/components/ListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { MouseoverTooltip, MouseoverTooltipDesktopOnly } from 'components/Toolti
import TransactionConfirmationModal, { TransactionErrorContent } from 'components/TransactionConfirmationModal'
import { ButtonColorScheme, MinimalActionButton } from 'components/YieldPools/ElasticFarmGroup/buttons'
import { FeeTag } from 'components/YieldPools/ElasticFarmGroup/styleds'
import { PartnerFarmTag } from 'components/YieldPools/PartnerFarmTag'
import { ElasticFarmV2TableRow } from 'components/YieldPools/styleds'
import { APP_PATHS, ELASTIC_BASE_FEE_UNIT } from 'constants/index'
import { useActiveWeb3React } from 'hooks'
Expand Down Expand Up @@ -191,6 +192,7 @@ export const ListView = ({
>
<Share2 size="14px" color={theme.subText} />
</Flex>
<PartnerFarmTag farmPoolAddress={farm.poolAddress} />
</Flex>

<Flex sx={{ gap: '8px' }} alignItems="center">
Expand Down

0 comments on commit 2762eb7

Please sign in to comment.