Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
fb70482
feat(ui): ✨ add collapsible sidebar navigation system
thebeyondr Oct 6, 2025
5a55207
feat(nav): 🎨 redesign navigation with grouped structure
thebeyondr Oct 6, 2025
5316cac
feat(nav): 🔄 update desktop navigation with new design
thebeyondr Oct 6, 2025
26034cf
feat(nav): 📱 update mobile navigation structure
thebeyondr Oct 6, 2025
8d1bec8
feat(metrics): 🎯 improve metrics component design
thebeyondr Oct 6, 2025
2d9439e
feat(assets): 🖼️ add new logo variants and icons
thebeyondr Oct 6, 2025
acdad59
feat(config): 📋 update navigation structure and tooltip styling
thebeyondr Oct 6, 2025
02548f4
refactor: 🧹 clean up unused imports and components
thebeyondr Oct 6, 2025
fb492c5
feat(ui): ✨ add collapsible sidebar navigation system
thebeyondr Oct 6, 2025
e44ede4
Merge branch 'main' into feat/nav
thebeyondr Oct 6, 2025
f44e0f1
fix(nav): 🛠️ refine DesktopNav component layout
thebeyondr Oct 7, 2025
f5947c7
refactor(nav): 🧹 simplify DesktopNav component structure
thebeyondr Oct 9, 2025
ad630c5
refactor(nav): improve NavGroup layout and accessibility
thebeyondr Oct 9, 2025
989e131
feat(nav): add Metrics, Account, and Custom Dashboards links
thebeyondr Oct 9, 2025
6bab5ff
refactor(nav): streamline DesktopNav component and enhance layout
thebeyondr Oct 9, 2025
743a7a1
feat(ui): ✨ add collapsible sidebar navigation system
thebeyondr Oct 6, 2025
0f76403
update styles
mintdart Oct 7, 2025
aec23fa
update styles
mintdart Oct 7, 2025
b9cd6fd
refactor
mintdart Oct 7, 2025
4c20548
update styles
mintdart Oct 7, 2025
507f6bb
add csv download to charts
mintdart Oct 7, 2025
36d3904
stackchart (#2167)
ReynardoEW Oct 7, 2025
b407190
update styles
mintdart Oct 7, 2025
d1aab94
add yields chart to dashboard
vrtnd Oct 7, 2025
498de56
fix
vrtnd Oct 7, 2025
fe4e051
add oi to chart builder
vrtnd Oct 7, 2025
5f76dfd
fix types
vrtnd Oct 7, 2025
93ac3f2
Fix chart (#2175)
Caranell Oct 7, 2025
73b1dee
Fix charts classnames (#2176)
Caranell Oct 7, 2025
069fb1d
add a category
realdealshaman Oct 8, 2025
353110f
add DAT page announcement on home page
mintdart Oct 8, 2025
35c5644
show DAT inflows chart on home page
mintdart Oct 8, 2025
1dbef77
fix link
mintdart Oct 8, 2025
cb1a06a
fix scatter n barchart etc (#2173)
ReynardoEW Oct 8, 2025
94bd442
fix missing tvl filters
mintdart Oct 8, 2025
6ff529f
add color picker
vrtnd Oct 8, 2025
b716789
render pools select on top
vrtnd Oct 8, 2025
912d97c
update styles
mintdart Oct 8, 2025
dc61187
suggestions loading n restore prompt if cancel (#2179)
ReynardoEW Oct 8, 2025
d4477a0
fix derivatives protocols by chain page
mintdart Oct 8, 2025
bd20184
enable overage btn
vrtnd Oct 9, 2025
147de99
fix
vrtnd Oct 9, 2025
1bf7305
fix(nav): update 'Account' label to 'Subscription' in primary navigation
thebeyondr Oct 9, 2025
d986958
Merge branch 'main' into feat/nav
thebeyondr Oct 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions public/icons/llama-logos/defi-llama-dark-theme.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions public/icons/llama-logos/defi-llama-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 51 additions & 0 deletions public/icons/llama-logos/defillama-light-theme.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/icons/v25.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 21 additions & 24 deletions public/pages.json
Original file line number Diff line number Diff line change
Expand Up @@ -716,56 +716,53 @@
"icon": "pencil-ruler"
}
],
"More": [
"Resources": [
{
"name": "Support",
"route": "/support"
"route": "/support",
"icon": "help-circle"
},
{
"name": "Documentation",
"route": "https://api-docs.defillama.com",
"icon": "code"
},
{
"name": "Contact us",
"route": "/about",
"icon": "chat"
},
{
"name": "Careers",
"route": "https://github.com/DefiLlama/careers/blob/master/README.md"
"route": "https://github.com/DefiLlama/careers/blob/master/README.md",
"icon": "users"
},
{
"name": "Report Incorrect Data",
"route": "/report-error"
"route": "/report-error",
"icon": "flag"
},
{
"name": "Press / Media",
"route": "/press"
},
{
"name": "API Reference",
"route": "https://api-docs.defillama.com"
},
{
"name": "List your project",
"route": "https://docs.llama.fi/list-your-project/submit-a-project"
}
],
"About Us": [
{
"name": "About / Contact",
"route": "/about"
},
{
"name": "Twitter",
"route": "https://x.com/DefiLlama"
"route": "https://x.com/DefiLlama",
"icon": "twitter"
},
{
"name": "Discord",
"route": "https://discord.defillama.com"
"route": "https://discord.defillama.com",
"icon": "discord"
},
{
"name": "Donate",
"route": "/donations"
},
{
"name": "Terms of Service",
"route": "/terms"
},
{
"name": "Privacy Policy",
"route": "/privacy-policy"
}
],
"Hidden": [
Expand Down
1 change: 1 addition & 0 deletions src/components/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ type Name =
| 'chat'
| 'earth'
| 'twitter'
| 'discord'
| 'file-text'
| 'flame'
| 'house'
Expand Down
58 changes: 35 additions & 23 deletions src/components/Metrics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useQuery } from '@tanstack/react-query'
import { matchSorter } from 'match-sorter'
import { Icon } from '~/components/Icon'
import { BasicLink } from '~/components/Link'
import { PINNED_METRICS_KEY } from '~/components/Nav/utils'
import { TOTAL_TRACKED_BY_METRIC_API } from '~/constants'
import { subscribeToPinnedMetrics } from '~/contexts/LocalStorage'
import defillamaPages from '~/public/pages.json'
Expand Down Expand Up @@ -188,7 +189,7 @@ export const LinkToMetricOrToolPage = React.memo(function LinkToMetricOrToolPage
}) {
const pinnedMetrics = useSyncExternalStore(
subscribeToPinnedMetrics,
() => localStorage.getItem('pinned-metrics') ?? '[]',
() => localStorage.getItem(PINNED_METRICS_KEY) ?? '[]',
() => '[]'
)

Expand Down Expand Up @@ -240,9 +241,9 @@ export const LinkToMetricOrToolPage = React.memo(function LinkToMetricOrToolPage
render={
<button
onClick={(e) => {
const currentPinnedMetrics = JSON.parse(window.localStorage.getItem('pinned-metrics') || '[]')
const currentPinnedMetrics = JSON.parse(window.localStorage.getItem(PINNED_METRICS_KEY) || '[]')
window.localStorage.setItem(
'pinned-metrics',
PINNED_METRICS_KEY,
JSON.stringify(
currentPinnedMetrics.includes(page.route)
? currentPinnedMetrics.filter((metric: string) => metric !== page.route)
Expand Down Expand Up @@ -271,10 +272,15 @@ const getTotalTracked = (totalTrackedByMetric: any, totalTrackedKey: string) =>

export const MetricsAndTools = memo(function MetricsAndTools({ currentMetric }: { currentMetric: Array<string> }) {
const dialogStore = Ariakit.useDialogStore()

// Format breadcrumb text from currentMetric array
const breadcrumbText = currentMetric.join(' ')

return (
<>
<Ariakit.DialogProvider store={dialogStore}>
<div className="relative isolate w-full rounded-md bg-(--cards-bg) p-1">
<div className="relative isolate flex w-full items-center justify-between gap-4 rounded-md bg-(--cards-bg) p-1">
{/* Left decorative SVG */}
<img
src="/icons/metrics-l.svg"
width={92}
Expand All @@ -283,27 +289,31 @@ export const MetricsAndTools = memo(function MetricsAndTools({ currentMetric }:
className="absolute top-0 left-0 hidden h-full w-auto rounded-l-md object-cover md:block"
fetchPriority="high"
/>
<div className="flex h-full flex-wrap items-center justify-center gap-1">
<span className="hidden items-center gap-2 rounded-md bg-(--old-blue) px-2 py-[7px] text-xs text-white lg:flex">
<Icon name="sparkles" height={12} width={12} />
<span>New</span>
</span>
{currentMetric.map((metric, i) => (
<Fragment key={`metric-name-${metric}`}>
{i === 1 ? (
<span>{metric}</span>
) : (
<Ariakit.DialogDisclosure className="z-10 rounded-md border border-dashed border-(--old-blue) bg-(--link-button) px-2.5 py-1 font-semibold hover:bg-(--link-button-hover)">
{metric}
</Ariakit.DialogDisclosure>
)}
</Fragment>
))}
<Ariakit.DialogDisclosure className="z-10 flex items-center gap-1 px-1.5 py-1 text-xs text-(--text-form)">
<Icon name="search" height={12} width={12} />
<span className="hidden sm:block">Click to browse & search</span>

{/* Content Container */}
<div className="relative z-10 flex w-full items-center justify-between gap-4 px-3 py-2">
{/* Left: Context/Breadcrumb with background for readability */}
<div className="flex items-center gap-2 text-base">
<span className="rounded-md bg-(--cards-bg) px-2 py-1 font-medium text-(--text-primary)">
{breadcrumbText}
</span>
</div>

{/* Center: New metrics indicator */}
<div className="hidden items-center gap-1.5 rounded-md bg-(--cards-bg) px-2 py-1 text-xs text-(--text-form) md:flex">
<Icon name="sparkles" height={14} width={14} className="text-(--old-blue)" />
<span>New metrics available</span>
</div>

{/* Right: Action button */}
<Ariakit.DialogDisclosure className="ml-auto flex shrink-0 items-center gap-1.5 rounded-md bg-(--old-blue) px-3 py-2 text-sm font-medium text-white transition-opacity hover:opacity-90 focus-visible:opacity-90">
<Icon name="pin" height={14} width={14} />
<span className="hidden sm:inline">Browse & Pin</span>
<span className="sm:hidden">Browse</span>
</Ariakit.DialogDisclosure>
</div>

{/* Right decorative SVG */}
<img
src="/icons/metrics-r.svg"
width={92}
Expand All @@ -312,6 +322,8 @@ export const MetricsAndTools = memo(function MetricsAndTools({ currentMetric }:
className="absolute top-0 right-0 hidden h-full w-auto rounded-r-md object-cover md:block"
fetchPriority="high"
/>

{/* Gradient border */}
<svg
width="100%"
height="100%"
Expand Down
42 changes: 30 additions & 12 deletions src/components/Nav/Account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useSubscribe } from '~/hooks/useSubscribe'
import { formatEthAddress } from '~/utils'
import { Icon } from '../Icon'
import { BasicLink } from '../Link'
import { useSidebarState } from '~/contexts/SidebarContext'

export const resolveUserEmail = (user: any): string | null => {
if (!user) return null
Expand All @@ -23,6 +24,7 @@ export const Account = memo(function Account() {
const { asPath } = useRouter()
const { isAuthenticated, user, logout, loaders } = useAuthContext()
const { subscription, isSubscriptionLoading } = useSubscribe()
const { isCollapsed } = useSidebarState()
const isAccountLoading = loaders?.userLoading || (isAuthenticated && isSubscriptionLoading)

const userHandle = resolveUserHandle(user)
Expand All @@ -43,48 +45,64 @@ export const Account = memo(function Account() {
{user && (
<BasicLink
href="/subscription"
className="flex items-center gap-1.5 truncate text-sm font-medium text-(--text-label) hover:text-(--link-text) hover:underline"
className={`flex items-center gap-1.5 text-sm font-medium text-(--text-label) hover:text-(--link-text) hover:underline ${
isCollapsed ? 'justify-center' : 'truncate'
}`}
>
<Icon name="users" className="h-4 w-4 shrink-0" />
{userHandle}
{!isCollapsed && userHandle}
</BasicLink>
)}
{subscription?.status === 'active' ? (
<span className="flex items-center gap-1 text-xs font-medium text-green-600 dark:text-green-500">
<span
className={`flex items-center gap-1 text-xs font-medium text-green-600 dark:text-green-500 ${
isCollapsed ? 'justify-center' : ''
}`}
>
<Icon name="check-circle" className="h-3.5 w-3.5" />
Subscribed
{!isCollapsed && 'Subscribed'}
</span>
) : (
user && (
<>
<span className="flex items-center gap-1 text-xs font-medium text-(--error)">
Subscription inactive
<span
className={`flex items-center gap-1 text-xs font-medium text-(--error) ${
isCollapsed ? 'justify-center' : ''
}`}
>
{!isCollapsed && 'Subscription inactive'}
</span>
<BasicLink
href="/subscription"
className="flex items-center gap-1 text-xs font-medium text-(--link) hover:underline"
className={`flex items-center gap-1 text-xs font-medium text-(--link) hover:underline ${
isCollapsed ? 'justify-center' : ''
}`}
>
<Icon name="plus" className="h-3.5 w-3.5" />
Upgrade
{!isCollapsed && 'Upgrade'}
</BasicLink>
</>
)
)}
<button
onClick={logout}
className="flex items-center justify-center gap-2 rounded-md bg-red-500/10 p-1 text-sm font-medium text-(--error)"
className={`flex items-center justify-center gap-2 rounded-md bg-red-500/10 p-1 text-sm font-medium text-(--error) ${
isCollapsed ? 'w-full' : ''
}`}
>
<Icon name="x" className="h-4 w-4" />
Logout
{!isCollapsed && 'Logout'}
</button>
</div>
) : (
<BasicLink
href={`/subscription?returnUrl=${encodeURIComponent(asPath)}`}
className="pro-btn-purple flex items-center justify-center gap-2 rounded-md p-1 text-sm font-medium"
className={`pro-btn-purple flex items-center justify-center gap-2 rounded-md p-1 text-sm font-medium ${
isCollapsed ? 'w-full' : ''
}`}
>
<Icon name="users" className="h-4 w-4" />
Sign In / Subscribe
{!isCollapsed && 'Sign In / Subscribe'}
</BasicLink>
)}
</>
Expand Down
Loading