Skip to content

feat: add VIP feature#5671

Open
therealemjy wants to merge 1 commit into
mainfrom
feat/vip
Open

feat: add VIP feature#5671
therealemjy wants to merge 1 commit into
mainfrom
feat/vip

Conversation

@therealemjy

Copy link
Copy Markdown
Member

Jira ticket(s)

VPD-1466

Changes

  • add VIP feature
  • update navbar

@changeset-bot

changeset-bot Bot commented Jul 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4bd7853

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@venusprotocol/evm Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Jul 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dapp-preview Ready Ready Preview Jul 9, 2026 7:49am
dapp-testnet Ready Ready Preview Jul 9, 2026 7:49am
venus.io Ready Ready Preview Jul 9, 2026 7:49am

Request Review

@greptile-apps

greptile-apps Bot commented Jul 2, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds a VIP feature to the Venus Protocol interface, showing a one-time promotional modal to users whose on-chain portfolio (supply + borrow) exceeds an $800K threshold, and surfacing a private Telegram group invite in the account panel. It also refactors the navbar's connect/account button area into a dedicated AccountModal and UserButton, extracts the Dashboard Overview into a reusable AccountOverview container, replaces MUI Backdrop with a portal-based BodyBackdrop, and renames isDropdownOpenedisDropdownOpen across several components.

  • VIP detection (useIsConnectedAccountVip): sums userSupplyBalanceCents + userBorrowBalanceCents across all pools and compares against VIP_PORTFOLIO_THRESHOLD_CENTS ($800K). Both supply and borrow counts toward the threshold — confirmed intentional by the test suite.
  • VIP modal (VipModal/VipModal/Modal): renders once per chain (guarded by doNotShowVipModal in chain settings), is intentionally non-dismissible via backdrop click, and requires explicit user action (join Telegram or decline).
  • AccountModal properly restores the Safe Wallet disconnect guard (!config.isSafeApp) that was highlighted in a previous review.

Confidence Score: 5/5

Safe to merge — no functional regressions or incorrect behavior found across the new VIP feature, the modal refactor, or the navbar restructuring.

The VIP threshold logic (supply + borrow) is intentional and confirmed by the test suite. The Safe Wallet disconnect guard is correctly restored in AccountModal. The BodyBackdrop portal approach is sound and the MUI modal's pointer-events-none overlay correctly routes clicks. All changed components have corresponding tests and snapshot updates are consistent with the new behavior.

No files require special attention.

Important Files Changed

Filename Overview
apps/evm/src/hooks/useIsConnectedAccountVip/index.ts VIP check sums supply + borrow balances across all pools; returns false during loading or when unconnected. Logic is correct and matches the test assertions.
apps/evm/src/containers/VipModal/index.tsx Gate logic (account connected + VIP + not dismissed) is correct; returns undefined early so the lazy-loaded Modal only mounts when needed.
apps/evm/src/containers/VipModal/Modal/index.tsx Renders with isOpen always true (visibility controlled by parent); intentionally no handleClose, so backdrop click is a no-op — users must choose an action.
apps/evm/src/containers/Layout/NavBar/ConnectButton/AccountModal/index.tsx New AccountModal with Safe Wallet disconnect guard properly restored, BodyBackdrop for blur layer, and VipTelegramGroupButton integration.
apps/evm/src/components/Modal/index.tsx Replaces MUI Backdrop with portal-based BodyBackdrop; sets pointer-events-none on the MUI modal root to allow backdrop interaction without the MUI overlay intercepting clicks.
apps/evm/src/components/BodyBackdrop/index.tsx New portal-based backdrop that renders into BODY_PORTAL_ID; SSR-safe guard for document access.
apps/evm/src/containers/Layout/NavBar/ConnectButton/index.tsx Refactored: splits connected/disconnected paths cleanly; AccountModal toggled via local state; VIP status wired from useIsConnectedAccountVip.
apps/evm/src/containers/AccountOverview/index.tsx Extracted from Dashboard/Overview into reusable container; now accepts accountAddress as a prop instead of reading from wallet context, and showGraph prop to suppress the chart.

Reviews (3): Last reviewed commit: "feat: add VIP feature" | Re-trigger Greptile

Comment thread apps/evm/src/components/Icon/icons/connect.tsx Outdated
@therealemjy

