Remove debug line, add Form components

This commit is contained in:
Shawn 2018-07-25 12:45:28 -05:00
parent 097a523b39
commit a727e89e10
4 changed files with 84 additions and 79 deletions

View file

@ -38,7 +38,6 @@ export class SplashScreen extends React.PureComponent<Props, State> {
updateStatus() { updateStatus() {
Lbry.status().then(status => { Lbry.status().then(status => {
this._updateStatusCallback(status); this._updateStatusCallback(status);
window.status = status;
}); });
} }

View file

@ -1,6 +1,6 @@
// @flow // @flow
import React from 'react'; import React from 'react';
import { FormRow, FormField } from 'component/common/form'; import { Form, FormRow, FormField } from 'component/common/form';
import { Modal } from 'modal/modal'; import { Modal } from 'modal/modal';
import Button from 'component/button'; import Button from 'component/button';
@ -43,16 +43,18 @@ class ModalWalletDecrypt extends React.PureComponent<Props> {
onConfirmed={() => this.submitDecryptForm()} onConfirmed={() => this.submitDecryptForm()}
onAborted={closeModal} onAborted={closeModal}
> >
{__( <Form onSubmit={() => this.submitDecryptForm()}>
'Your wallet has been encrypted with a local password, performing this action will remove this password.' {__(
)} 'Your wallet has been encrypted with a local password, performing this action will remove this password.'
<FormRow padded> )}
<Button <div className="card__actions">
button="link" <Button
label={__('Learn more')} button="link"
href="https://lbry.io/faq/wallet-encryption" label={__('Learn more')}
/> href="https://lbry.io/faq/wallet-encryption"
</FormRow> />
</div>
</Form>
</Modal> </Modal>
); );
} }

View file

@ -1,6 +1,6 @@
// @flow // @flow
import React from 'react'; import React from 'react';
import { FormRow, FormField } from 'component/common/form'; import { Form, FormRow, FormField } from 'component/common/form';
import { Modal } from 'modal/modal'; import { Modal } from 'modal/modal';
import Button from 'component/button'; import Button from 'component/button';
@ -89,51 +89,53 @@ class ModalWalletEncrypt extends React.PureComponent<Props> {
onConfirmed={() => this.submitEncryptForm()} onConfirmed={() => this.submitEncryptForm()}
onAborted={closeModal} onAborted={closeModal}
> >
{__( <Form onSubmit={() => this.submitEncryptForm()}>
'Encrypting your wallet will require a password to access your local wallet data when LBRY starts. Please enter a new password for your wallet.' {__(
)} 'Encrypting your wallet will require a password to access your local wallet data when LBRY starts. Please enter a new password for your wallet.'
<FormRow padded> )}
<FormField <FormRow padded>
stretch <FormField
error={passwordMismatch === true ? 'Passwords do not match' : false} stretch
label={__('New Password')} error={passwordMismatch === true ? 'Passwords do not match' : false}
type="password" label={__('New Password')}
name="wallet-new-password" type="password"
onChange={event => this.onChangeNewPassword(event)} name="wallet-new-password"
/> onChange={event => this.onChangeNewPassword(event)}
</FormRow> />
<FormRow padded> </FormRow>
<FormField <FormRow padded>
stretch <FormField
error={passwordMismatch === true ? 'Passwords do not match' : false} stretch
label={__('Confirm Password')} error={passwordMismatch === true ? 'Passwords do not match' : false}
type="password" label={__('Confirm Password')}
name="wallet-new-password-confirm" type="password"
onChange={event => this.onChangeNewPasswordConfirm(event)} name="wallet-new-password-confirm"
/> onChange={event => this.onChangeNewPasswordConfirm(event)}
</FormRow> />
<br /> </FormRow>
{__( <br />
'If your password is lost, it cannot be recovered. You will not be able to access your wallet without a password.' {__(
)} 'If your password is lost, it cannot be recovered. You will not be able to access your wallet without a password.'
<FormRow padded> )}
<FormField <FormRow padded>
stretch <FormField
error={understandError === true ? 'You must enter "I understand"' : false} stretch
label={__('Enter "I understand"')} error={understandError === true ? 'You must enter "I understand"' : false}
type="text" label={__('Enter "I understand"')}
name="wallet-understand" type="text"
onChange={event => this.onChangeUnderstandConfirm(event)} name="wallet-understand"
/> onChange={event => this.onChangeUnderstandConfirm(event)}
</FormRow> />
<FormRow padded> </FormRow>
<Button <div className="card__actions">
button="link" <Button
label={__('Learn more')} button="link"
href="https://lbry.io/faq/wallet-encryption" label={__('Learn more')}
/> href="https://lbry.io/faq/wallet-encryption"
</FormRow> />
{failMessage && <div className="error-text">{__(failMessage)}</div>} </div>
{failMessage && <div className="error-text">{__(failMessage)}</div>}
</Form>
</Modal> </Modal>
); );
} }

View file

@ -1,6 +1,6 @@
// @flow // @flow
import React from 'react'; import React from 'react';
import { FormRow, FormField } from 'component/common/form'; import { Form, FormRow, FormField } from 'component/common/form';
import { Modal } from 'modal/modal'; import { Modal } from 'modal/modal';
import Button from 'component/button'; import Button from 'component/button';
@ -43,26 +43,28 @@ class ModalWalletUnlock extends React.PureComponent<Props> {
onConfirmed={() => unlockWallet(password)} onConfirmed={() => unlockWallet(password)}
onAborted={quit} onAborted={quit}
> >
{__( <Form onSubmit={() => unlockWallet(password)}>
'Your wallet has been encrypted with a local password. Please enter your wallet password to proceed.' {__(
)} 'Your wallet has been encrypted with a local password. Please enter your wallet password to proceed.'
<FormRow padded> )}
<FormField <FormRow padded>
stretch <FormField
error={walletUnlockSucceded === false ? 'Incorrect Password' : false} stretch
label={__('Wallet Password')} error={walletUnlockSucceded === false ? 'Incorrect Password' : false}
type="password" label={__('Wallet Password')}
name="wallet-password" type="password"
onChange={event => this.onChangePassword(event)} name="wallet-password"
/> onChange={event => this.onChangePassword(event)}
</FormRow> />
<FormRow padded> </FormRow>
<Button <div className="card__actions">
button="link" <Button
label={__('Learn more')} button="link"
href="https://lbry.io/faq/wallet-encryption" label={__('Learn more')}
/> href="https://lbry.io/faq/wallet-encryption"
</FormRow> />
</div>
</Form>
</Modal> </Modal>
); );
} }