diff --git a/src/views/discover/components/index/components/index-dtf-table.tsx b/src/views/discover/components/index/components/index-dtf-table.tsx
index 4643277f9..d746e74ef 100644
--- a/src/views/discover/components/index/components/index-dtf-table.tsx
+++ b/src/views/discover/components/index/components/index-dtf-table.tsx
@@ -250,6 +250,9 @@ const IndexDTFTable = ({
: undefined
}
onRowClick={handleRowClick}
+ getRowClassName={(row) =>
+ row.original.status === 'deprecated' ? 'opacity-30' : undefined
+ }
className={cn(
'hidden lg:block',
'[&_table]:bg-card [&_table]:rounded-[20px] [&_table]:text-base',
diff --git a/src/views/discover/components/index/hooks/use-filtered-dtf-index.tsx b/src/views/discover/components/index/hooks/use-filtered-dtf-index.tsx
index abbf37302..78f56fc8d 100644
--- a/src/views/discover/components/index/hooks/use-filtered-dtf-index.tsx
+++ b/src/views/discover/components/index/hooks/use-filtered-dtf-index.tsx
@@ -14,6 +14,10 @@ const useFilteredDTFIndex = () => {
}
const filtered = data.filter((dtf) => {
+ if (!search && dtf.status === 'deprecated') {
+ return false
+ }
+
if (!chains.length || !chains.includes(dtf.chainId)) {
return false
}
diff --git a/src/views/discover/components/yield/components/RTokenCard.tsx b/src/views/discover/components/yield/components/RTokenCard.tsx
index 521b61639..1b341540b 100644
--- a/src/views/discover/components/yield/components/RTokenCard.tsx
+++ b/src/views/discover/components/yield/components/RTokenCard.tsx
@@ -1,3 +1,4 @@
+import { cn } from '@/lib/utils'
import CollateralPieChartWrapper from '@/views/yield-dtf/overview/components/collateral-pie-chart-wrapper'
import RTokenAddresses from '@/views/yield-dtf/overview/components/rtoken-addresses'
import { trackClick } from '@/hooks/useTrackPage'
@@ -20,6 +21,7 @@ import TokenActions from './TokenActions'
interface Props {
token: ListedToken
+ deprecated?: boolean
}
const ChainBadge = ({ chain }: { chain: number }) => (
@@ -47,7 +49,7 @@ const ChainBadge = ({ chain }: { chain: number }) => (
)
// TODO: Component should be splitted
-const RTokenCard = ({ token }: Props) => {
+const RTokenCard = ({ token, deprecated }: Props) => {
const navigate = useNavigate()
const { priceETHTerms, supplyETHTerms } = usePriceETH(token)
@@ -57,7 +59,10 @@ const RTokenCard = ({ token }: Props) => {
return (
{
e.stopPropagation()
trackClick(
diff --git a/src/views/discover/components/yield/components/yield-dtf-list.tsx b/src/views/discover/components/yield/components/yield-dtf-list.tsx
index 4f02f8a98..10e847092 100644
--- a/src/views/discover/components/yield/components/yield-dtf-list.tsx
+++ b/src/views/discover/components/yield/components/yield-dtf-list.tsx
@@ -1,3 +1,4 @@
+import { useDeprecatedAddresses } from '@/hooks/use-dtf-status'
import useTokenList from 'hooks/useTokenList'
import { useAtomValue } from 'jotai'
import { useMemo } from 'react'
@@ -20,9 +21,16 @@ const YieldDTfList = ({ stablecoins = false }: { stablecoins?: boolean }) => {
const chains = useAtomValue(chainsFilterAtom)
const targets = useAtomValue(targetFilterAtom)
const search = useAtomValue(searchFilterAtom)
+ const deprecatedAddresses = useDeprecatedAddresses()
const filteredList = useMemo(() => {
return list.filter((token) => {
+ const isDeprecated = deprecatedAddresses.has(token.id.toLowerCase())
+
+ if (!search && isDeprecated) {
+ return false
+ }
+
if (!chains.length || !chains.includes(token.chain.toString())) {
return false
}
@@ -59,14 +67,18 @@ const YieldDTfList = ({ stablecoins = false }: { stablecoins?: boolean }) => {
return true
})
- }, [list, chains, targets, search, stablecoins])
+ }, [list, chains, targets, search, stablecoins, deprecatedAddresses])
return (
{isLoading && !filteredList.length && }
{filteredList.map((token) => (
-
+
))}
)
diff --git a/src/views/index-dtf/components/navigation/index.tsx b/src/views/index-dtf/components/navigation/index.tsx
index 31372952c..8cf7bea63 100644
--- a/src/views/index-dtf/components/navigation/index.tsx
+++ b/src/views/index-dtf/components/navigation/index.tsx
@@ -2,7 +2,7 @@ import TokenLogo from '@/components/token-logo'
import { Button } from '@/components/ui/button'
import { Separator } from '@/components/ui/separator'
import { cn } from '@/lib/utils'
-import { indexDTFAtom, indexDTFBrandAtom } from '@/state/dtf/atoms'
+import { indexDTFAtom, indexDTFBrandAtom, indexDTFStatusAtom } from '@/state/dtf/atoms'
import { ROUTES } from '@/utils/constants'
import { t } from '@lingui/macro'
import { useAtomValue } from 'jotai'
@@ -105,8 +105,29 @@ const NavigationHeader = () => {
)
}
+const DisabledNavigationItem = ({
+ icon,
+ label,
+}: {
+ icon: React.ReactNode
+ label: string
+}) => {
+ return (
+
+ )
+}
+
+const DISABLED_ROUTES_WHEN_DEPRECATED: string[] = [ROUTES.GOVERNANCE, ROUTES.AUCTIONS]
+
const NavigationItems = () => {
const dtf = useAtomValue(indexDTFAtom)
+ const status = useAtomValue(indexDTFStatusAtom)
+ const isDeprecated = status === 'deprecated'
const items = useMemo(
() => [
@@ -141,9 +162,18 @@ const NavigationItems = () => {
return (
- {items.map((item) => (
-
- ))}
+ {items.map((item) =>
+ isDeprecated &&
+ DISABLED_ROUTES_WHEN_DEPRECATED.includes(item.route) ? (
+
+ ) : (
+
+ )
+ )}
)
}
diff --git a/src/views/index-dtf/index-dtf-container.tsx b/src/views/index-dtf/index-dtf-container.tsx
index 33840e168..88633e5f1 100644
--- a/src/views/index-dtf/index-dtf-container.tsx
+++ b/src/views/index-dtf/index-dtf-container.tsx
@@ -19,10 +19,12 @@ import {
indexDTFExposureDataAtom,
indexDTFPerformanceLoadingAtom,
indexDTFRebalanceControlAtom,
+ indexDTFStatusAtom,
indexDTFVersionAtom,
iTokenAddressAtom,
performanceTimeRangeAtom,
} from '@/state/dtf/atoms'
+import { useDTFStatus } from '@/hooks/use-dtf-status'
import { isAddress } from '@/utils'
import { AvailableChain, supportedChains } from '@/utils/chains'
import { NETWORKS, RESERVE_API, ROUTES } from '@/utils/constants'
@@ -207,8 +209,26 @@ const resetStateAtom = atom(null, (_, set) => {
set(indexDTFPerformanceLoadingAtom, false)
set(indexDTFExposureDataAtom, null)
set(performanceTimeRangeAtom, '7d')
+ set(indexDTFStatusAtom, 'active')
})
+const DeprecationStatusUpdater = ({
+ tokenAddress,
+ chainId,
+}: {
+ tokenAddress?: string
+ chainId: number
+}) => {
+ const status = useDTFStatus(tokenAddress, chainId)
+ const setStatus = useSetAtom(indexDTFStatusAtom)
+
+ useEffect(() => {
+ setStatus(status)
+ }, [status])
+
+ return null
+}
+
export const indexDTFRefreshFnAtom = atom<(() => void) | null>(null)
// TODO: Hook currently re-renders a lot because of a wagmi bug, different component to avoid tree re-renders
@@ -280,6 +300,7 @@ const Updater = () => {
+
)
diff --git a/src/views/index-dtf/issuance/index.tsx b/src/views/index-dtf/issuance/index.tsx
index d9968a014..e1d3a50c8 100644
--- a/src/views/index-dtf/issuance/index.tsx
+++ b/src/views/index-dtf/issuance/index.tsx
@@ -1,6 +1,6 @@
import { devModeAtom } from '@/state/atoms'
import { wagmiConfig } from '@/state/chain'
-import { indexDTFAtom } from '@/state/dtf/atoms'
+import { indexDTFAtom, indexDTFStatusAtom } from '@/state/dtf/atoms'
import { RESERVE_API } from '@/utils/constants'
import { useZapperModal, ZapperProps } from '@reserve-protocol/react-zapper'
import { atom, useAtomValue } from 'jotai'
@@ -28,6 +28,7 @@ const IndexDTFIssuance = () => {
const indexDTF = useAtomValue(indexDTFAtom)
const quoteSource = useAtomValue(indexDTFQuoteSourceAtom)
const devMode = useAtomValue(devModeAtom)
+ const isDeprecated = useAtomValue(indexDTFStatusAtom) === 'deprecated'
const { currentTab } = useZapperModal()
const { trackClick } = useTrackIndexDTFClick('overview', 'mint')
@@ -46,6 +47,7 @@ const IndexDTFIssuance = () => {
apiUrl={RESERVE_API}
debug={devMode}
defaultSource={quoteSource}
+ sellOnly={isDeprecated}
/>