Skip to content

Commit 8a1991b

Browse files
feat: Add tokens full page (#21628)
## **Description** This PR implements a full-screen Tokens view accessible from the wallet's Tokens tab, providing users with an expanded view of their token portfolio. The feature includes a "View all tokens" button that appears when the token list is truncated, allowing users to navigate to a dedicated full-screen tokens page with enhanced navigation and layout. **Key improvements:** - **Enhanced User Experience**: Users can now access a full-screen tokens view for better visibility and interaction - **Improved Navigation**: Seamless navigation between the tab view and full-screen view - **Better Layout**: Full-screen view utilizes the entire screen real estate for token management - **Consistent UI**: Maintains existing functionality while providing expanded access ## **Changelog** CHANGELOG entry: Added full-screen Tokens view accessible via "View all tokens" button in wallet ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/jira/software/c/projects/DSYS/boards/1888?selectedIssue=DSYS-245 ## **Manual testing steps** ```gherkin Feature: Tokens Full Page Scenario: User can access full-screen tokens view Given the user is on the Wallet page And the Tokens tab is selected And there are more tokens than the display limit When the user clicks on "View all tokens" button Then they should be navigated to the Tokens Full View page And the page should display all tokens in a full-screen layout And the back button should return them to the wallet Scenario: User can navigate back from full-screen view Given the user is on the Tokens Full View page When the user clicks the back button Then they should return to the Wallet page And the Tokens tab should remain selected Scenario: Full-screen view maintains existing functionality Given the user is on the Tokens Full View page When the user interacts with tokens (refresh, filter, sort) Then all existing token functionality should work as expected And the UI should be consistent with the tab view ``` ## **Screenshots/Recordings** ### **Before** ### **After** Tokens Full View https://github.com/user-attachments/assets/c05ea851-ef7f-46f9-8092-2104b6805159 Tokens Tab still functional https://github.com/user-attachments/assets/c8dc808d-9f4f-46db-83e4-9f691b44112d ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adds a full-screen Tokens view accessible via a new "View all tokens" button and route, with layout/refactors to token list, control bar, and Add Asset header plus tests and i18n. > > - **Wallet UI**: > - **Full-screen Tokens view**: New `Views/TokensFullView` with header/back; wired into `MainNavigator` and `Routes.WALLET.TOKENS_FULL_VIEW`. > - **Token list UX**: `TokenList` gains `maxItems`, optional `flashListProps`, and a "`wallet.view_all_tokens`" button that navigates to `TokensFullView`. > - **Tokens layout**: `UI/Tokens` supports `isFullView` (padding/safe area), passes `flashListProps`, and uses design-system `Box`/Tailwind; progressive loading unchanged. > - **Controls/Styling**: > - `TokenListControlBar` and shared `BaseControlBar` accept optional `style` prop for outer wrapper spacing. > - Minor bottom sheet wrapper cleanup in token filter/sort sheets. > - **Add Asset**: > - Replaces navbar options with `BottomSheetHeader` (back button/title) in `Views/AddAsset`. > - **Navigation**: > - Registers `TokensFullView` and moves `AddAsset` stack entry; updates snapshots. > - **Tests/I18n**: > - New `TokensFullView.test.tsx`; updates to `Tokens` and `AddAsset` tests/snapshots. > - Adds `wallet.view_all_tokens` string in `en.json`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 9ccc10f. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent c81a7cd commit 8a1991b

File tree

19 files changed

+873
-227
lines changed

19 files changed

+873
-227
lines changed

app/components/Nav/Main/MainNavigator.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import Asset from '../../Views/Asset';
2626
import AssetDetails from '../../Views/AssetDetails';
2727
import AddAsset from '../../Views/AddAsset';
2828
import Collectible from '../../Views/Collectible';
29+
import TokensFullView from '../../Views/TokensFullView';
2930
import SendLegacy from '../../Views/confirmations/legacy/Send';
3031
import SendTo from '../../Views/confirmations/legacy/SendFlow/SendTo';
3132
import { RevealPrivateCredential } from '../../Views/RevealPrivateCredential';
@@ -196,11 +197,6 @@ const WalletTabStackFlow = () => (
196197
component={WalletModalFlow}
197198
options={{ headerShown: false }}
198199
/>
199-
<Stack.Screen
200-
name="AddAsset"
201-
component={AddAsset}
202-
options={AddAsset.navigationOptions}
203-
/>
204200
<Stack.Screen
205201
name="Collectible"
206202
component={Collectible}
@@ -943,6 +939,16 @@ const MainNavigator = () => {
943939
}}
944940
/>
945941
<Stack.Screen name="Home" component={HomeTabs} />
942+
<Stack.Screen
943+
name={Routes.WALLET.TOKENS_FULL_VIEW}
944+
component={TokensFullView}
945+
options={{ headerShown: false }}
946+
/>
947+
<Stack.Screen
948+
name="AddAsset"
949+
component={AddAsset}
950+
options={{ headerShown: false }}
951+
/>
946952
{isRewardsEnabled && (
947953
<Stack.Screen
948954
name={Routes.SETTINGS_VIEW}

app/components/Nav/Main/__snapshots__/MainNavigator.test.tsx.snap

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,24 @@ exports[`MainNavigator matches rendered snapshot 1`] = `
3838
component={[Function]}
3939
name="Home"
4040
/>
41+
<Screen
42+
component={[Function]}
43+
name="TokensFullView"
44+
options={
45+
{
46+
"headerShown": false,
47+
}
48+
}
49+
/>
50+
<Screen
51+
component={[Function]}
52+
name="AddAsset"
53+
options={
54+
{
55+
"headerShown": false,
56+
}
57+
}
58+
/>
4159
<Screen
4260
component={[Function]}
4361
name="Asset"

0 commit comments

Comments
 (0)