Skip to content

Commit 2fec0a2

Browse files
authored
Feat watchlist notifications (#2276)
* Revert "Stash away portfolio notifications components" This reverts commit 34138ed. * wip * Switch to form controls * WIP * cleanup * cleanup * Updates * minor updates
1 parent 5032e82 commit 2fec0a2

File tree

11 files changed

+921
-33
lines changed

11 files changed

+921
-33
lines changed

public/icons/v25.svg renamed to public/icons/v26.svg

Lines changed: 3 additions & 0 deletions
Loading

src/components/Bookmark.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Link from 'next/link'
22
import { useRouter } from 'next/router'
33
import toast from 'react-hot-toast'
44
import { Icon } from '~/components/Icon'
5-
import { useWatchlistManager } from '~/contexts/LocalStorage'
5+
import { useBookmarks } from '~/hooks/useBookmarks'
66

77
interface IBookmarkProps {
88
readableName: string
@@ -15,7 +15,7 @@ export function Bookmark({ readableName, isChain, ...props }: IBookmarkProps) {
1515

1616
const watchlistType = isChain ? 'chains' : router.pathname.includes('/yields') ? 'yields' : 'defi'
1717

18-
const { savedProtocols, addProtocol, removeProtocol } = useWatchlistManager(watchlistType)
18+
const { savedProtocols, addProtocol, removeProtocol } = useBookmarks(watchlistType)
1919

2020
const isSaved: boolean = savedProtocols.has(readableName)
2121

src/components/Icon.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,15 @@ type Name =
9292
| 'layout-grid'
9393
| 'arrow-down'
9494
| 'share'
95+
| 'pause'
9596

9697
export interface IIcon extends SVGProps<SVGSVGElement> {
9798
name: Name
9899
}
99100
export const Icon = memo(function Icon({ name, ...props }: IIcon) {
100101
return (
101102
<svg {...props}>
102-
<use href={`/icons/v25.svg#${name}`} />
103+
<use href={`/icons/v26.svg#${name}`} />
103104
</svg>
104105
)
105106
})
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
export const protocolMetrics = [
2+
{ key: 'tvl', name: 'TVL' },
3+
{ key: 'volume', name: 'Volume' },
4+
{ key: 'perp_volume', name: 'Perps Volume' },
5+
{ key: 'fees', name: 'Fees' },
6+
{ key: 'revenue', name: 'Revenue' },
7+
{ key: 'mcap', name: 'Market Cap' },
8+
{ key: 'price', name: 'Price' },
9+
{ key: 'fdv', name: 'FDV' },
10+
{ key: 'outstanding_fdv', name: 'Outstanding FDV' }
11+
]
12+
13+
export const chainMetrics = [
14+
{ key: 'tvl', name: 'TVL' },
15+
{ key: 'volume', name: 'Volume' },
16+
{ key: 'perp_volume', name: 'Perps Volume' },
17+
{ key: 'fees', name: 'Fees' },
18+
{ key: 'revenue', name: 'Revenue' },
19+
{ key: 'mcap', name: 'Market Cap' },
20+
{ key: 'price', name: 'Price' },
21+
{ key: 'fdv', name: 'FDV' },
22+
{ key: 'inflows', name: 'Inflows' },
23+
{ key: 'stablecoins', name: 'Stablecoins' },
24+
{ key: 'bridge_volume', name: 'Bridge Volume' }
25+
]

0 commit comments

Comments
 (0)