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

Dapp Transaction Confirmation Re-designs #1559

Merged
merged 54 commits into from
Jul 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
8d55df4
Nav/Main: dappTransactionModalVisible in state & toggleDappTransactio…
EtDu May 12, 2020
c7b8405
Approval: stop using navigation API, instead hide or show the modal. …
EtDu May 12, 2020
03e23c0
TransactionEditor: use react fragment in place of view, remove styles
EtDu May 12, 2020
81bfb08
Approval: move out TransactionHeader and root style
EtDu May 12, 2020
48dc0a6
TransactionEditor: move in root styles, different for txEdit and txRe…
EtDu May 12, 2020
d9f767d
TransactionReview: Use TransactionHeader, remove ActionView
EtDu May 12, 2020
51095c7
TransactionReviewSummary: use WarningMessage component
EtDu May 12, 2020
7fa9e43
TransactionReviewSummary: styling for function indicator and amount s…
EtDu May 12, 2020
7a75020
TransactionReviewSummary: remove flex style, fix paddings
EtDu May 12, 2020
9bb4547
TransactionReview: use AccountInfoCard
EtDu May 12, 2020
dfa8f7a
Fix merge glitches
EtDu May 14, 2020
70302a5
TransactionReview: take state and functionality from TransactionRevie…
EtDu May 14, 2020
955656d
TransactionReviewFeeCard: use padding instead of width percentage
EtDu May 15, 2020
d569529
TransactionReview: remove renderTransactionDetails, render Transactio…
EtDu May 15, 2020
6c70e0f
TransactionReviewSummary: fix proptypes
EtDu May 15, 2020
e4a802c
TransactionReviewInformation: remove overview style, fix styles for e…
EtDu May 15, 2020
70abf96
TransactionReviewInformation: add View Data button
EtDu May 15, 2020
b1ff3c4
TransactionReview: toggleDataView & dataVisible in state, render revi…
EtDu May 15, 2020
93c6cde
TransactionReview: change toggleDataView to arrow fn
EtDu May 15, 2020
467541c
Locales: add transaction.view_data
EtDu May 15, 2020
2af2191
TransactionReviewInformation: fix touch area for view data button
EtDu May 16, 2020
b8a5a78
TransactionReview: re-add ActionView, fix it's height based on screen…
EtDu May 16, 2020
6dc38b9
TransactionEditor: ensure dynamic modal height
EtDu May 16, 2020
9756ad8
Locales: add review_data, data, review_function
EtDu May 16, 2020
4a8656c
TransactionReviewData: implement design, use toggleDataView from prop…
EtDu May 16, 2020
434c78c
TransactionReview: use TransactionReviewData, pass toggleDataView to …
EtDu May 16, 2020
a1a0aae
TransactionEdit: strip down, remove everything and render CustomGas w…
EtDu May 17, 2020
c701b79
UI/CustomGas: fix styling + logic to mimic SendFlow/CustomGas, only h…
EtDu May 17, 2020
47d0033
CustomGas: fix loader
EtDu May 17, 2020
a020395
SendFlow/CustomGas: Add comment for fix in transaction-components
EtDu May 19, 2020
746bcc6
locales: add custom_gas.total
EtDu May 19, 2020
6abc54c
UI/CustomGas: use local error validation, only handle gas fee on save…
EtDu May 19, 2020
fce26c1
snapshot/test updates
EtDu May 19, 2020
6da42f7
Approval: fix lint error
EtDu May 19, 2020
6fc47bd
TransactionReviewSummary: change primary value based on primary currency
EtDu May 19, 2020
54813da
TransactionReview: pass props to TransactionReviewSummary
EtDu May 19, 2020
9716ff1
snapshots & tests
EtDu May 19, 2020
1bdced0
UI/CustomGas: fix custom gas selector button locking if initial NSF e…
EtDu May 19, 2020
87b422a
snapshot
EtDu May 19, 2020
8ade2c1
TransactionEdit: can change mode to review even if gas error (namely …
EtDu May 22, 2020
fdbdd48
snapshot gravy
EtDu May 28, 2020
f76d6d6
Feedback updates
EtDu May 28, 2020
bb3e228
Design fixes
EtDu May 28, 2020
1b82428
locales: change data description text
EtDu May 29, 2020
3a126d8
snapshot
EtDu May 29, 2020
c5bf08b
TransactionReviewData: add Hex data title
EtDu Jun 25, 2020
1702023
locales: change hex data
EtDu Jun 25, 2020
2554214
snapshot update yo
EtDu Jun 25, 2020
47887a3
CustomGas: remove redundant setstate calls
EtDu Jun 25, 2020
13dceb6
TransactionReview: tweak style of hex data and add bold text
EtDu Jun 26, 2020
f8b9663
TransactionReviewFeeCard: fix rendering problem with ERC20 tokens, to…
EtDu Jun 26, 2020
7e5f4b4
snapshot updatessss
EtDu Jun 26, 2020
e1c0f24
Send, Nav/Main: move toggleDappTransactionModal & dappTransactionModa…
EtDu Jul 2, 2020
4f6d250
Fix stubborn tab/spacing lint error
EtDu Jul 5, 2020
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
6 changes: 6 additions & 0 deletions app/actions/modals/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,9 @@ export function toggleReceiveModal(asset) {
asset
};
}

