-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Move asset list to home tab on small screens #8264
Conversation
Builds ready [7a0a279]
Page Load Metrics (719 ± 40 ms)
|
Two tabs have been created on the home screen: 'Assets' and 'History'. This tabbed view is shown only on small screens (e.g. in the popup). The fullscreen view is unchanged. The toggle-able left sidebar no longer exists, so some 'sidebar-left' specific code and styles have been removed. The button in the menu bar has been removed as well. The 'History' title of the transaction history is now redundant when where are no pending transactions, so it as been conditionally hidden. A passthrough for `data-testid` has been added to the Tab component for convenience in e2e tests.
Builds ready [cb61392]
Page Load Metrics (679 ± 34 ms)
|
When you click on a token, it no longer brings you to the transaction history for that token like it used to. I opened #8266 in preparation for updating the Home component to automatically switch to the |
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.
Reviewed every file, everything looks good. My comments are just what I wrote on the important files after reading them and understanding them. No action is needed.
@@ -104,7 +89,6 @@ export default class AssetList extends Component { | |||
name: 'Clicked Token', | |||
}, | |||
}) | |||
selectedTokenAddress !== tokenAddress && sidebarOpen && hideSidebar() | |||
}} | |||
/> | |||
{this.renderAddToken()} |
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.
okay, these file changes just remove the triggering of sidebar hiding from the asset list component. Looks good, makes sense, and explains the below change to the container
sidebarOpen ? hideSidebar() : showSidebar() | ||
}} | ||
/> | ||
</Tooltip> | ||
<SelectedAccount /> | ||
|
||
<Tooltip |
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.
removes the button for opening the sidebar in popup view. looks good, makes sense
@@ -35,8 +33,6 @@ export default class Sidebar extends Component { | |||
const { type, sidebarProps = {} } = this.props | |||
const { transaction = {} } = sidebarProps | |||
switch (type) { | |||
case WALLET_VIEW_SIDEBAR: | |||
return <WalletView responsiveDisplayClassname="sidebar-right" /> | |||
case 'customize-gas': |
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 need for the sidebar component to know about the wallet view if we are no longer showing it in sidebar. Looks good, makes sense
{ t('history') } | ||
</div> | ||
{ | ||
pendingLength > 0 && ( |
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.
Okay, so the history title is only needed when the "History" tab needs to be divided into pending and history. Makes sense
history.push(CONNECTED_ROUTE) | ||
if (sidebarOpen) { | ||
hideSidebar() | ||
} | ||
} | ||
|
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.
wallet view no longer interacts with a sidebar, doesn't need to know about it 👌, this implies below container changes
@@ -250,7 +237,6 @@ export default class Routes extends Component { | |||
transitionName={sidebarTransitionName} | |||
type={sidebarType} | |||
sidebarProps={sidebar.props} | |||
onOverlayClose={sidebarOnOverlayClose} | |||
/> | |||
<NetworkDropdown | |||
provider={provider} |
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.
👌
@@ -24,6 +32,7 @@ const Tab = (props) => { | |||
|
|||
Tab.propTypes = { | |||
className: PropTypes.string, | |||
'data-testid': PropTypes.string, | |||
isActive: PropTypes.bool, // required, but added using React.cloneElement | |||
name: PropTypes.string.isRequired, | |||
onClick: PropTypes.func, |
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.
👌
<TransactionList /> | ||
</div> | ||
</> | ||
) | ||
) |
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.
refactor isWideViewport
logic and add new tabs to home screen, 👌
I'm not happy with the UX of this new home page - it's ambiguous whether this is a step forward or not. But it's a step toward designs that are better at least, so I'll merge this for now and we can improve it later. |
The `History` title above the transaction history was changed in #8264 to only show when there are pending transactions, because it was redundant to show an additional `History` title below a tab called `History`. It was preserved when there were pending transactions because the pending transactions are shown first in the list, followed by the history, so the title served to divide the two lists. This ended up breaking the fullscreen view though, which doesn't use tabs yet. It has been updated to always show on fullscreen.
The `History` title above the transaction history was changed in #8264 to only show when there are pending transactions, because it was redundant to show an additional `History` title below a tab called `History`. It was preserved when there were pending transactions because the pending transactions are shown first in the list, followed by the history, so the title served to divide the two lists. This ended up breaking the fullscreen view though, which doesn't use tabs yet. It has been updated to always show on fullscreen.
Two tabs have been created on the home screen: 'Assets' and 'History'. This tabbed view is shown only on small screens (e.g. in the popup). The fullscreen view is unchanged.
The toggle-able left sidebar no longer exists, so some 'sidebar-left' specific code and styles have been removed. The button in the menu bar has been removed as well.
The 'History' title of the transaction history is now redundant when where are no pending transactions, so it as been conditionally hidden.
A passthrough for
data-testid
has been added to the Tab component for convenience in e2e tests.