28 lines
1.3 KiB
JavaScript
28 lines
1.3 KiB
JavaScript
import React from 'react';
|
|
import { Alert, Form, Switch, InputNumber } from 'antd';
|
|
export default function render(props) {
|
|
const { offlineAccount } = props.data;
|
|
const { t } = props.methods;
|
|
if (offlineAccount) {
|
|
return (<Form labelCol={{ span: 6 }} wrapperCol={{ span: 12 }} layout="horizontal" style={{ minWidth: 600 }}>
|
|
<Alert type='info' message={t('tips')}/>
|
|
<Form.Item label={t('label.depositLoss')} help={t('placeholder.depositLoss')}>
|
|
<Switch value={config.depositLoss} onChange={(value) => {
|
|
config.depositLoss = value;
|
|
if (value === false) {
|
|
config.depositLossRatio = undefined;
|
|
}
|
|
update(config);
|
|
}}/>
|
|
</Form.Item>
|
|
{config.depositLoss &&
|
|
<Form.Item label={t('label.depositLossRatio')} help={t('placeholder.depositLossRatio')}>
|
|
<InputNumber value={config.depositLossRatio} max={5} min={0.01} addonAfter={"%"} step={0.01} precision={2} onChange={(value) => {
|
|
config.depositLossRatio = value;
|
|
update(config);
|
|
}}/>
|
|
</Form.Item>}
|
|
</Form>);
|
|
}
|
|
}
|