Layout cleanup

This commit is contained in:
Hendrik Hofstadt 2020-08-20 18:59:58 +02:00
parent ebdafacf0e
commit 9d6f8cde0e
2 changed files with 12 additions and 11 deletions

View File

@ -189,15 +189,15 @@ function Transfer() {
} else { } else {
approveAssets(values["address"], transferAmount) approveAssets(values["address"], transferAmount)
} }
}} style={{width: "100%"}} ref={formRef}> }} style={{width: "100%"}} ref={formRef} layout={"vertical"}>
<Form.Item name="address" validateStatus={addressValid ? "success" : "error"}> <Form.Item name="address" validateStatus={addressValid ? "success" : "error"} label={"Token:"}>
<Input addonAfter={`Balance: ${coinInfo.balance}`} name="address" <Input addonAfter={`Balance: ${coinInfo.balance}`} name="address"
placeholder={"ERC20 address"} placeholder={"ERC20 address"}
onBlur={(v) => { onBlur={(v) => {
setAddress(v.target.value) setAddress(v.target.value)
}}/> }}/>
</Form.Item> </Form.Item>
<Form.Item name="amount" validateStatus={amountValid ? "success" : "error"}> <Form.Item name="amount" validateStatus={amountValid ? "success" : "error"} label={"Amount:"}>
<InputNumber name={"amount"} placeholder={"Amount"} type={"number"} min={0} <InputNumber name={"amount"} placeholder={"Amount"} type={"number"} min={0}
onChange={value => { onChange={value => {
// @ts-ignore // @ts-ignore
@ -205,7 +205,7 @@ function Transfer() {
}}/> }}/>
</Form.Item> </Form.Item>
<Form.Item name="target_chain" <Form.Item name="target_chain"
rules={[{required: true, message: "Please choose a target chain"}]}> label={"Target Chain:"}>
<Select placeholder="Target Chain" defaultValue={1}> <Select placeholder="Target Chain" defaultValue={1}>
<Select.Option value={1}> <Select.Option value={1}>
Solana Solana
@ -213,14 +213,14 @@ function Transfer() {
</Select> </Select>
</Form.Item> </Form.Item>
<Form.Item name="recipient" validateStatus={solanaAccount.valid ? "success" : "error"} <Form.Item name="recipient" validateStatus={solanaAccount.valid ? "success" : "error"}
help={recipient === "" ? undefined : solanaAccount.message}> help={recipient === "" ? undefined : solanaAccount.message} label={"Recipient"}>
<Input name="recipient" placeholder={"Address of the recipient"} <Input name="recipient" placeholder={"Address of the recipient"}
onFocus={(v) => { onFocus={(v) => {
setRecipient(v.target.value) setRecipient(v.target.value)
}}/> }}/>
</Form.Item> </Form.Item>
<Form.Item> <Form.Item>
<Button type="primary" htmlType="submit"> <Button type="primary" htmlType="submit" style={{marginLeft:"auto"}}>
{coinInfo.allowance.gte(amount) || coinInfo.isWrapped ? "Transfer" : "Approve"} {coinInfo.allowance.gte(amount) || coinInfo.isWrapped ? "Transfer" : "Approve"}
</Button> </Button>
</Form.Item> </Form.Item>

View File

@ -91,8 +91,8 @@ function TransferSolana() {
} }
} }
send() send()
}}> }} layout={"vertical"} >
<Form.Item name="address" validateStatus={addressValid ? "success" : "error"}> <Form.Item name="address" validateStatus={addressValid ? "success" : "error"} label={"Token Account:"}>
<Input <Input
addonAfter={`Balance: ${coinInfo.balance.div(new BigNumber(Math.pow(10, coinInfo.decimals)))}`} addonAfter={`Balance: ${coinInfo.balance.div(new BigNumber(Math.pow(10, coinInfo.decimals)))}`}
name="address" name="address"
@ -106,14 +106,15 @@ function TransferSolana() {
let big = new BigNumber(value).mul(new BigNumber(10).pow(coinInfo.decimals)); let big = new BigNumber(value).mul(new BigNumber(10).pow(coinInfo.decimals));
callback(big.lte(coinInfo.balance) ? undefined : "Amount exceeds balance") callback(big.lte(coinInfo.balance) ? undefined : "Amount exceeds balance")
} }
}]}> }]} label={"Amount:"}>
<InputNumber name={"amount"} placeholder={"Amount"} type={"number"} onChange={value => { <InputNumber name={"amount"} placeholder={"Amount"} type={"number"} onChange={value => {
// @ts-ignore // @ts-ignore
setAmount(value || 0) setAmount(value || 0)
}}/> }}/>
</Form.Item> </Form.Item>
<Form.Item name="target_chain" <Form.Item name="target_chain"
rules={[{required: true, message: "Please choose a target chain"}]}> rules={[{required: true, message: "Please choose a target chain"}]}
label={"Target Chain:"}>
<Select placeholder="Target Chain" defaultValue={2}> <Select placeholder="Target Chain" defaultValue={2}>
<Select.Option value={2}> <Select.Option value={2}>
Ethereum Ethereum
@ -129,7 +130,7 @@ function TransferSolana() {
callback() callback()
} }
} }
}]}> }]} label={"Recipient:"}>
<Input name="recipient" placeholder={"Address of the recipient"}/> <Input name="recipient" placeholder={"Address of the recipient"}/>
</Form.Item> </Form.Item>
<Form.Item> <Form.Item>