-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
chore: hide network selectors in empty state for homepage tabs #20552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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. |
1100843
to
ea81d55
Compare
RefreshControl, | ||
ActivityIndicator, | ||
} from 'react-native'; | ||
import { useTailwind } from '@metamask/design-system-twrnc-preset'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer using useTailwind hook because we can use the twClassName
prop directly in the CollectiblesEmptyState
component
f384f42
to
d9edc95
Compare
collectibleContracts={{ | ||
'0x1': [ | ||
{ | ||
address: '0x1234567890123456789012345678901234567890', | ||
name: 'Test NFT Collection', | ||
symbol: 'TNFT', | ||
}, | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't be passing state directly like this
ab73ca1
to
d49c8ea
Compare
<View style={styles.actionBarWrapper}> | ||
<View style={styles.controlButtonOuterWrapper}> | ||
<ButtonBase | ||
testID={WalletViewSelectorsIDs.COLLECTIBLES_NETWORK_FILTER} | ||
label={ | ||
<> | ||
{isRemoveGlobalNetworkSelectorEnabled() ? ( | ||
<View style={styles.networkManagerWrapper}> | ||
{!areAllNetworksSelected && ( | ||
<Avatar | ||
variant={AvatarVariant.Network} | ||
size={AvatarSize.Xs} | ||
name={networkName} | ||
imageSource={networkImageSource} | ||
/> | ||
)} | ||
{shouldShowNetworkSelector && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bad visualization of changes here but we are changing the network selector to be rendered conditionally. No other changes
|
||
it('calls onDiscoverCollectibles when action button is pressed', () => { | ||
const mockOnDiscoverCollectibles = jest.fn(); | ||
it('calls onAction when action button is pressed', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move these rename changes into a different PR
expect( | ||
await findByTestId(WalletViewSelectorsIDs.DEFI_POSITIONS_NETWORK_FILTER), | ||
).toBeOnTheScreen(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will need to improve the tests here
import { View, FlatList } from 'react-native'; | ||
import { strings } from '../../../../locales/i18n'; | ||
import { useSelector } from 'react-redux'; | ||
import { useTailwind } from '@metamask/design-system-twrnc-preset'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this out in to a different PR
|
Description
This PR improves the user experience by hiding network selector controls in empty states across homepage tabs (DeFi, NFT, and Perps). When users have no positions, collectibles, or perps data, the network selector is no longer displayed, providing a cleaner and less cluttered interface.
Changes Made:
filteredCollectibleContracts?.length > 0
DefiEmptyState
componentPerpsEmptyState
directlyThis change follows the principle of progressive disclosure - showing relevant controls only when users have content to manage.
Changelog
CHANGELOG entry: null
Related issues
Fixes: Internal UX improvement initiative
Manual testing steps
Screenshots/Recordings
Before
Network selectors were visible in empty states, creating visual clutter when users had no content to filter.
After
Clean empty states without network selectors, showing only relevant content and call-to-action elements.
after720.mov
Pre-merge author checklist
Pre-merge reviewer checklist
🤖 Generated with Claude Code
Co-Authored-By: Claude [email protected]