84 lines
2.3 KiB
TypeScript
Raw Normal View History

2018-03-30 13:38:52 +02:00
import { connect } from 'react-redux';
import React from 'react';
import { AppState } from 'reducers';
import { getCurrentScheduleType, ICurrentScheduleType } from 'selectors/transaction';
import {
WindowSizeField,
TimeBountyField,
WindowStartField,
ScheduleGasPriceField,
2018-03-31 10:56:45 +02:00
ScheduleGasLimitField,
ScheduleDepositField
2018-03-30 13:38:52 +02:00
} from '.';
import { ScheduleTimezoneDropDown, ScheduleTimestampField, ScheduleType } from 'components';
import './ScheduleFields.scss';
interface Props {
schedulingType: ICurrentScheduleType;
}
class ScheduleFieldsClass extends React.Component<Props> {
public render() {
const { schedulingType } = this.props;
return (
<div className="scheduled-tx-settings">
<div className="scheduled-tx-settings_title">Scheduled Transaction Settings</div>
<br />
2018-03-31 10:56:45 +02:00
<div className="row form-group vcenter-sm">
2018-04-02 13:34:07 +02:00
<div className="col-lg-3 col-lg-push-9">
2018-03-30 13:38:52 +02:00
<ScheduleType />
2018-04-02 13:34:07 +02:00
<hr className="hidden-lg" />
2018-03-30 13:38:52 +02:00
</div>
{schedulingType.value === 'time' && (
<>
2018-04-02 13:34:07 +02:00
<div className="col-md-5 col-lg-3 col-lg-pull-3">
2018-03-30 13:38:52 +02:00
<ScheduleTimestampField />
</div>
2018-04-02 13:34:07 +02:00
<div className="col-md-4 col-lg-3 col-lg-pull-3">
2018-03-30 13:38:52 +02:00
<ScheduleTimezoneDropDown />
</div>
</>
)}
{schedulingType.value === 'block' && (
<>
2018-04-02 13:34:07 +02:00
<div className="col-md-9 col-lg-6 col-lg-pull-3">
2018-03-30 13:38:52 +02:00
<WindowStartField />
</div>
</>
)}
<div className="col-md-3 col-lg-3 col-lg-pull-3">
2018-03-30 13:38:52 +02:00
<WindowSizeField />
</div>
</div>
<div className="row form-group">
<div className="col-xs-6">
<TimeBountyField />
</div>
2018-03-31 10:56:45 +02:00
<div className="col-xs-6">
<ScheduleDepositField />
</div>
</div>
<div className="row form-group">
<div className="col-xs-6">
2018-03-30 13:38:52 +02:00
<ScheduleGasPriceField />
</div>
<div className="col-xs-6">
2018-03-30 13:38:52 +02:00
<ScheduleGasLimitField />
</div>
</div>
</div>
);
}
}
export const ScheduleFields = connect((state: AppState) => ({
schedulingType: getCurrentScheduleType(state)
}))(ScheduleFieldsClass);