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

Transaction components #1512

Merged
merged 31 commits into from
Jun 9, 2020
Merged

Transaction components #1512

merged 31 commits into from
Jun 9, 2020

Conversation

EtDu
Copy link
Contributor

@EtDu EtDu commented Apr 27, 2020

Description

Create components for transactions created from dApps redesign. #1501

Checklist

  • Create TransactionReviewFeeCard component
  • TransactionReviewFeeCard create snapshot test
  • Confirm: Use TransactionReviewFeeCard
  • CustomGas: implement custom gas modal redesign
  • Confirm & Approve: use new CustomGas
  • Add in fix for iOS Crash after editing gas price that dapp suggested #1473
  • Fix gas error not updating properly

Issue

Resolves #1497
Resolves #1500
Resolves #1473

@EtDu
Copy link
Contributor Author

EtDu commented Apr 27, 2020

Screen Shot 2020-04-27 at 11 59 56 AM

primaryCurrency = FIAT

Screen Shot 2020-04-27 at 11 59 25 AM

primaryCurrency = ETH

@cjeria is this what you had in mind?

@EtDu
Copy link
Contributor Author

EtDu commented Apr 29, 2020

Screen Shot 2020-04-29 at 1 52 53 PM

Basic network fee selection

@EtDu
Copy link
Contributor Author

EtDu commented Apr 30, 2020

Advanced gas controls
Screen Shot 2020-04-30 at 9 54 34 PM

Gas limit error
Screen Shot 2020-04-30 at 9 54 53 PM

Gas price error
Screen Shot 2020-04-30 at 9 54 42 PM

Notes:

  • If gas limit and gas price errors are both present, it will only show one at a time (gas price) until it is resolved, then it will show the other.
  • Showing/hiding the error does not displace any elements on the screen

@EtDu EtDu marked this pull request as draft May 7, 2020 13:22
@EtDu EtDu marked this pull request as ready for review May 9, 2020 07:39
@EtDu EtDu force-pushed the transaction-components branch from 900e7a0 to f18248d Compare May 9, 2020 08:18
buttonNext: {
flex: 1
},
radio: {}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can remove this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

missed that, I wonder if the linter could pick up on empty styles