Copy link
Copy Markdown
Member Author

@greptile

@therealemjy

Copy link
Copy Markdown
Member Author

@greptile

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for ./apps/evm

Status Category Percentage Covered / Total
🔵 Lines 83.38% 51106 / 61290
🔵 Statements 83.38% 51106 / 61290
🔵 Functions 63.45% 679 / 1070
🔵 Branches 72.64% 5855 / 8060
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
apps/evm/src/App/index.tsx 0% 0% 0% 0% 1-78
apps/evm/src/components/index.ts 100% 100% 100% 100%
apps/evm/src/components/BodyBackdrop/index.tsx 93.75% 25% 100% 93.75% 18
apps/evm/src/components/Dropdown/index.tsx 68.49% 46.15% 0% 68.49% 47-49, 57-81
apps/evm/src/components/Icon/icons/connect.tsx 100% 50% 100% 100%
apps/evm/src/components/Icon/icons/index.ts 99.07% 0% 100% 99.07% 1
apps/evm/src/components/Modal/index.tsx 97.33% 55.55% 100% 97.33% 50, 99
apps/evm/src/components/Select/index.tsx 93.38% 76% 50% 93.38% 59, 64, 69, 75-76, 83-85, 91
apps/evm/src/components/Tooltip/index.tsx 97.61% 66.66% 20% 97.61% 25
apps/evm/src/components/Username/index.tsx 64.47% 72.72% 100% 64.47% 63-98
apps/evm/src/constants/layout.ts 100% 0% 100% 100%
apps/evm/src/constants/vip.ts 100% 0% 100% 100%
apps/evm/src/containers/Layout/index.tsx 0% 0% 0% 0% 1-100
apps/evm/src/containers/Layout/store.ts 66.66% 0% 0% 66.66% 1, 17, 19
apps/evm/src/containers/Layout/Header/MarketInfo/AddTokenToWalletDropdown/index.tsx 0% 0% 0% 0% 1-82
apps/evm/src/containers/Layout/Header/MarketInfo/GoToTokenContractDropdown/index.tsx 0% 0% 0% 0% 1-48
apps/evm/src/containers/Layout/NavBar/index.tsx 99.06% 88.88% 100% 99.06% 39
apps/evm/src/containers/Layout/NavBar/ChainSelect/index.tsx 98.21% 66.66% 100% 98.21% 31
apps/evm/src/containers/Layout/NavBar/ConnectButton/index.tsx 93.87% 90.9% 33.33% 93.87% 28-30
apps/evm/src/containers/Layout/NavBar/ConnectButton/AccountModal/index.tsx 100% 50% 100% 100%
apps/evm/src/containers/Layout/NavBar/ConnectButton/UserButton/index.tsx 100% 90% 100% 100%
apps/evm/src/containers/Layout/NavBar/MenuItem/index.tsx 92.94% 68.75% 33.33% 92.94% 34, 39, 82-84, 95
apps/evm/src/containers/Layout/NavBar/Settings/LanguageSetting/index.tsx 95% 50% 0% 95% 19
apps/evm/src/containers/VipModal/index.tsx 0% 0% 0% 0% 1-26
apps/evm/src/containers/VipModal/Modal/index.tsx 0% 0% 0% 0% 1-54
apps/evm/src/containers/VipTelegramGroupButton/index.tsx 100% 0% 100% 100%
apps/evm/src/hooks/useIsConnectedAccountVip/index.ts 96.15% 85.71% 100% 96.15% 1
apps/evm/src/hooks/useUserChainSettings/index.tsx 96.87% 66.66% 100% 96.87% 1
apps/evm/src/pages/Dashboard/index.tsx 85.33% 20% 100% 85.33% 40, 55-58, 63-66, 72-74
apps/evm/src/store/index.ts 98.46% 90.9% 100% 98.46% 1
Generated in workflow #13791 for commit 4bd7853 by the Vitest Coverage Report Action

@cuzz-venus cuzz-venus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good to me with approved 👍 , only left a tiny suggestion on my side

import type { Tab } from 'hooks/useTabs';
import { useTranslation } from 'libs/translations';
import { useAccountAddress } from 'libs/wallet';
import { AccountOverview } from '../../containers/AccountOverview';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can use containers/AccountOverview instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants