-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improvement/tx status notification (#1475)
* simple not update * text update * wip * delete old details * delete old confirm * almost done withtx details * modal working * modal title * rm transfer element * clean * fix transfer * transfer and payment channel * decodeTransferFromTx * decodeDeploymentTx * decodeConfirmTx * onpress * status * close on view web * more cleanup * payment * showing not * closer? * comment * tx details and not * animated * tx not * enable access view on not * animated * rename * using txnnot manager * working * receive * rm unused * rm logs * handle browser not * parse date * handle asset details * tx summary rename props * Refactor names in details * handle primary currency * missing props * almost there * working but browser * finally * one more thing * done * snaps * missing locales * update ethereum address * snaps * handle instapay txs * snaps * feeless tx * data check * No fee * instance._hideTransactionNotification * fix instapay notifications * elevation * fix remaining issues * apeed up cancel * transaction modal * speed cancel * speedup cancel ui * working * added engine methods * done * snaps * fix qaing * fix ios build * one snap * remove test * status text fix * cancelled * margin * snaps * fix insufficient funds * doc
- Loading branch information
1 parent
ecb7747
commit 94b0a2e
Showing
35 changed files
with
2,219 additions
and
1,988 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export function hideTransactionNotification() { | ||
return { | ||
type: 'HIDE_TRANSACTION_NOTIFICATION' | ||
}; | ||
} | ||
|
||
export function showTransactionNotification({ autodismiss, transaction, status }) { | ||
return { | ||
type: 'SHOW_TRANSACTION_NOTIFICATION', | ||
isVisible: true, | ||
autodismiss, | ||
transaction, | ||
status | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { StyleSheet, View } from 'react-native'; | ||
import { colors } from '../../../../styles/common'; | ||
import StyledButton from '../../StyledButton'; | ||
import { strings } from '../../../../../locales/i18n'; | ||
|
||
const styles = StyleSheet.create({ | ||
viewWrapper: { | ||
flexDirection: 'column', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
marginHorizontal: 24 | ||
}, | ||
viewContainer: { | ||
width: '100%', | ||
backgroundColor: colors.white, | ||
borderRadius: 10 | ||
}, | ||
actionContainer: { | ||
borderTopColor: colors.grey200, | ||
borderTopWidth: 1, | ||
flexDirection: 'row', | ||
padding: 16 | ||
}, | ||
childrenContainer: { | ||
minHeight: 250, | ||
width: '100%', | ||
|
||
flexDirection: 'row', | ||
alignItems: 'center' | ||
}, | ||
button: { | ||
flex: 1 | ||
}, | ||
cancel: { | ||
marginRight: 8 | ||
}, | ||
confirm: { | ||
marginLeft: 8 | ||
} | ||
}); | ||
|
||
/** | ||
* View that renders the content of an action modal | ||
* The objective of this component is to reuse it in other places and not | ||
* only on ActionModal component | ||
*/ | ||
export default function ActionContent({ | ||
cancelTestID, | ||
confirmTestID, | ||
cancelText, | ||
children, | ||
confirmText, | ||
confirmDisabled, | ||
cancelButtonMode, | ||
confirmButtonMode, | ||
displayCancelButton, | ||
displayConfirmButton, | ||
onCancelPress, | ||
onConfirmPress | ||
}) { | ||
return ( | ||
<View style={styles.viewWrapper}> | ||
<View style={styles.viewContainer}> | ||
<View style={styles.childrenContainer}>{children}</View> | ||
<View style={styles.actionContainer}> | ||
{displayCancelButton && ( | ||
<StyledButton | ||
testID={cancelTestID} | ||
type={cancelButtonMode} | ||
onPress={onCancelPress} | ||
containerStyle={[styles.button, displayConfirmButton ? styles.cancel : {}]} | ||
> | ||
{cancelText} | ||
</StyledButton> | ||
)} | ||
{displayConfirmButton && ( | ||
<StyledButton | ||
testID={confirmTestID} | ||
type={confirmButtonMode} | ||
onPress={onConfirmPress} | ||
containerStyle={[styles.button, displayCancelButton ? styles.confirm : {}]} | ||
disabled={confirmDisabled} | ||
> | ||
{confirmText} | ||
</StyledButton> | ||
)} | ||
</View> | ||
</View> | ||
</View> | ||
); | ||
} | ||
|
||
ActionContent.defaultProps = { | ||
cancelButtonMode: 'neutral', | ||
confirmButtonMode: 'warning', | ||
confirmTestID: '', | ||
cancelTestID: '', | ||
cancelText: strings('action_view.cancel'), | ||
confirmText: strings('action_view.confirm'), | ||
confirmDisabled: false, | ||
displayCancelButton: true, | ||
displayConfirmButton: true | ||
}; | ||
|
||
ActionContent.propTypes = { | ||
/** | ||
* TestID for the cancel button | ||
*/ | ||
cancelTestID: PropTypes.string, | ||
/** | ||
* TestID for the confirm button | ||
*/ | ||
confirmTestID: PropTypes.string, | ||
/** | ||
* Text to show in the cancel button | ||
*/ | ||
cancelText: PropTypes.string, | ||
/** | ||
* Content to display above the action buttons | ||
*/ | ||
children: PropTypes.node, | ||
/** | ||
* Type of button to show as the cancel button | ||
*/ | ||
cancelButtonMode: PropTypes.oneOf(['cancel', 'neutral', 'confirm', 'normal']), | ||
/** | ||
* Type of button to show as the confirm button | ||
*/ | ||
confirmButtonMode: PropTypes.oneOf(['normal', 'confirm', 'warning']), | ||
/** | ||
* Whether confirm button is disabled | ||
*/ | ||
confirmDisabled: PropTypes.bool, | ||
/** | ||
* Text to show in the confirm button | ||
*/ | ||
confirmText: PropTypes.string, | ||
/** | ||
* Whether cancel button should be displayed | ||
*/ | ||
displayCancelButton: PropTypes.bool, | ||
/** | ||
* Whether confirm button should be displayed | ||
*/ | ||
displayConfirmButton: PropTypes.bool, | ||
/** | ||
* Called when the cancel button is clicked | ||
*/ | ||
onCancelPress: PropTypes.func, | ||
/** | ||
* Called when the confirm button is clicked | ||
*/ | ||
onConfirmPress: PropTypes.func | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.