const { warningGasLimit, warningGasPrice } = this.state;
const { gasError } = this.props;
let gasErrorMessage;
if ((warningGasLimit && warningGasPrice) || warningGasPrice) {
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't this equivalent to if (warningGasPrice) ?

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, double logic at its finest

}
return (
<View style={styles.warningWrapper}>
<View style={[styles.warningTextWrapper, !gasError ? styles.invisible : null]}>
Copy link
Contributor

Choose a reason for hiding this comment

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

what about not returning any component if there's no error? I don't know if this is using space on the view even though is rendering nothing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is using space on the view on purpose, that's why I hide and show it with opacity: 0. If it doesn't initially take space, then when the error appears it will push everything else upward- which doesn't look good.

Let me know however if this is the desired effect

Copy link
Contributor

@estebanmino estebanmino left a comment

Choose a reason for hiding this comment

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

added small comments, looks good!

@rickycodes rickycodes self-requested a review May 12, 2020 03:01
@rickycodes rickycodes removed their request for review May 13, 2020 17:51
@EtDu EtDu force-pushed the transaction-components branch from 8a38295 to dd4ed7a Compare May 14, 2020 06:41
@EtDu EtDu marked this pull request as draft May 14, 2020 13:38
@EtDu EtDu force-pushed the transaction-components branch from 90a451b to d48dc94 Compare May 18, 2020 09:53
@EtDu EtDu marked this pull request as ready for review May 18, 2020 13:11
@EtDu EtDu force-pushed the transaction-components branch from d48dc94 to e7c03ea Compare May 22, 2020 11:26
@ibrahimtaveras00 ibrahimtaveras00 requested a review from a team as a code owner May 26, 2020 17:55
confirmDisabled={!!gasError}
cancelButtonMode={'neutral'}
confirmButtonMode={'confirm'}
<Modal
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder why you didn't use ActionModal here, you can disable the cancel button if you want and add a style prop there to put it on the bottom of the screen. In terms of reusability of components, now if we change the color of these models, we'll have to change this one separately from the others.
Same comment for https://github.com/MetaMask/metamask-mobile/pull/1512/files#diff-1d09ed350c73498ec258583166d70e87R461

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean is working and already approved, but I think we can reuse things here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cool, resolved

@EtDu EtDu force-pushed the transaction-components branch from 8d783bb to 18a47ff Compare May 28, 2020 11:00
@estebanmino estebanmino added the needs-qa Any New Features that needs a full manual QA prior to being added to a release. label May 28, 2020
EtDu added 4 commits June 2, 2020 16:51
…ETH transaction fee, move renderIfGasEstimationReady to TransactionReviewFeeCard, remove adjust transaction fee button, pass props to TransactionReviewFeeCard
@EtDu EtDu force-pushed the transaction-components branch from 1900922 to 7b77976 Compare June 2, 2020 08:52
Copy link
Contributor

@ibrahimtaveras00 ibrahimtaveras00 left a comment

Choose a reason for hiding this comment

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

Overall this looks and feels pretty solid across both OS's and multiple screen sizes!

Only noticed two issues:

Issue 1:

When I edit network fee and go to advanced, I'm still able to tap save when I do not have anything entered in the gas limit input field

seen here = https://recordit.co/3sK3vd9Jt5

Screen Shot 2020-06-04 at 10 16 37 PM

When I tap send, I then get the error

Screen Shot 2020-06-04 at 10 18 00 PM

Issue 2:

Continuing from issue one, when I get into this state and click Edit again and attempt to change to either slow/average/fast and tap save, the advanced section doesn't update thus I still have a network fee of $0.00. Is the value supposed to update after saving gas speed?

Seen here = https://recordit.co/c2F2d2tvA4

I'm sure the fix for one will ultimately fix issue 2 as they're related.

@ibrahimtaveras00 ibrahimtaveras00 added QA'd - Issues Found QA has been complete, however issues have been discovered that need to be addressed and removed needs-qa Any New Features that needs a full manual QA prior to being added to a release. labels Jun 5, 2020
@EtDu EtDu force-pushed the transaction-components branch from e5e48fe to bc18c92 Compare June 5, 2020 09:34
Copy link
Contributor

@ibrahimtaveras00 ibrahimtaveras00 left a comment

Choose a reason for hiding this comment

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

Fix looks good on both OS's, QA Passed 👍

@ibrahimtaveras00 ibrahimtaveras00 added QA Passed A successful QA run through has been done and removed QA'd - Issues Found QA has been complete, however issues have been discovered that need to be addressed labels Jun 5, 2020
Copy link
Contributor

@estebanmino estebanmino left a comment

Choose a reason for hiding this comment

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

🚀

@EtDu EtDu merged commit b41d78e into develop Jun 9, 2020
@EtDu EtDu deleted the transaction-components branch June 9, 2020 05:25
rickycodes pushed a commit that referenced this pull request Jan 31, 2022
* Locales: change Transaction fee to Network fee per design

* Confirm: Use TransactionReviewFeeCard, add primaryCurrency prop, add ETH transaction fee, move renderIfGasEstimationReady to TransactionReviewFeeCard, remove adjust transaction fee button, pass props to TransactionReviewFeeCard

* Create new TransactionReviewFeeCard component

* TransactionReviewFeeCard: fix proptypes, create snapshot test, update other snapshots

* Confirm: use slide up modal for custom gas

* Confirm: Remove CustomGas style wrappers into CustomGas component, make CustomGas the only child of Modal

* Locales: edit network fee, basic, save, cost explanation reword

* CustomGas: Implement redesign. Still need to modify styling of individual gas selectors

* CustomGas: fix gas selector styling

* snapshot update

* Approve: Use Modal in place of Action Modal, use updated CustomGas

* Confirm: add gasError prop to CustomGas

* CustomGas: disable save button if gas error

* CustomGas: Implement advanced options design

* update snapshot

* CustomGas: fix padding on non iphoneX devices

* Confirm: remove unused TransactionSummary

* CustomGas: remove double logic and empty styles

* Confirm: fix, change props.transactionState to state.transaction (merge conflict recovery)

* snapshot update

* SendFlow/CustomGas: fix button not disabling and error not showing when updating gas limit

* SendFlow/CustomGas: Fix #1473 crash when modifying gas limit if gas price is empty

* Confirm: add styles for ActionModal, use ActionModal

* SendFlow/CustomGas: modify styles, remove footer container

* ActionModal: add props

* ActionContent: add props

* Confirm + CutomGas: add ready state, pass down prop to change it, change it when CustomGas is ready so the button can be disabled

* Approve: add in ActionModal styles, use ActionModal

* snapshot update

* SendFlow/CustomGas: QA fix save not disabled on certain case

Co-authored-by: Ibrahim Taveras <ibrahimtaveras00@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
QA Passed A successful QA run through has been done
Projects
None yet
4 participants