Commit ef9c645e authored by Amaury Martiny's avatar Amaury Martiny

Use FetherForm on account creation

parent aca77973
Pipeline #44259 canceled with stages
......@@ -4,7 +4,7 @@
// SPDX-License-Identifier: BSD-3-Clause
import React, { Component } from 'react';
import { AccountCard, Card, FormField } from 'fether-ui';
import { AccountCard, Card, Form as FetherForm } from 'fether-ui';
import Blockies from 'react-blockies';
import { inject, observer } from 'mobx-react';
import { Link } from 'react-router-dom';
......@@ -79,7 +79,7 @@ class AccountName extends Component {
<div className='text'>
<p>Please give this account a name:</p>
</div>
<FormField
<FetherForm.Field
label='Name'
onChange={this.handleChangeName}
required
......
......@@ -4,7 +4,7 @@
// SPDX-License-Identifier: BSD-3-Clause
import React, { Component } from 'react';
import { AccountCard, FormField } from 'fether-ui';
import { AccountCard, Form as FetherForm } from 'fether-ui';
import { inject, observer } from 'mobx-react';
@inject('createAccountStore')
......@@ -55,7 +55,7 @@ class AccountPassword extends Component {
<p>Secure your account with a password:</p>
</div>
<FormField
<FetherForm.Field
label='Password'
onChange={this.handlePasswordChange}
required
......@@ -63,7 +63,7 @@ class AccountPassword extends Component {
value={password}
/>
<FormField
<FetherForm.Field
label='Confirm'
onChange={this.handleConfirmChange}
required
......
......@@ -4,7 +4,7 @@
// SPDX-License-Identifier: BSD-3-Clause
import React, { Component } from 'react';
import { AccountCard, FormField } from 'fether-ui';
import { AccountCard, Form as FetherForm } from 'fether-ui';
import debounce from 'lodash/debounce';
import { inject, observer } from 'mobx-react';
......@@ -77,11 +77,12 @@ class AccountRewritePhrase extends Component {
</p>
)}
</div>
<FormField
input={
<textarea onChange={this.handleChange} required value={value} />
}
<FetherForm.Field
as='textarea'
label='Recovery phrase'
onChange={this.handleChange}
required
value={value}
/>
<nav className='form-nav -space-around'>
......
......@@ -4,7 +4,7 @@
// SPDX-License-Identifier: BSD-3-Clause
import React, { Component } from 'react';
import { FormField, Header } from 'fether-ui';
import { Form as FetherForm, Header } from 'fether-ui';
import { inject, observer } from 'mobx-react';
import ReactMarkdown from 'react-markdown';
......@@ -54,14 +54,11 @@ class Onboarding extends Component {
<div className='window_content'>
<div className='box -padded'>
<FormField
input={
<ReactMarkdown
className='terms-and-conditions'
renderers={reactMarkdownOptions}
source={this.state.markdown}
/>
}
<FetherForm.Field
as={ReactMarkdown}
className='terms-and-conditions'
renderers={reactMarkdownOptions}
source={this.state.markdown}
label='Please read carefully'
/>
</div>
......
......@@ -39,6 +39,7 @@
.account_name {
color: $black;
font-weight: 500;
margin-bottom: 0.1rem;
}
.account_address {
......
......@@ -37,13 +37,6 @@ jest.mock('./parityStore', () => ({
}
}));
jest.mock('./tokensStore', () => ({
tokens: {
ETH: { decimals: 18 },
foo: { decimals: 18 }
}
}));
const mockTx = {
amount: 0.01, // In Ether or in token
gasPrice: 4, // in Gwei
......@@ -117,9 +110,13 @@ describe('method send', () => {
sendStore.setTx(mockTx);
});
test.skip('should call transfer$ if the token is Erc20 and subscribe to it', () => {
test('should call makeContract$ if the token is Erc20 ', () => {
sendStore.send(mockErc20Token);
expect(sendStore.contract.transfer$).toHaveBeenCalled();
expect(lightJs.makeContract$).toHaveBeenCalled();
});
test.skip('should call transfer$ if the token is Erc20 and subscribe to it', () => {
// TODO
});
test('should call post$ if the token is ETH and subscribe to it', () => {
......
......@@ -18,7 +18,7 @@ export const Address = ({ address, short, ...otherProps }) => (
address
)
) : (
<Placeholder height={18} width={100} />
<Placeholder height={14} width={100} />
)}
</div>
);
......
......@@ -38,7 +38,7 @@ export class ClickToCopy extends PureComponent {
handleResetCopied = () => this.setState({ copied: false });
render () {
const { children, label, ...otherProps } = this.props;
const { children, label, textToCopy, ...otherProps } = this.props;
const { copied } = this.state;
return (
......
......@@ -21,7 +21,9 @@ export const Field = ({
content={meta && (meta.error || meta.submitError)}
inverted
on='click'
open={meta && !meta.pristine && !meta.valid && !meta.dirtySinceLastSubmit}
open={
!!meta && !meta.pristine && !meta.valid && !meta.dirtySinceLastSubmit
}
position='top center'
size='mini'
trigger={<T {...input} {...otherProps} />}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment