mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-26 02:49:02 +00:00
16469e1a62
* Fixes #1291. Implemented a new boolean that allows you to toggle whether you are using a disabled send tx button that persists or a send tx button that remains invisible until a valid transaction is present. * Fixed object shorthand precommit error. * Cleanup boolean logic, remove redundant code, make comparision elements more obvious
26 lines
896 B
TypeScript
26 lines
896 B
TypeScript
import React from 'react';
|
|
import { SendButtonFactory } from './SendButtonFactory';
|
|
import translate from 'translations';
|
|
import { ConfirmationModal } from 'components/ConfirmationModal';
|
|
|
|
export const SendButton: React.SFC<{
|
|
onlyTransactionParameters?: boolean;
|
|
toggleDisabled?: boolean;
|
|
customModal?: typeof ConfirmationModal;
|
|
}> = ({ onlyTransactionParameters, toggleDisabled, customModal }) => (
|
|
<SendButtonFactory
|
|
onlyTransactionParameters={!!onlyTransactionParameters}
|
|
toggleDisabled={toggleDisabled}
|
|
Modal={customModal ? customModal : ConfirmationModal}
|
|
withProps={({ disabled, onClick }) => (
|
|
<div className="row form-group">
|
|
<div className="col-xs-12">
|
|
<button disabled={disabled} className="btn btn-primary btn-block" onClick={onClick}>
|
|
{translate('SEND_trans')}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
)}
|
|
/>
|
|
);
|