-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Transaction components #1512
Conversation
primaryCurrency = FIAT
primaryCurrency = ETH
@cjeria is this what you had in mind? |
900e7a0
to
f18248d
Compare
buttonNext: { | ||
flex: 1 | ||
}, | ||
radio: {} |
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.
I think you can remove this
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.
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) { |
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.
isn't this equivalent to if (warningGasPrice)
?
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.
Yes, double logic at its finest
} | ||
return ( | ||
<View style={styles.warningWrapper}> | ||
<View style={[styles.warningTextWrapper, !gasError ? styles.invisible : null]}> |
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.
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
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.
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
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.
added small comments, looks good!
8a38295
to
dd4ed7a
Compare
90a451b
to
d48dc94
Compare
d48dc94
to
e7c03ea
Compare
confirmDisabled={!!gasError} | ||
cancelButtonMode={'neutral'} | ||
confirmButtonMode={'confirm'} | ||
<Modal |
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.
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
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.
I mean is working and already approved, but I think we can reuse things here
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.
Cool, resolved
8d783bb
to
18a47ff
Compare
…ETH transaction fee, move renderIfGasEstimationReady to TransactionReviewFeeCard, remove adjust transaction fee button, pass props to TransactionReviewFeeCard
…ge conflict recovery)
…en updating gas limit
…rice is empty
…nge it when CustomGas is ready so the button can be disabled
1900922
to
7b77976
Compare
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.
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
When I tap send, I then get the error
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.
e5e48fe
to
bc18c92
Compare
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.
Fix looks good on both OS's, QA Passed 👍
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.
🚀
* 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>
Description
Create components for transactions created from dApps redesign. #1501
Checklist
TransactionReviewFeeCard
componentTransactionReviewFeeCard
create snapshot testConfirm
: UseTransactionReviewFeeCard
CustomGas
: implement custom gas modal redesignConfirm
&Approve
: use newCustomGas
Issue
Resolves #1497
Resolves #1500
Resolves #1473