Skip to content
This repository was archived by the owner on May 24, 2022. It is now read-only.

feat: Relates to #337. Part 2 of 2 - Change Tx Recap Unlock design#364

Merged
amaury1093 merged 23 commits intomasterfrom
luke-337-part2-unlock-token-address
Feb 5, 2019
Merged

feat: Relates to #337. Part 2 of 2 - Change Tx Recap Unlock design#364
amaury1093 merged 23 commits intomasterfrom
luke-337-part2-unlock-token-address

Conversation

@ltfschoen
Copy link
Contributor

@ltfschoen ltfschoen commented Jan 16, 2019

Part 2 of 2 - Transaction Recap (see second wireframe #337)

This PR just covers the 2nd wireframe of issue #337.
Note that a separate PR has been made for Part 1 of 2 - Account View

  • Create TokenAddress similar to TokenBalance but doesn't need balance info from @withbalance

  • Narrow full address so it fully fits

  • Copyable card address

* Create TokenAddress similar to TokenBalance but doesn't need balance info from @withbalance
@ltfschoen
Copy link
Contributor Author

ltfschoen commented Jan 16, 2019

I've pushed another commit that allows the user to copy the address of the card that's used on that screen

screen shot 2019-01-17 at 9 14 45 am

Copy link
Collaborator

@Tbaut Tbaut left a comment

Choose a reason for hiding this comment

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

Thanks, it looks good. Some nits:

  • Can we try to keep the same spacing as on the account list (but keep the full address of course on the approve sceen). Here is a side by side:
    account list:
    image
    approve screen:
    image
    ^ Also reducing the space with the icon may enable us to keep the same font size for the address accross both screens while making the address fit on 1 line.

PR unrelated nits, at your own will.
- I realized that the password field isn't autofocused, could we add it?
- can we rename the "Cancel" button with "Back", because all it does is go back :)

…own font size

* Use `-webkit-transform-origin-x: 0;` to have no padding on left side when scale font size smaller. See https://stackoverflow.com/questions/13031158/unwanted-left-margin-when-using-webkit-transform-scale

* Refactor code to only use `shortAddress` to determine whether to show full address on screen. `screen` prop not necessary

* Remove `-narrow` from Information and Name, only need it for Address component

* Increase scale to 0.95 so address just fits in on the tx summary page that uses the Unlock component
@ltfschoen
Copy link
Contributor Author

@Tbaut I found out that doing -webkit-transform-origin-x: 0; removes the left padding that was being introduced as I scaled down the font size scale https://stackoverflow.com/questions/13031158/unwanted-left-margin-when-using-webkit-transform-scale. I also found that I didn't need the screen prop to achieve the outcome.

So I was able to keep the same spacing as on the account list page (but using full address on the approve screen). Both just have padding-left: 0.325rem; now.

Note: I had to scale the address font-size down to 95% to fit it in on the approve screen.

screen shot 2019-01-18 at 6 20 26 pm

Copy link
Collaborator

@Tbaut Tbaut left a comment

Choose a reason for hiding this comment

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

Thanks, that's cool. I just realized we forgot to add this improvement for Parity Signer accounts. Can you add it to SignedTxSummary as well?

@ltfschoen
Copy link
Contributor Author

@Tbaut I've pushed a commit so it's also shown on SignedTxSummary

@Tbaut
Copy link
Collaborator

Tbaut commented Jan 24, 2019

I get a Warning: Invalid value for prop "render" after scanning the signed transaction with my webcam (although Fether seems to work). Note that this happened only once (need to refresh Fether if you want to reproduce).

image

Copy link
Collaborator

@Tbaut Tbaut left a comment

Choose a reason for hiding this comment

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

See above

@ltfschoen
Copy link
Contributor Author

@Tbaut I've pushed a commit that removes the invalid render props and checked that the warning no longer appears

Copy link
Collaborator

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

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

FetherForm.Field is a "dumb" component, just UI. We need to connect it to state (via react-final-form) with <Field render={FetherForm.Field} />

I get the following erorr now.

screenshot 2019-02-04 at 11 34 28

/>

<Field
<FetherForm.Field
Copy link
Collaborator

Choose a reason for hiding this comment

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

We need to use Field from final-form here, with the correct render prop

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@amaurymartiny I've pushed a commit that addresses the issue. I also changed it from defaultValue to value to overcome a warning

Copy link
Collaborator

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

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

Works well! Just 2 small nits

className='form_field_amount'
as='textarea'
className='form_field_value'
value={tx.to}
Copy link
Collaborator

Choose a reason for hiding this comment

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

The values are already set in initialValues a couple of lines above, so we don't need value here

as='textarea'
className='-sm'
className='form_field_value'
value={`${tx.amount} ${token.symbol}`}
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here, set the initial value above to ${tx.amount} ${token.symbol}

@ltfschoen
Copy link
Contributor Author

@amaurymartiny I've pushed a commit addressing your latest comments, thanks

Copy link
Collaborator

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

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

lgtm

@amaury1093 amaury1093 merged commit 4786e08 into master Feb 5, 2019
@amaury1093 amaury1093 deleted the luke-337-part2-unlock-token-address branch February 5, 2019 17:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants