2020-07-10 08:30:52 +03:00
|
|
|
import * as React from "react";
|
|
|
|
import * as Constants from "~/common/constants";
|
|
|
|
|
2020-07-21 03:05:45 +03:00
|
|
|
import { Input } from "~/components/system/components/Input";
|
|
|
|
import {
|
|
|
|
ButtonPrimaryFull,
|
|
|
|
} from "~/components/system/components/Buttons";
|
2020-07-10 08:30:52 +03:00
|
|
|
import { css } from "@emotion/react";
|
|
|
|
|
|
|
|
const STYLES_CONTAINER = css`
|
|
|
|
font-family: ${Constants.font.text};
|
|
|
|
box-sizing: border-box;
|
|
|
|
padding: 24px;
|
|
|
|
border-radius: 4px;
|
|
|
|
background-color: ${Constants.system.white};
|
|
|
|
border: 1px solid ${Constants.system.border};
|
|
|
|
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
|
|
|
|
max-width: 320px;
|
|
|
|
width: 100%;
|
|
|
|
`;
|
|
|
|
|
|
|
|
export class SendAddressFilecoin extends React.Component {
|
|
|
|
static defaultProps = {
|
|
|
|
onSubmit: () => {},
|
|
|
|
};
|
|
|
|
|
|
|
|
state = {
|
|
|
|
source: "",
|
|
|
|
target: "",
|
|
|
|
amount: "",
|
|
|
|
};
|
|
|
|
|
|
|
|
_handleChange = (e) => {
|
|
|
|
this.setState({ [e.target.name]: e.target.value });
|
|
|
|
};
|
|
|
|
|
|
|
|
_handleSubmit = () => {
|
|
|
|
this.props.onSubmit({
|
|
|
|
...this.state,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div css={STYLES_CONTAINER}>
|
2020-07-21 03:05:45 +03:00
|
|
|
<Input
|
2020-07-10 08:30:52 +03:00
|
|
|
label="From"
|
|
|
|
name="source"
|
|
|
|
value={this.state.source}
|
|
|
|
onChange={this._handleChange}
|
|
|
|
/>
|
|
|
|
|
2020-07-21 03:05:45 +03:00
|
|
|
<Input
|
2020-07-10 08:30:52 +03:00
|
|
|
containerStyle={{ marginTop: 24 }}
|
|
|
|
label="To"
|
|
|
|
name="target"
|
|
|
|
value={this.state.target}
|
|
|
|
onChange={this._handleChange}
|
|
|
|
/>
|
|
|
|
|
2020-07-21 03:05:45 +03:00
|
|
|
<Input
|
2020-07-10 08:30:52 +03:00
|
|
|
containerStyle={{ marginTop: 24 }}
|
|
|
|
label="Amount (Filecoin)"
|
|
|
|
name="amount"
|
|
|
|
type="number"
|
|
|
|
value={this.state.amount}
|
|
|
|
onChange={this._handleChange}
|
|
|
|
/>
|
|
|
|
|
2020-07-21 03:05:45 +03:00
|
|
|
<ButtonPrimaryFull
|
2020-07-10 08:30:52 +03:00
|
|
|
style={{ marginTop: 48 }}
|
|
|
|
onClick={this._handleSubmit}
|
|
|
|
>
|
|
|
|
Send {this.state.amount} FIL
|
2020-07-21 03:05:45 +03:00
|
|
|
</ButtonPrimaryFull>
|
2020-07-10 08:30:52 +03:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|