Skip to content
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

Finance: move to Viewport #671

Merged
merged 10 commits into from
Feb 18, 2019
Merged

Finance: move to Viewport #671

merged 10 commits into from
Feb 18, 2019

Conversation

bpierre
Copy link
Contributor

@bpierre bpierre commented Feb 14, 2019

  • Remove uses of BreakPoint.
  • Remove GetWindowSize.
  • Moved the app layout structure into AppLayout.
  • Moved the main action icon into an icon component.

- Remove uses of BreakPoint.
- Remove GetWindowSize.
- Moved the app layout structure into AppLayout.
- Moved the main action icon into an icon component.
@coveralls
Copy link

coveralls commented Feb 14, 2019

Coverage Status

Coverage decreased (-0.7%) to 96.915% when pulling 457640a on finance-use-viewport into de189bd on master.

Copy link
Contributor

@sohkai sohkai left a comment

Choose a reason for hiding this comment

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

Really like AppLayout :D

<TableHeader />
</TableRow>
</BreakPoint>
<Viewport>
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this extra Viewport when we already have an instance above?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤦‍♂️ thanks!

@@ -199,12 +206,12 @@ class Transfers extends React.Component {
key={transfer.transactionHash}
token={tokenDetails[toChecksumAddress(transfer.token)]}
transaction={transfer}
wideMode={width > 768 + 219}
wideMode={width > breakpoints.medium + 219}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we set a constant for 219?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I ended up removing this entirely, since we don’t want IdentityBadge to be in wide mode anymore.

<Viewport>
{({ below }) => (
<AppView
padding={below('medium') ? smallViewPadding : 30}
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we could add a largeViewPadding that defaults to 30?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes good idea!

<SidePanel
<div css="min-width: 320px">
<Main>
<AppLayout
Copy link
Contributor

Choose a reason for hiding this comment

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

So clean ✨

</Grid>
</StyledTableCell>
</TableRow>
) : (
Copy link
Contributor

Choose a reason for hiding this comment

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

I would say in this case it might make sense to have explicit if/else blocks, since the tree is so large and it's hard to spot the :

</ContextMenuItem>
</ContextMenu>
)}
{showCopyTransferMessage && (
Copy link
Contributor

@sohkai sohkai Feb 15, 2019

Choose a reason for hiding this comment

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

Noticed you removed the commented out context menu (don't remember why we commented it out in the first place; maybe iframe permissions?), but should we just remove all of the code related to it?

I find copying the transaction hash to be more useful, and worst case opening the etherscan URL gives you that anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yes. I’m not sure why we decided to remove it, maybe for iframe permissions yes. I’m going to remove the code, and we’ll probably have a better solution soon within the transaction popover.

@sohkai sohkai added this to the A1 Sprint: 4.1 milestone Feb 15, 2019
Copy link
Contributor

@sohkai sohkai left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -205,7 +202,7 @@ class Transfers extends React.PureComponent {
key={transfer.transactionHash}
token={tokenDetails[toChecksumAddress(transfer.token)]}
transaction={transfer}
wideMode={width > WIDE_MODE_FROM}
smallViewMode={below('medium')}
Copy link
Contributor

Choose a reason for hiding this comment

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

cc @AquiGorka on this, just to be sure this is safe 😄

Copy link
Contributor Author

@bpierre bpierre Feb 15, 2019

Choose a reason for hiding this comment

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

Oh yeah these two props seem similar but are unrelated:

  • wideMode is an old one, that was used to make the badge shortened / not shortened (it was the first use of GetWindowSize that became Viewport 😁), and we don’t need it anymore since the badge should always be shortened now.
  • smallViewMode is for the compact mode that @AquiGorka introduced: I made it as an external prop to not have unnecessary instances of Viewport.

Copy link
Contributor

@AquiGorka AquiGorka Feb 18, 2019

Choose a reason for hiding this comment

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

What @bpierre said is halfway there: wideMode was used to set the shorten property for the IdentityBadge which is lost now? This might break spacing for mobile, should it be set to true directly as the default mode?

afterTitle: PropTypes.node,
onMenuOpen: PropTypes.func.isRequired,
smallViewPadding: PropTypes.number,
largeViewPadding: PropTypes.number,
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as on the other PR, should this be mediumViewPadding?

@bpierre bpierre merged commit 8c565e2 into master Feb 18, 2019
@bpierre bpierre deleted the finance-use-viewport branch February 18, 2019 12:26
@bpierre bpierre mentioned this pull request Feb 18, 2019
40 tasks
@luisivan luisivan mentioned this pull request Mar 4, 2019
46 tasks
ramilexe pushed a commit to ConsiderItDone/aragon-apps that referenced this pull request Dec 9, 2021
- Upgrade @aragon/ui to 0.31.0.
- Move to Viewport (remove uses of BreakPoint).
- Remove GetWindowSize.
- Use Main.
- Moved the app layout structure into a dedicated component, AppLayout.
- Moved the main action icon into an icon component.
- The IdentityBadge is now always shortened.
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.

4 participants