export function toggleDappTransactionModal() {
return {
type: 'TOGGLE_DAPP_TRANSACTION_MODAL'
};
}
27 changes: 22 additions & 5 deletions app/components/Nav/Main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ import {
hideTransactionNotification,
showSimpleNotification
} from '../../../actions/notification';
import { toggleDappTransactionModal } from '../../../actions/modals';
import AccountApproval from '../../UI/AccountApproval';

const styles = StyleSheet.create({
Expand Down Expand Up @@ -439,9 +440,16 @@ class Main extends PureComponent {
/**
* Indicates whether third party API mode is enabled
*/
thirdPartyApiMode: PropTypes.bool
thirdPartyApiMode: PropTypes.bool,
/**
/* Hides or shows dApp transaction modal
*/
toggleDappTransactionModal: PropTypes.func,
/**
/* dApp transaction modal visible or not
*/
dappTransactionModalVisible: PropTypes.bool
};

state = {
connected: true,
forceReload: false,
Expand Down Expand Up @@ -816,7 +824,7 @@ class Main extends PureComponent {
if (data && data.substr(0, 10) === APPROVE_FUNCTION_SIGNATURE) {
this.props.navigation.push('ApproveView');
} else {
this.props.navigation.push('ApprovalView');
this.props.toggleDappTransactionModal();
}
}
};
Expand Down Expand Up @@ -1050,6 +1058,12 @@ class Main extends PureComponent {
backupAlertPress = () => {
this.props.navigation.navigate('AccountBackupStep1');
};
renderDappTransactionModal = () => (
<Approval
dappTransactionModalVisible={this.props.dappTransactionModalVisible}
toggleDappTransactionModal={this.props.toggleDappTransactionModal}
/>
);

render() {
const { isPaymentChannelTransaction, isPaymentRequest } = this.props;
Expand All @@ -1072,6 +1086,7 @@ class Main extends PureComponent {
</View>
{this.renderSigningModal()}
{this.renderWalletConnectSessionRequestModal()}
{this.props.dappTransactionModalVisible && this.renderDappTransactionModal()}
</React.Fragment>
);
}
Expand All @@ -1087,15 +1102,17 @@ const mapStateToProps = state => ({
providerType: state.engine.backgroundState.NetworkController.provider.type,
isPaymentChannelTransaction: state.transaction.paymentChannelTransaction,
isPaymentRequest: state.transaction.paymentRequest,
identities: state.engine.backgroundState.PreferencesController.identities
identities: state.engine.backgroundState.PreferencesController.identities,
dappTransactionModalVisible: state.modals.dappTransactionModalVisible
});

const mapDispatchToProps = dispatch => ({
setEtherTransaction: transaction => dispatch(setEtherTransaction(transaction)),
setTransactionObject: transaction => dispatch(setTransactionObject(transaction)),
showTransactionNotification: args => dispatch(showTransactionNotification(args)),
showSimpleNotification: args => dispatch(showSimpleNotification(args)),
hideTransactionNotification: () => dispatch(hideTransactionNotification())
hideTransactionNotification: () => dispatch(hideTransactionNotification()),
toggleDappTransactionModal: () => dispatch(toggleDappTransactionModal())
});

export default connect(
Expand Down
14 changes: 10 additions & 4 deletions app/components/UI/CustomGas/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ exports[`CustomGas should render correctly 1`] = `
<View
style={
Object {
"flex": 1,
"alignItems": "center",
"backgroundColor": "#FFFFFF",
"height": 200,
"justifyContent": "center",
}
}
>
<Text>
Loading...
</Text>
<ActivityIndicator
animating={true}
color="#999999"
hidesWhenStopped={true}
size="small"
/>
</View>
`;
Loading