Skip to content

Commit

Permalink
fix: CR-624
Browse files Browse the repository at this point in the history
  • Loading branch information
viet-nv committed Oct 9, 2023
1 parent 7194085 commit 7f1f39f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
12 changes: 10 additions & 2 deletions src/components/ClassicElasticTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,18 @@ function ClassicElasticTab() {

const upToMedium = useMedia(`(max-width: ${MEDIA_WIDTHS.upToMedium}px)`)

const showLegacyExplicit = upToMedium ? false : isFarmpage ? shouldShowFarmTab : shouldShowPositionTab

const dontShowLegacy = [ChainId.ZKEVM, ChainId.BASE, ChainId.LINEA].includes(chainId)

const showLegacyExplicit =
upToMedium || dontShowLegacy ? false : isFarmpage ? shouldShowFarmTab : shouldShowPositionTab

useEffect(() => {
if (dontShowLegacy && tab === VERSION.ELASTIC_LEGACY) {
const newQs = { ...qs, tab: VERSION.ELASTIC }
navigate({ search: stringify(newQs) }, { replace: true })
}
}, [tab, dontShowLegacy, navigate, qs])

const legacyTag = (small?: boolean) => (
<Text
sx={{
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ElasticLegacy/FarmLegacy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export default function FarmLegacy({
}
}

const farmContract = useProMMFarmContract(config[chainId].farmContract || '')
const farmContract = useProMMFarmContract(config[chainId]?.farmContract || '')

const handleWithdraw = async () => {
setShowConfirmModal('withdraw')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ const PositionView: React.FC<CommonProps> = props => {
}
/>
) : (
<Value>--</Value>
<Value>$0</Value>
)}
</Row>
</Column>
Expand Down Expand Up @@ -315,10 +315,12 @@ const PositionView: React.FC<CommonProps> = props => {
<Text as="span" fontSize="16px" fontWeight={500} lineHeight={'20px'}>
{+positionEarning.pendingRewardUSD
? formatDisplayNumber(positionEarning.pendingRewardUSD, { style: 'currency', significantDigits: 6 })
: farmRewards?.length
? '$0'
: '--'}
</Text>
}
disabled={!+positionEarning.pendingRewardUSD}
disabled={disabledHarvest}
text={
<>
{farmRewards?.map((rw, index) => (
Expand Down

0 comments on commit 7f1f39f

Please sign in to comment.