MyCrypto/common/components/GenerateTransaction.tsx

33 lines
1005 B
TypeScript
Raw Normal View History

import { GenerateTransactionFactory } from './GenerateTransactionFactory';
import React from 'react';
import translate from 'translations';
import { ScheduleTransactionFactory } from './ScheduleTransactionFactory';
interface Props {
scheduling?: boolean;
}
export const GenerateTransaction: React.SFC<Props> = props => {
if (props.scheduling) {
return (
<ScheduleTransactionFactory
withProps={({ disabled, isWeb3Wallet, onClick }) => (
<button disabled={disabled} className="btn btn-info btn-block" onClick={onClick}>
{isWeb3Wallet ? translate('SCHEDULE_schedule') : translate('DEP_signtx')}
</button>
)}
/>
);
}
return (
<GenerateTransactionFactory
withProps={({ disabled, isWeb3Wallet, onClick }) => (
<button disabled={disabled} className="btn btn-info btn-block" onClick={onClick}>
{isWeb3Wallet ? translate('SEND_generate') : translate('DEP_signtx')}
</button>
)}
/>
);
};