Skip to content

Commit

Permalink
chore: defiedge warning on position manager (#10784)
Browse files Browse the repository at this point in the history
<!--
Before opening a pull request, please read the [contributing
guidelines](https://github.com/pancakeswap/pancake-frontend/blob/develop/CONTRIBUTING.md)
first
-->


<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on updating the localization strings and enhancing the
`Header` component in the web application. It introduces a new warning
message related to DeFiEdge vault maintenance and modifies the rendering
logic to display this warning based on specific chain IDs.

### Detailed summary
- Removed the entry for `PancakeSwap Workshop` from `translations.json`.
- Added a new warning message in `translations.json` regarding DeFiEdge
vault maintenance.
- Introduced `DIFI_EDGE_CHAINS` constant in `Header.tsx` to define
relevant chain IDs.
- Modified the rendering logic in `Header` to display `DefiEdgeWarning`
if the current chain ID is in `DIFI_EDGE_CHAINS`, otherwise displays
`BCakeMigrationBanner`.
- Added a new `DefiEdgeWarning` component to display the warning
message.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
  • Loading branch information
Chef-Yogi authored Oct 4, 2024
1 parent f2a8df3 commit 3f9ec28
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
24 changes: 22 additions & 2 deletions apps/web/src/views/PositionManagers/components/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { bCakeSupportedChainId } from '@pancakeswap/farms'
import { useTranslation } from '@pancakeswap/localization'
import { Box, Flex, Heading, PageHeader, useMatchBreakpoints } from '@pancakeswap/uikit'
import { ChainId } from '@pancakeswap/sdk'
import { Box, Flex, Heading, Message, MessageText, PageHeader, Text, useMatchBreakpoints } from '@pancakeswap/uikit'
import useActiveWeb3React from 'hooks/useActiveWeb3React'
import { memo } from 'react'
import { BCakeBoosterCard } from 'views/Farms/components/YieldBooster/components/bCakeV3/BCakeBoosterCard'
import { BCakeMigrationBanner } from 'views/Home/components/Banners/BCakeMigrationBanner'

const DIFI_EDGE_CHAINS = [ChainId.BSC, ChainId.ARBITRUM_ONE, ChainId.ZKSYNC, ChainId.BASE]

export const Header = memo(function Header() {
const { t } = useTranslation()
const { isDesktop } = useMatchBreakpoints()
Expand All @@ -14,7 +17,7 @@ export const Header = memo(function Header() {
return (
<PageHeader>
<Box mb="32px" mt="16px">
<BCakeMigrationBanner />
{DIFI_EDGE_CHAINS.includes(chainId) ? <DefiEdgeWarning /> : <BCakeMigrationBanner />}
</Box>
<Flex justifyContent="space-between" flexDirection={['column', null, null, 'row']}>
<Flex
Expand All @@ -36,3 +39,20 @@ export const Header = memo(function Header() {
</PageHeader>
)
})

export const DefiEdgeWarning = () => {
const { t } = useTranslation()
return (
<Box maxWidth="1200px" m="0 auto">
<Message variant="warning">
<MessageText fontSize="17px">
<Text color="warning" as="span" bold>
{t(
'DeFiEdge will stop maintaining its vaults from 10 Oct 2024 onwards. Please remove your funds before that to avoid any issues. Beyond 10 Oct, they will place the liquidity in a wide range, and will no longer actively manage it.',
)}
</Text>
</MessageText>
</Message>
</Box>
)
}
3 changes: 2 additions & 1 deletion packages/localization/src/config/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -3546,5 +3546,6 @@
"Play": "Play",
"Legacy products": "Legacy products",
"Nigeria": "Nigeria",
"PancakeSwap Workshop": "PancakeSwap Workshop"
"PancakeSwap Workshop": "PancakeSwap Workshop",
"DeFiEdge will stop maintaining its vaults from 10 Oct 2024 onwards. Please remove your funds before that to avoid any issues. Beyond 10 Oct, they will place the liquidity in a wide range, and will no longer actively manage it.": "DeFiEdge will stop maintaining its vaults from 10 Oct 2024 onwards. Please remove your funds before that to avoid any issues. Beyond 10 Oct, they will place the liquidity in a wide range, and will no longer actively manage it."
}

0 comments on commit 3f9ec28

Please sign in to comment.