feat: add share button and share sheet to Token Details page#31868
Conversation
- Add share icon button to the TokenDetailsInlineHeader next to the bell - Implement ShareTokenSheet bottom sheet with a branded dark share card showing token identity, 24h change, price, market cap, 24h volume, sparkline chart, QR code, and MetaMask branding - Conditional social share circles (WhatsApp, Telegram, X, Signal) shown only when the respective apps are installed via Linking.canOpenURL - Copy and More (image capture via react-native-view-shot + expo-sharing) action buttons with larger size for better tap targets - Three-tier market data resolution: Redux cache → search discovery → API - All UI strings use i18n translations under the share_token namespace - Design tokens used throughout (darkTheme for card, theme for chrome)
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
PR template — items to address before "Ready for review"Warnings — informational, address before merging:
See docs/readme/ready-for-review.md for the full Definition of Ready for Review. |
|
No dependency changes detected. Learn more about Socket for GitHub. 👍 No dependency changes detected in pull request |
- Add TOKEN_DETAILS_SHARED ('Token Details Shared') to MetaMetrics.events.ts
- Fire the event from handleShare with chain_id, token_symbol, and
token_address to identify the most-shared assets in Segment
- Add unit tests for onSharePress wiring, URL encoding, and event properties
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4cf3892. Configure here.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Tag selection reasoning: The Token Details screen is accessed from the token list in the wallet home. SmokeWalletPlatform covers core wallet platform features including token-related flows. No dedicated E2E tests exist for TokenDetails share functionality, but SmokeWalletPlatform tests exercise the wallet home and token list which leads to TokenDetails. The layout change in TokenDetailsInlineHeader (wrapping buttons in a new endButtons container) could potentially affect existing price alert button rendering, warranting regression testing of the wallet platform flows. No other tags are needed as this change is isolated to the Token Details component and doesn't affect confirmations, swaps, network management, accounts, or other feature areas. Performance Test Selection: |
|
|
No release label on PR. Adding release label release-8.1.0 on PR, as PR was added to branch 8.1.0 when release was cut. |






add share button and share sheet to Token Details page
Description
Changelog
CHANGELOG entry: add share button and share sheet to Token Details page
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Share.mov
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Low Risk
User-facing share and analytics only; no auth, payments, or sensitive data handling beyond existing token route params.
Overview
Adds a share action on Token Details so users can share a MetaMask deep link to the current asset.
TokenDetailsInlineHeadernow accepts optionalonSharePressand shows a share icon alongside the price-alert control (same ambient-color gating as other header actions).TokenDetailswireshandleShare: it no-ops if CAIP-19assetIdcannot be resolved, otherwise opens the native share sheet withhttps://link.metamask.io/asset?assetId=…(encoded), uses{ url }on iOS and{ message }on Android, and emitsTOKEN_DETAILS_SHAREDwith chain, symbol, and address.Analytics registers the new event in
MetaMetrics.events. Tests cover share URL encoding, Android vs iOS payloads, analytics, header visibility, plus expandedTokenDetailscoverage for close/open tracking, CTAs, disclaimer, and non-EVM rendering.Reviewed by Cursor Bugbot for commit 0f471cb. Bugbot is set up for automated code reviews on this repo. Configure here.