|
|
@ -28,8 +28,7 @@ export default function EditGasDisplay({ |
|
|
|
alwaysShowForm = false, |
|
|
|
alwaysShowForm = false, |
|
|
|
showEducationButton = false, |
|
|
|
showEducationButton = false, |
|
|
|
onEducationClick, |
|
|
|
onEducationClick, |
|
|
|
dappSuggestedGasFee = 0, |
|
|
|
transaction, |
|
|
|
dappOrigin = '', |
|
|
|
|
|
|
|
defaultEstimateToUse, |
|
|
|
defaultEstimateToUse, |
|
|
|
maxPriorityFeePerGas, |
|
|
|
maxPriorityFeePerGas, |
|
|
|
setMaxPriorityFeePerGas, |
|
|
|
setMaxPriorityFeePerGas, |
|
|
@ -61,7 +60,7 @@ export default function EditGasDisplay({ |
|
|
|
const t = useContext(I18nContext); |
|
|
|
const t = useContext(I18nContext); |
|
|
|
|
|
|
|
|
|
|
|
const requireDappAcknowledgement = Boolean( |
|
|
|
const requireDappAcknowledgement = Boolean( |
|
|
|
dappSuggestedGasFee && !dappSuggestedGasFeeAcknowledged, |
|
|
|
transaction?.dappSuggestedGasFees && !dappSuggestedGasFeeAcknowledged, |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
@ -79,7 +78,8 @@ export default function EditGasDisplay({ |
|
|
|
<div className="edit-gas-display__dapp-acknowledgement-warning"> |
|
|
|
<div className="edit-gas-display__dapp-acknowledgement-warning"> |
|
|
|
<ActionableMessage |
|
|
|
<ActionableMessage |
|
|
|
className="actionable-message--warning" |
|
|
|
className="actionable-message--warning" |
|
|
|
message={t('gasDisplayDappWarning', [dappOrigin])} |
|
|
|
message={t('gasDisplayDappWarning', [transaction.dappOrigin])} |
|
|
|
|
|
|
|
iconFillColor="#f8c000" |
|
|
|
useIcon |
|
|
|
useIcon |
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -164,7 +164,7 @@ export default function EditGasDisplay({ |
|
|
|
onChange={setEstimateToUse} |
|
|
|
onChange={setEstimateToUse} |
|
|
|
/> |
|
|
|
/> |
|
|
|
)} |
|
|
|
)} |
|
|
|
{!alwaysShowForm && ( |
|
|
|
{!alwaysShowForm && !requireDappAcknowledgement && ( |
|
|
|
<button |
|
|
|
<button |
|
|
|
className="edit-gas-display__advanced-button" |
|
|
|
className="edit-gas-display__advanced-button" |
|
|
|
onClick={() => setShowAdvancedForm(!showAdvancedForm)} |
|
|
|
onClick={() => setShowAdvancedForm(!showAdvancedForm)} |
|
|
@ -217,8 +217,6 @@ EditGasDisplay.propTypes = { |
|
|
|
mode: PropTypes.oneOf(Object.values(EDIT_GAS_MODES)), |
|
|
|
mode: PropTypes.oneOf(Object.values(EDIT_GAS_MODES)), |
|
|
|
showEducationButton: PropTypes.bool, |
|
|
|
showEducationButton: PropTypes.bool, |
|
|
|
onEducationClick: PropTypes.func, |
|
|
|
onEducationClick: PropTypes.func, |
|
|
|
dappSuggestedGasFee: PropTypes.number, |
|
|
|
|
|
|
|
dappOrigin: PropTypes.string, |
|
|
|
|
|
|
|
defaultEstimateToUse: PropTypes.oneOf(Object.values(GAS_RECOMMENDATIONS)), |
|
|
|
defaultEstimateToUse: PropTypes.oneOf(Object.values(GAS_RECOMMENDATIONS)), |
|
|
|
maxPriorityFeePerGas: PropTypes.string, |
|
|
|
maxPriorityFeePerGas: PropTypes.string, |
|
|
|
setMaxPriorityFeePerGas: PropTypes.func, |
|
|
|
setMaxPriorityFeePerGas: PropTypes.func, |
|
|
@ -246,4 +244,5 @@ EditGasDisplay.propTypes = { |
|
|
|
showAdvancedForm: PropTypes.bool, |
|
|
|
showAdvancedForm: PropTypes.bool, |
|
|
|
setShowAdvancedForm: PropTypes.func, |
|
|
|
setShowAdvancedForm: PropTypes.func, |
|
|
|
warning: PropTypes.string, |
|
|
|
warning: PropTypes.string, |
|
|
|
|
|
|
|
transaction: PropTypes.object, |
|
|
|
}; |
|
|
|
}; |
|
|
|