Skip to content

Commit

Permalink
Merge branch 'feat/mint-markets' of github.com:curvefi/curve-frontend…
Browse files Browse the repository at this point in the history
… into feat/table-headers
  • Loading branch information
DanielSchiavini committed Jan 29, 2025
2 parents 74d4129 + 242e0d8 commit 6b51949
Show file tree
Hide file tree
Showing 12 changed files with 100 additions and 71 deletions.
53 changes: 0 additions & 53 deletions apps/main/src/loan/components/PageLlamaMarkets/LendTableTitle.tsx

This file was deleted.

2 changes: 0 additions & 2 deletions apps/main/src/loan/components/PageLlamaMarkets/Page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Box from '@mui/material/Box'
import Skeleton from '@mui/material/Skeleton'
import { LendTableTitle } from '@/loan/components/PageLlamaMarkets/LendTableTitle'
import { LendingMarketsTable } from '@/loan/components/PageLlamaMarkets/LendingMarketsTable'
import { LendTableFooter } from '@/loan/components/PageLlamaMarkets/LendTableFooter'
import { invalidateLendingVaults } from '@/loan/entities/lending-vaults'
Expand All @@ -26,7 +25,6 @@ export const PageLlamaMarkets = () => {
return (
<Box sx={{ marginBlockEnd: Spacing.xxl }}>
<DocumentHead title={t`Llamalend Markets`} />
<LendTableTitle />
{data ? (
<LendingMarketsTable onReload={onReload} data={data} headerHeight={headerHeight} />
) : (
Expand Down
17 changes: 13 additions & 4 deletions apps/main/src/pages/dex.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { NextPage } from 'next'
import dynamic from 'next/dynamic'
import { Navigate, Route, Routes } from 'react-router'
import { Navigate, Route, Routes, useParams } from 'react-router'
import { REFRESH_INTERVAL, ROUTE } from '@/dex/constants'
import 'focus-visible'
import { i18n } from '@lingui/core'
Expand Down Expand Up @@ -158,10 +158,19 @@ const App: NextPage = () => {
isPageVisible,
)

/**
* Lazily use useParams() to preserve network parameter during redirects.
* Using Navigate instead of direct component rendering ensures proper
* menu highlighting via isActive state.
*/
const RootRedirect = () => {
const { network } = useParams()
return <Navigate to={`/${network ?? 'ethereum'}/pools`} />
}

const SubRoutes = (
<>
<Route path=":network" element={<PageSwap />} />
<Route path=":network/dashboard" element={<PageDashboard />} />
<Route path=":network" element={<RootRedirect />} />
<Route path=":network/locker" element={<PageLockedCrv />} />
<Route path=":network/locker/:lockedCrvFormType" element={<PageLockedCrv />} />
<Route path=":network/create-pool" element={<PageCreatePool />} />
Expand Down Expand Up @@ -213,7 +222,7 @@ const App: NextPage = () => {
path="/disclaimer"
element={<Navigate to={`/ethereum${ROUTE.PAGE_DISCLAIMER}`} replace />}
/>
<Route path="/" element={<Navigate to={`/ethereum${ROUTE.PAGE_SWAP}`} />} />
<Route path="/" element={<Navigate to={`/ethereum${ROUTE.PAGE_POOLS}`} />} />
<Route path="404" element={<Page404 />} />
<Route path="*" element={<Page404 />} />
</Routes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ export const ConnectWalletPrompt = ({
padding={7}
spacing={8}
width={SizesAndSpaces.MaxWidth.connectWallet}
maxWidth="100%"
maxWidth="90vw"
sx={{
// note: not using mui colors as the color needs to match the background image and we don't have one for chad
backgroundColor: 'var(--table--background-color)',
}}
>
Expand Down
3 changes: 3 additions & 0 deletions packages/external-rewards/src/campaign-list.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,8 @@
},
{
"campaign": "Hourglass.json"
},
{
"campaign": "Fx.json"
}
]
69 changes: 69 additions & 0 deletions packages/external-rewards/src/campaigns/Fx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"campaignName": "",
"platform": "F(x) Protocol",
"description": "External token rewards for providing liquidity.",
"platformImageId": "fx.png",
"dashboardLink": "https://fx.aladdin.club/",
"pools": [
{
"id": "null",
"action": "lp",
"description": "Deposit your Curve LP tokens on f(x) Protocol and earn FXN rewards or on Convex and earn CRV and FXN rewards. For more information please visit f(x) Protocol",
"campaignStart": "0",
"campaignEnd": "1770000000",
"address": "0x5018be882dcce5e3f2f3b0913ae2096b9b3fb61f",
"network": "ethereum",
"multiplier": "FXN",
"tags": ["tokens"],
"lock": "false"
},
{
"id": "null",
"action": "lp",
"description": "Deposit your Curve LP tokens on f(x) Protocol and earn FXN rewards or on Convex and earn CRV and FXN rewards. For more information please visit f(x) Protocol",
"campaignStart": "0",
"campaignEnd": "1770000000",
"address": "0x74345504eaea3d9408fc69ae7eb2d14095643c5b",
"network": "ethereum",
"multiplier": "FXN",
"tags": ["tokens"],
"lock": "false"
},
{
"id": "null",
"action": "lp",
"description": "Deposit your Curve LP tokens on f(x) Protocol and earn FXN rewards or on Convex and earn CRV and FXN rewards. For more information please visit f(x) Protocol",
"campaignStart": "0",
"campaignEnd": "1770000000",
"address": "0x189b4e49b5caf33565095097b4b960f14032c7d0",
"network": "ethereum",
"multiplier": "FXN",
"tags": ["tokens"],
"lock": "false"
},
{
"id": "null",
"action": "lp",
"description": "Deposit your Curve LP tokens on f(x) Protocol and earn FXN rewards or on Convex and earn CRV and FXN rewards. For more information please visit f(x) Protocol",
"campaignStart": "0",
"campaignEnd": "1770000000",
"address": "0xc15f285679a1ef2d25f53d4cbd0265e1d02f2a92",
"network": "ethereum",
"multiplier": "FXN",
"tags": ["tokens"],
"lock": "false"
},
{
"id": "null",
"action": "lp",
"description": "Deposit your Curve LP tokens on f(x) Protocol and earn FXN rewards or on Convex and earn CRV and FXN rewards. For more information please visit f(x) Protocol",
"campaignStart": "0",
"campaignEnd": "1770000000",
"address": "0x8ffc7b89412efd0d17edea2018f6634ea4c2fcb2",
"network": "ethereum",
"multiplier": "FXN",
"tags": ["tokens"],
"lock": "false"
}
]
}
4 changes: 2 additions & 2 deletions packages/external-rewards/src/campaigns/Kelpdao.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"campaignName": "Kelp Miles",
"campaignName": "Kernel Points",
"platform": "Kelp DAO",
"description": "Points for providing liquidity",
"platformImageId": "kelpdao.png",
"platformImageId": "kelpdao-kernels.png",
"dashboardLink": "https://kelpdao.xyz/dashboard/",
"pools": [
{
Expand Down
6 changes: 3 additions & 3 deletions packages/external-rewards/src/campaigns/Usual.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"campaignName": "",
"platform": "Usual",
"description": "Points for providing liquidity.",
"description": "External token rewards for providing liquidity.",
"platformImageId": "usual.png",
"dashboardLink": "https://app.usual.money/",
"pools": [
Expand All @@ -14,7 +14,7 @@
"address": "0x1d08e7adc263cfc70b1babe6dc5bb339c16eec52",
"network": "ethereum",
"multiplier": "usual",
"tags": ["points"],
"tags": ["tokens"],
"lock": "false"
},
{
Expand All @@ -26,7 +26,7 @@
"address": "0x14100f81e33c33ecc7cdac70181fb45b6e78569f",
"network": "ethereum",
"multiplier": "usual",
"tags": ["points"],
"tags": ["tokens"],
"lock": "false"
}
]
Expand Down
2 changes: 2 additions & 0 deletions packages/external-rewards/src/campaigns/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import YieldFi from './YieldFi.json'
import Babylon from './Babylon.json'
import Vnx from './Vnx.json'
import Hourglass from './Hourglass.json'
import Fx from './Fx.json'

export {
DLCLink,
Expand Down Expand Up @@ -56,4 +57,5 @@ export {
Babylon,
Vnx,
Hourglass,
Fx,
}
4 changes: 2 additions & 2 deletions packages/ui/src/CampaignRewards/CampaignRewardsComp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Icon from 'ui/src/Icon'
const RewardsCompSmall: React.FC<CampaignRewardsCompProps> = ({ rewardsPool, highContrast, mobile, banner }) => {
const { platform, multiplier, platformImageSrc } = rewardsPool

const isPoints = rewardsPool.tags.includes('points')
const hasMultiplier = !!multiplier

return (
<Tooltip
Expand All @@ -21,7 +21,7 @@ const RewardsCompSmall: React.FC<CampaignRewardsCompProps> = ({ rewardsPool, hig
>
<Container highContrast={highContrast}>
<TokenIcon src={platformImageSrc} alt={platform} width={16} height={16} />
{isPoints && <Multiplier highContrast={highContrast}>{`${multiplier}`}</Multiplier>}
{hasMultiplier && <Multiplier highContrast={highContrast}>{`${multiplier}`}</Multiplier>}
{rewardsPool.lock && <StyledIcon size={16} name="Locked" $highContrast={highContrast} />}
</Container>
</Tooltip>
Expand Down
6 changes: 3 additions & 3 deletions packages/ui/src/CampaignRewards/TooltipMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ const TooltipMessage = ({ rewardsPool }: { rewardsPool: RewardsPool }) => {
)}
<TooltipParagraph>{getDescription()}</TooltipParagraph>
<TooltipDisclaimer>
Points are project dependent, please check with the token issuer to make sure you have taken all the necessary
actions to earn points.
External rewards are project dependent, always check with the token issuer to make sure you have taken all the
necessary actions to benefit from their rewards program.
</TooltipDisclaimer>
<ExternalLink $noStyles href={dashboardLink}>
Learn more
Go to issuer
</ExternalLink>
</TooltipWrapper>
)
Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/e2e/main/basic.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ describe('Basic Access Test', () => {
;['/', '/dex'].forEach((path) => {
it(`should open the Main DApp successfully at ${path}`, () => {
cy.visit(path)
cy.title().should('include', 'Swap')
cy.title().should('include', 'Pools - Curve')
cy.url().should('include', '/dex')
})
})
Expand Down

0 comments on commit 6b51949

Please sign in to comment.