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

[EIP1559] loading and update animations #2898

Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
c7c6fb0
Legacy gas mainnet working
andrepimenta Jul 6, 2021
2a6c857
eth_gasPrice working
andrepimenta Jul 6, 2021
9d7b93f
Prepare transaction
andrepimenta Jul 6, 2021
90ac794
Dapp transaction UI working
andrepimenta Jul 7, 2021
f93ad88
ERC20 dapp transaction ui working
andrepimenta Jul 7, 2021
cb76d6f
Approve UI working
andrepimenta Jul 8, 2021
358e5f8
Fix dapp transcation screen
andrepimenta Jul 8, 2021
4697ca0
Fix styles
andrepimenta Jul 8, 2021
0a7eac5
Prepare dapp transaction
andrepimenta Jul 8, 2021
f32eb77
Approve tokens prepare transaction
andrepimenta Jul 8, 2021
cbcd832
[EIP1559] validations (#2879)
andrepimenta Jul 10, 2021
edbcb0b
Add props description and refactor compute gas estimates
andrepimenta Jul 12, 2021
19d4b01
Merge branch 'feature/eip1559-base-edit-gas-fee-screen' into feature/…
andrepimenta Jul 12, 2021
b16a500
Fix merge typo
andrepimenta Jul 12, 2021
d5313c0
Convert to string and add new controller
andrepimenta Jul 12, 2021
862042c
Update controller, eip transactions working
andrepimenta Jul 12, 2021
a2a26bf
Dapp suggested EIP1559 gas
andrepimenta Jul 12, 2021
a5a9ac6
Move nonce to its own component and add some tests
andrepimenta Jul 12, 2021
1c6ef33
Ignore eip1559 gas suggestion when on legacy networks
andrepimenta Jul 12, 2021
a7f4b25
Update copy
andrepimenta Jul 12, 2021
31ddf43
Fix selected gas temp
andrepimenta Jul 13, 2021
a6d6c5f
Update tests
andrepimenta Jul 13, 2021
512a293
Fix approve
andrepimenta Jul 13, 2021
e6ddf01
Remove console.log
andrepimenta Jul 13, 2021
9e5abc9
Set gas limit if transaction does not have one already
andrepimenta Jul 13, 2021
51477b5
Export calculateEIP1559Times & ignoreOptions and recommend label
andrepimenta Jul 13, 2021
00db698
Update tests
andrepimenta Jul 13, 2021
048aa6a
warningMinimumEstimateOption & suggestedEstimateOption
andrepimenta Jul 13, 2021
c82fe26
Update tests
andrepimenta Jul 13, 2021
528f0fc
Initial update animations
andrepimenta Jul 14, 2021
48b51c4
Send flow update animation working
andrepimenta Jul 14, 2021
7c14054
Animation working on token allowance
andrepimenta Jul 14, 2021
546c693
Updating animation working on dapp transactions
andrepimenta Jul 14, 2021
8c0de5a
Start loading work
andrepimenta Jul 14, 2021
6e7780d
Loading finished
andrepimenta Jul 14, 2021
1ab8afd
Update tests
andrepimenta Jul 14, 2021
e9994d8
Add props description
andrepimenta Jul 14, 2021
92f7e70
Add props description
andrepimenta Jul 14, 2021
b339508
Update yarn and podfile lock
andrepimenta Jul 14, 2021
149dca2
Add missing package
andrepimenta Jul 14, 2021
df357dd
Animation values variables
andrepimenta Jul 14, 2021
c660c2d
Merge branch 'feature/eip1559-base-edit-gas-fee-screen' into feature/…
andrepimenta Jul 14, 2021
200299c
Update last snap
andrepimenta Jul 14, 2021
24bf5d6
Fix typo
andrepimenta Jul 15, 2021
400bf0c
Improving animationTime variable
andrepimenta Jul 15, 2021
3b20f4d
Fix Skeleton component
andrepimenta Jul 15, 2021
231c43e
Replace canAnimate with animateOnChange
andrepimenta Jul 15, 2021
79ed629
Update test
andrepimenta Jul 15, 2021
d91b56f
Fix going back to default gas limit
andrepimenta Jul 15, 2021
37906f0
Use transaction.gas
andrepimenta Jul 15, 2021
22dcdeb
Use fixed web3-provider-engine
andrepimenta Jul 15, 2021
4db9278
Bump web3-provider-engine
andrepimenta Jul 15, 2021
ab8645b
Try new yarn lock
andrepimenta Jul 15, 2021
75dd542
Fix style eip1559 transaction summary
andrepimenta Jul 15, 2021
dac59ef
Update snapshot
andrepimenta Jul 15, 2021
4f586d1
[EIP1559] Feature/UI gas speedup cancel (#2904)
andrepimenta Jul 15, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 45 additions & 8 deletions app/components/UI/ApproveTransactionReview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityI
import InfoModal from '../Swaps/components/InfoModal';
import Text from '../../Base/Text';
import TransactionReviewEIP1559 from '../../UI/TransactionReview/TransactionReviewEIP1559';
import FadeAnimationView from '../FadeAnimationView';

const { hexToBN } = util;
const styles = StyleSheet.create({
Expand Down Expand Up @@ -260,7 +261,23 @@ class ApproveTransactionReview extends PureComponent {
/**
* Estimate type returned by the gas fee controller, can be market-fee, legacy or eth_gasPrice
*/
gasEstimateType: PropTypes.string
gasEstimateType: PropTypes.string,
/**
* Function to call when update animation starts
*/
onUpdatingValuesStart: PropTypes.func,
/**
* Function to call when update animation ends
*/
onUpdatingValuesEnd: PropTypes.func,
/**
* If the values should animate upon update or not
*/
canAnimate: PropTypes.bool,
/**
* Boolean to determine if the animation is happening
*/
isAnimating: PropTypes.bool
};

state = {
Expand Down Expand Up @@ -540,7 +557,11 @@ class ApproveTransactionReview extends PureComponent {
warningGasPriceHigh,
EIP1559GasData,
LegacyGasData,
gasEstimateType
gasEstimateType,
onUpdatingValuesStart,
onUpdatingValuesEnd,
canAnimate,
isAnimating
} = this.props;
const is_main_net = isMainNet(network);
const originIsDeeplink = origin === ORIGIN_DEEPLINK || origin === ORIGIN_QR_CODE;
Expand All @@ -550,6 +571,11 @@ class ApproveTransactionReview extends PureComponent {
? strings('transaction.buy_more_eth')
: strings('transaction.get_ether', { networkName });

const showFeeMarket =
!gasEstimateType ||
gasEstimateType === GAS_ESTIMATE_TYPES.FEE_MARKET ||
gasEstimateType === GAS_ESTIMATE_TYPES.NONE;

return (
<>
<View style={styles.section} testID={'approve-screen'}>
Expand Down Expand Up @@ -585,7 +611,7 @@ class ApproveTransactionReview extends PureComponent {
<View style={styles.paddingHorizontal}>
<AccountInfoCard />
<View style={styles.section}>
{gasEstimateType === GAS_ESTIMATE_TYPES.FEE_MARKET ? (
{showFeeMarket ? (
<TransactionReviewEIP1559
totalNative={EIP1559GasData.renderableTotalMinNative}
totalConversion={EIP1559GasData.renderableTotalMinConversion}
Expand All @@ -600,9 +626,13 @@ class ApproveTransactionReview extends PureComponent {
hideTotal
noMargin
onEdit={this.edit}
onUpdatingValuesStart={onUpdatingValuesStart}
onUpdatingValuesEnd={onUpdatingValuesEnd}
canAnimate={canAnimate}
isAnimating={isAnimating}
/>
) : (
<TouchableOpacity onPress={this.edit}>
<TouchableOpacity onPress={this.edit} disabled={isAnimating}>
<View style={styles.networkFee}>
<Text reset style={styles.sectionLeft}>
{strings('transaction.transaction_fee')}
Expand All @@ -618,10 +648,17 @@ class ApproveTransactionReview extends PureComponent {
/>
</TouchableOpacity>
</Text>
<Text reset style={styles.sectionRight}>
{LegacyGasData.transactionFee} (
{LegacyGasData.transactionFeeFiat})
</Text>
<FadeAnimationView
onAnimationStart={onUpdatingValuesStart}
onAnimationEnd={onUpdatingValuesEnd}
canAnimate={canAnimate}
valueToWatch={LegacyGasData.transactionFee}
>
<Text reset style={styles.sectionRight}>
{LegacyGasData.transactionFee} (
{LegacyGasData.transactionFeeFiat})
</Text>
</FadeAnimationView>
<View style={styles.networkFeeArrow}>
<IonicIcon
name="ios-arrow-forward"
Expand Down
Loading