ESLint additional rules (#4186)

* Add eslint rule for consistent block padding

* Fix padding consistency issues

* Eslint test for duplicate imports

* Eslint closing bracket location

* Fix eslint jsx closing bracket

* missed a file

* Formatting

* Manual overrides for auto

* Manual overrides for auto

* More minor auto-override manual adjustments
This commit is contained in:
Jaco Greeff 2017-01-18 13:05:01 +01:00 committed by GitHub
parent d608ad2011
commit 08f80f2695
198 changed files with 1612 additions and 921 deletions

View File

@ -15,8 +15,17 @@
"jsx-quotes": ["error", "prefer-single"], "jsx-quotes": ["error", "prefer-single"],
"no-alert": "error", "no-alert": "error",
"no-debugger": "error", "no-debugger": "error",
"no-duplicate-imports": ["error", {
"includeExports": true
}],
"object-curly-spacing": ["error", "always"], "object-curly-spacing": ["error", "always"],
"object-property-newline": 0, "object-property-newline": 0,
"padded-blocks": ["error", {
"blocks": "never",
"classes": "never",
"switches": "never"
}],
"react/jsx-closing-bracket-location": "error",
"react/jsx-curly-spacing": ["error", "always"] "react/jsx-curly-spacing": ["error", "always"]
} }
} }

View File

@ -67,7 +67,8 @@ export default class AddressSelect extends Component {
<select <select
className={ styles.iconMenu } className={ styles.iconMenu }
style={ style } style={ style }
onChange={ this.onChange }> onChange={ this.onChange }
>
{ addresses.map(this.renderOption) } { addresses.map(this.renderOption) }
</select> </select>
); );
@ -80,7 +81,8 @@ export default class AddressSelect extends Component {
return ( return (
<option <option
key={ account.address } key={ account.address }
value={ account.address }> value={ account.address }
>
{ account.name } { account.name }
</option> </option>
); );

View File

@ -56,7 +56,8 @@ export default class Header extends Component {
style={ { background } } style={ { background } }
colSpan={ position ? 1 : 2 } colSpan={ position ? 1 : 2 }
rowSpan={ position ? 1 : 2 } rowSpan={ position ? 1 : 2 }
onClick={ this.onNavigate(page.path) }> onClick={ this.onNavigate(page.path) }
>
<div className={ styles.title }> <div className={ styles.title }>
{ page.title } { page.title }
</div> </div>

View File

@ -146,7 +146,8 @@ export default class Deployment extends Component {
<label>deployment account</label> <label>deployment account</label>
<AddressSelect <AddressSelect
addresses={ addresses } addresses={ addresses }
onChange={ this.onChangeFrom } /> onChange={ this.onChangeFrom }
/>
<div className={ styles.hint }> <div className={ styles.hint }>
the owner account to deploy from the owner account to deploy from
</div> </div>
@ -156,7 +157,8 @@ export default class Deployment extends Component {
<input <input
value={ name } value={ name }
name='name' name='name'
onChange={ this.onChangeName } /> onChange={ this.onChangeName }
/>
<div className={ styles.hint }> <div className={ styles.hint }>
{ nameError || 'an identifying name for the token' } { nameError || 'an identifying name for the token' }
</div> </div>
@ -167,7 +169,8 @@ export default class Deployment extends Component {
className={ styles.small } className={ styles.small }
name='tla' name='tla'
value={ tla } value={ tla }
onChange={ this.onChangeTla } /> onChange={ this.onChangeTla }
/>
<div className={ styles.hint }> <div className={ styles.hint }>
{ tlaError || 'unique network acronym for this token' } { tlaError || 'unique network acronym for this token' }
</div> </div>
@ -180,7 +183,8 @@ export default class Deployment extends Component {
max='999999999999' max='999999999999'
name='totalSupply' name='totalSupply'
value={ totalSupply } value={ totalSupply }
onChange={ this.onChangeSupply } /> onChange={ this.onChangeSupply }
/>
<div className={ styles.hint }> <div className={ styles.hint }>
{ totalSupplyError || `number of tokens (base: ${baseText})` } { totalSupplyError || `number of tokens (base: ${baseText})` }
</div> </div>
@ -191,7 +195,8 @@ export default class Deployment extends Component {
<div <div
className={ styles.button } className={ styles.button }
disabled={ hasError } disabled={ hasError }
onClick={ this.onDeploy }> onClick={ this.onDeploy }
>
Deploy Token Deploy Token
</div> </div>
</div> </div>

View File

@ -32,7 +32,8 @@ export default class IdentityIcon extends Component {
return ( return (
<img <img
className={ classes } className={ classes }
src={ api.util.createIdentityImg(address, 3) } /> src={ api.util.createIdentityImg(address, 3) }
/>
); );
} }
} }

View File

@ -50,7 +50,8 @@ export default class Owner extends Component {
<span>{ accounts[address].name }</span> <span>{ accounts[address].name }</span>
<IdentityIcon <IdentityIcon
className={ styles.icon } className={ styles.icon }
address={ address } /> address={ address }
/>
</div> </div>
</td> </td>
<td className={ styles.tokens }> <td className={ styles.tokens }>
@ -67,7 +68,8 @@ export default class Owner extends Component {
<div key={ token.address }> <div key={ token.address }>
<Token <Token
address={ token.address } address={ token.address }
tokenreg={ token.tokenreg } /> tokenreg={ token.tokenreg }
/>
<div className={ styles.byline }> <div className={ styles.byline }>
{ token.address } { token.address }
</div> </div>

View File

@ -88,7 +88,8 @@ export default class Overview extends Component {
<Owner <Owner
key={ address } key={ address }
tokens={ tokens[address] } tokens={ tokens[address] }
address={ address } /> address={ address }
/>
)); ));
} }

View File

@ -99,7 +99,8 @@ export default class Events extends Component {
<Event <Event
key={ event.key } key={ event.key }
token={ token } token={ token }
event={ event } /> event={ event }
/>
); );
}); });

View File

@ -149,7 +149,8 @@ export default class Send extends Component {
<label>transfer from</label> <label>transfer from</label>
<AddressSelect <AddressSelect
addresses={ fromAddresses } addresses={ fromAddresses }
onChange={ this.onSelectFrom } /> onChange={ this.onSelectFrom }
/>
<div className={ styles.hint }> <div className={ styles.hint }>
account to transfer from account to transfer from
</div> </div>
@ -179,7 +180,8 @@ export default class Send extends Component {
step='0.1' step='0.1'
value={ amount } value={ amount }
max={ fromBalance ? fromBalance.balance.div(1000000).toFixed(6) : 1 } max={ fromBalance ? fromBalance.balance.div(1000000).toFixed(6) : 1 }
onChange={ this.onAmountChange } /> onChange={ this.onAmountChange }
/>
<div className={ styles.hint }> <div className={ styles.hint }>
{ amountError || maxAmountHint } { amountError || maxAmountHint }
</div> </div>
@ -190,7 +192,8 @@ export default class Send extends Component {
<div <div
className={ styles.button } className={ styles.button }
disabled={ hasError } disabled={ hasError }
onClick={ this.onSend }> onClick={ this.onSend }
>
Transfer Tokens Transfer Tokens
</div> </div>
</div> </div>
@ -206,7 +209,8 @@ export default class Send extends Component {
return tokens.map((token) => ( return tokens.map((token) => (
<option <option
key={ token.address } key={ token.address }
value={ token.address }> value={ token.address }
>
{ token.coin.tla } / { token.coin.name } { token.coin.tla } / { token.coin.name }
</option> </option>
)); ));

View File

@ -36,7 +36,8 @@ export default class Button extends Component {
className={ classes } className={ classes }
data-warning={ warning } data-warning={ warning }
disabled={ disabled } disabled={ disabled }
onClick={ this.onClick }> onClick={ this.onClick }
>
{ label } { label }
</button> </button>
); );

View File

@ -37,12 +37,14 @@ export default class ButtonBar extends Component {
key='cancel' key='cancel'
label='Cancel' label='Cancel'
warning warning
onClick={ this.onCancelClick } />, onClick={ this.onCancelClick }
/>,
<Button <Button
key='save' key='save'
label={ this.dappsStore.isNew ? 'Register' : 'Update' } label={ this.dappsStore.isNew ? 'Register' : 'Update' }
disabled={ !this.dappsStore.canSave } disabled={ !this.dappsStore.canSave }
onClick={ this.onSaveClick } /> onClick={ this.onSaveClick }
/>
]; ];
} else { } else {
buttons = [ buttons = [
@ -51,16 +53,19 @@ export default class ButtonBar extends Component {
label='Delete' label='Delete'
warning warning
disabled={ !this.dappsStore.currentApp || (!this.dappsStore.currentApp.isOwner && !this.dappsStore.isContractOwner) } disabled={ !this.dappsStore.currentApp || (!this.dappsStore.currentApp.isOwner && !this.dappsStore.isContractOwner) }
onClick={ this.onDeleteClick } />, onClick={ this.onDeleteClick }
/>,
<Button <Button
key='edit' key='edit'
label='Edit' label='Edit'
disabled={ !this.dappsStore.currentApp || !this.dappsStore.currentApp.isOwner } disabled={ !this.dappsStore.currentApp || !this.dappsStore.currentApp.isOwner }
onClick={ this.onEditClick } />, onClick={ this.onEditClick }
/>,
<Button <Button
key='new' key='new'
label='New' label='New'
onClick={ this.onNewClick } /> onClick={ this.onNewClick }
/>
]; ];
} }

View File

@ -61,14 +61,16 @@ export default class Dapp extends Component {
const overlayImage = ( const overlayImage = (
<img <img
className={ styles.overlayImage } className={ styles.overlayImage }
src={ api.util.createIdentityImg(this.dappsStore.currentAccount.address, 4) } /> src={ api.util.createIdentityImg(this.dappsStore.currentAccount.address, 4) }
/>
); );
return ( return (
<Input <Input
hint={ this.dappsStore.currentAccount.address } hint={ this.dappsStore.currentAccount.address }
label='Owner, select the application owner and editor' label='Owner, select the application owner and editor'
overlay={ overlayImage }> overlay={ overlayImage }
>
<SelectAccount /> <SelectAccount />
</Input> </Input>
); );
@ -78,14 +80,16 @@ export default class Dapp extends Component {
const overlayImage = ( const overlayImage = (
<img <img
className={ styles.overlayImage } className={ styles.overlayImage }
src={ api.util.createIdentityImg(app.owner, 4) } /> src={ api.util.createIdentityImg(app.owner, 4) }
/>
); );
return ( return (
<Input <Input
hint={ app.owner } hint={ app.owner }
label='Owner, the application owner and editor' label='Owner, the application owner and editor'
overlay={ overlayImage }> overlay={ overlayImage }
>
<input value={ app.ownerName } readOnly /> <input value={ app.ownerName } readOnly />
</Input> </Input>
); );
@ -100,7 +104,8 @@ export default class Dapp extends Component {
overlayImage = ( overlayImage = (
<img <img
className={ styles.overlayImage } className={ styles.overlayImage }
src={ `/api/content/${hash.substr(2)}` } /> src={ `/api/content/${hash.substr(2)}` }
/>
); );
} }
@ -109,13 +114,15 @@ export default class Dapp extends Component {
hint={ app[`${type}Error`] || app[`${type}Url`] || '...' } hint={ app[`${type}Error`] || app[`${type}Url`] || '...' }
label={ label } label={ label }
key={ `${type}Edit` } key={ `${type}Edit` }
overlay={ overlayImage }> overlay={ overlayImage }
>
<input <input
value={ app[`${type}Hash`] || '' } value={ app[`${type}Hash`] || '' }
data-dirty={ app[`${type}Changed`] } data-dirty={ app[`${type}Changed`] }
data-error={ !!app[`${type}Error`] } data-error={ !!app[`${type}Error`] }
readOnly={ !this.dappsStore.isEditing && !this.dappsStore.isNew } readOnly={ !this.dappsStore.isEditing && !this.dappsStore.isNew }
onChange={ onChange } /> onChange={ onChange }
/>
</Input> </Input>
); );
} }

View File

@ -53,7 +53,8 @@ export default class ModalDelete extends Component {
<Modal <Modal
buttons={ this.renderButtons() } buttons={ this.renderButtons() }
error={ this.modalStore.errorDelete } error={ this.modalStore.errorDelete }
header={ HEADERS[this.modalStore.stepDelete] }> header={ HEADERS[this.modalStore.stepDelete] }
>
{ this.renderStep() } { this.renderStep() }
</Modal> </Modal>
); );
@ -67,19 +68,22 @@ export default class ModalDelete extends Component {
<Button <Button
key='close' key='close'
label='Close' label='Close'
onClick={ this.onClickClose } /> onClick={ this.onClickClose }
/>
]; ];
case STEP_CONFIRM: case STEP_CONFIRM:
return [ return [
<Button <Button
key='cancel' key='cancel'
label='No, Cancel' label='No, Cancel'
onClick={ this.onClickClose } />, onClick={ this.onClickClose }
/>,
<Button <Button
key='delete' key='delete'
label='Yes, Delete' label='Yes, Delete'
warning warning
onClick={ this.onClickYes } /> onClick={ this.onClickYes }
/>
]; ];
default: default:
return null; return null;

View File

@ -53,7 +53,8 @@ export default class ModalRegister extends Component {
<Modal <Modal
buttons={ this.renderButtons() } buttons={ this.renderButtons() }
error={ this.modalStore.errorRegister } error={ this.modalStore.errorRegister }
header={ HEADERS[this.modalStore.stepRegister] }> header={ HEADERS[this.modalStore.stepRegister] }
>
{ this.renderStep() } { this.renderStep() }
</Modal> </Modal>
); );
@ -67,19 +68,22 @@ export default class ModalRegister extends Component {
<Button <Button
key='close' key='close'
label='Close' label='Close'
onClick={ this.onClickClose } /> onClick={ this.onClickClose }
/>
]; ];
case STEP_CONFIRM: case STEP_CONFIRM:
return [ return [
<Button <Button
key='cancel' key='cancel'
label='No, Cancel' label='No, Cancel'
onClick={ this.onClickClose } />, onClick={ this.onClickClose }
/>,
<Button <Button
key='register' key='register'
label='Yes, Register' label='Yes, Register'
warning warning
onClick={ this.onClickConfirmYes } /> onClick={ this.onClickConfirmYes }
/>
]; ];
default: default:
return null; return null;

View File

@ -52,7 +52,8 @@ export default class ModalUpdate extends Component {
<Modal <Modal
buttons={ this.renderButtons() } buttons={ this.renderButtons() }
error={ this.modalStore.errorUpdate } error={ this.modalStore.errorUpdate }
header={ HEADERS[this.modalStore.stepUpdate] }> header={ HEADERS[this.modalStore.stepUpdate] }
>
{ this.renderStep() } { this.renderStep() }
</Modal> </Modal>
); );
@ -66,19 +67,22 @@ export default class ModalUpdate extends Component {
<Button <Button
key='close' key='close'
label='Close' label='Close'
onClick={ this.onClickClose } /> onClick={ this.onClickClose }
/>
]; ];
case STEP_CONFIRM: case STEP_CONFIRM:
return [ return [
<Button <Button
key='cancel' key='cancel'
label='No, Cancel' label='No, Cancel'
onClick={ this.onClickClose } />, onClick={ this.onClickClose }
/>,
<Button <Button
key='delete' key='delete'
label='Yes, Update' label='Yes, Update'
warning warning
onClick={ this.onClickYes } /> onClick={ this.onClickYes }
/>
]; ];
default: default:
return null; return null;

View File

@ -27,7 +27,8 @@ export default class SelectAccount extends Component {
return ( return (
<select <select
value={ this.dappsStore.currentAccount.address } value={ this.dappsStore.currentAccount.address }
onChange={ this.onSelect }> onChange={ this.onSelect }
>
{ this.renderOptions() } { this.renderOptions() }
</select> </select>
); );

View File

@ -30,7 +30,8 @@ export default class SelectDapp extends Component {
return ( return (
<Input <Input
hint='...' hint='...'
label='Application Id, the unique assigned identifier'> label='Application Id, the unique assigned identifier'
>
<input value={ this.dappsStore.wipApp.id } readOnly /> <input value={ this.dappsStore.wipApp.id } readOnly />
</Input> </Input>
); );
@ -51,11 +52,13 @@ export default class SelectDapp extends Component {
<Input <Input
hint={ this.dappsStore.currentApp.id } hint={ this.dappsStore.currentApp.id }
label='Application, the actual application details to show below' label='Application, the actual application details to show below'
overlay={ overlayImg }> overlay={ overlayImg }
>
<select <select
disabled={ this.dappsStore.isEditing } disabled={ this.dappsStore.isEditing }
value={ this.dappsStore.currentApp.id } value={ this.dappsStore.currentApp.id }
onChange={ this.onSelect }> onChange={ this.onSelect }
>
{ this.renderOptions() } { this.renderOptions() }
</select> </select>
</Input> </Input>
@ -67,7 +70,8 @@ export default class SelectDapp extends Component {
return ( return (
<option <option
value={ app.id } value={ app.id }
key={ app.id }> key={ app.id }
>
{ app.name } { app.name }
</option> </option>
); );

View File

@ -94,7 +94,8 @@ export default class Application extends Component {
disabled={ registerBusy } disabled={ registerBusy }
value={ repo } value={ repo }
className={ repoError ? styles.error : null } className={ repoError ? styles.error : null }
onChange={ this.onChangeRepo } /> onChange={ this.onChangeRepo }
/>
</div>, </div>,
<div className={ styles.capture } key='hash'> <div className={ styles.capture } key='hash'>
<input <input
@ -103,7 +104,8 @@ export default class Application extends Component {
disabled={ registerBusy } disabled={ registerBusy }
value={ commit } value={ commit }
className={ commitError ? styles.error : null } className={ commitError ? styles.error : null }
onChange={ this.onChangeCommit } /> onChange={ this.onChangeCommit }
/>
</div> </div>
]; ];
} else { } else {
@ -115,7 +117,8 @@ export default class Application extends Component {
disabled={ registerBusy } disabled={ registerBusy }
value={ url } value={ url }
className={ urlError ? styles.error : null } className={ urlError ? styles.error : null }
onChange={ this.onChangeUrl } /> onChange={ this.onChangeUrl }
/>
</div> </div>
); );
} }
@ -128,11 +131,17 @@ export default class Application extends Component {
<Button <Button
disabled={ registerBusy } disabled={ registerBusy }
invert={ registerType !== 'file' } invert={ registerType !== 'file' }
onClick={ this.onClickTypeNormal }>File Link</Button> onClick={ this.onClickTypeNormal }
>
File Link
</Button>
<Button <Button
disabled={ registerBusy } disabled={ registerBusy }
invert={ registerType !== 'content' } invert={ registerType !== 'content' }
onClick={ this.onClickTypeContent }>Content Bundle</Button> onClick={ this.onClickTypeContent }
>
Content Bundle
</Button>
</div> </div>
<div className={ styles.box }> <div className={ styles.box }>
<div className={ styles.description }> <div className={ styles.description }>
@ -148,7 +157,8 @@ export default class Application extends Component {
</div> </div>
<Events <Events
eventIds={ this.state.eventIds } eventIds={ this.state.eventIds }
events={ this.state.events } /> events={ this.state.events }
/>
</div> </div>
); );
} }
@ -167,7 +177,8 @@ export default class Application extends Component {
</div> </div>
<Button <Button
onClick={ this.onClickRegister } onClick={ this.onClickRegister }
disabled={ (contentHashError && contentHashOwner !== fromAddress) || urlError || repoError || commitError }>register url</Button> disabled={ (contentHashError && contentHashOwner !== fromAddress) || urlError || repoError || commitError }
>register url</Button>
</div> </div>
); );
} }

View File

@ -30,7 +30,8 @@ export default class IdentityIcon extends Component {
return ( return (
<img <img
className={ styles.icon } className={ styles.icon }
src={ api.util.createIdentityImg(address, 3) } /> src={ api.util.createIdentityImg(address, 3) }
/>
); );
} }
} }

View File

@ -167,7 +167,7 @@ export default class Application extends Component {
transaction={ tx.transaction } transaction={ tx.transaction }
stats={ tx.stats } stats={ tx.stats }
blockNumber={ blockNumber } blockNumber={ blockNumber }
/> />
)) ))
} }
</tbody> </tbody>
@ -198,7 +198,7 @@ export default class Application extends Component {
status={ tx.status } status={ tx.status }
stats={ tx.stats } stats={ tx.stats }
details={ tx } details={ tx }
/> />
)) ))
} }
</tbody> </tbody>

View File

@ -25,7 +25,6 @@ import styles from './transaction.css';
import IdentityIcon from '../../githubhint/IdentityIcon'; import IdentityIcon from '../../githubhint/IdentityIcon';
class BaseTransaction extends Component { class BaseTransaction extends Component {
shortHash (hash) { shortHash (hash) {
return `${hash.substr(0, 5)}..${hash.substr(hash.length - 3)}`; return `${hash.substr(0, 5)}..${hash.substr(hash.length - 3)}`;
} }
@ -47,7 +46,7 @@ class BaseTransaction extends Component {
<div title={ transaction.from } className={ styles.from }> <div title={ transaction.from } className={ styles.from }>
<IdentityIcon <IdentityIcon
address={ transaction.from } address={ transaction.from }
/> />
</div> </div>
); );
} }
@ -89,7 +88,6 @@ class BaseTransaction extends Component {
} }
export class Transaction extends BaseTransaction { export class Transaction extends BaseTransaction {
static propTypes = { static propTypes = {
idx: PropTypes.number.isRequired, idx: PropTypes.number.isRequired,
transaction: PropTypes.object.isRequired, transaction: PropTypes.object.isRequired,
@ -180,7 +178,6 @@ export class Transaction extends BaseTransaction {
} }
export class LocalTransaction extends BaseTransaction { export class LocalTransaction extends BaseTransaction {
static propTypes = { static propTypes = {
hash: PropTypes.string.isRequired, hash: PropTypes.string.isRequired,
status: PropTypes.string.isRequired, status: PropTypes.string.isRequired,
@ -361,12 +358,12 @@ export class LocalTransaction extends BaseTransaction {
type='text' type='text'
value={ gasPrice } value={ gasPrice }
onChange={ this.setGasPrice } onChange={ this.setGasPrice }
/> />
<input <input
type='text' type='text'
value={ gas } value={ gas }
onChange={ this.setGas } onChange={ this.setGas }
/> />
</td> </td>
<td colSpan='2'> <td colSpan='2'>
<a href='javascript:void' onClick={ this.sendTransaction }> <a href='javascript:void' onClick={ this.sendTransaction }>
@ -376,5 +373,4 @@ export class LocalTransaction extends BaseTransaction {
</tr> </tr>
); );
} }
} }

View File

@ -29,7 +29,6 @@ import { select } from './actions';
import styles from './accounts.css'; import styles from './accounts.css';
class Accounts extends Component { class Accounts extends Component {
static propTypes = { static propTypes = {
all: PropTypes.object.isRequired, all: PropTypes.object.isRequired,
selected: PropTypes.object, selected: PropTypes.object,

View File

@ -98,5 +98,4 @@ export default class Application extends Component {
</div> </div>
); );
} }
} }

View File

@ -147,7 +147,6 @@ const eventTypes = {
}; };
class Events extends Component { class Events extends Component {
static propTypes = { static propTypes = {
events: PropTypes.array.isRequired, events: PropTypes.array.isRequired,
pending: PropTypes.object.isRequired, pending: PropTypes.object.isRequired,

View File

@ -33,7 +33,8 @@ export default class IdentityIcon extends Component {
<img <img
className={ styles.icon + ' ' + className } className={ styles.icon + ' ' + className }
style={ style } style={ style }
src={ api.util.createIdentityImg(address, 3) } /> src={ api.util.createIdentityImg(address, 3) }
/>
); );
} }
} }

View File

@ -34,7 +34,6 @@ import { clear, lookup, ownerLookup, reverseLookup } from './actions';
import styles from './lookup.css'; import styles from './lookup.css';
class Lookup extends Component { class Lookup extends Component {
static propTypes = { static propTypes = {
result: nullableProptype(PropTypes.string.isRequired), result: nullableProptype(PropTypes.string.isRequired),

View File

@ -77,7 +77,6 @@ const renderQueue = (queue) => {
}; };
class Names extends Component { class Names extends Component {
static propTypes = { static propTypes = {
error: nullableProptype(PropTypes.object.isRequired), error: nullableProptype(PropTypes.object.isRequired),
fee: PropTypes.object.isRequired, fee: PropTypes.object.isRequired,

View File

@ -29,7 +29,6 @@ import { clearError, update } from './actions';
import styles from './records.css'; import styles from './records.css';
class Records extends Component { class Records extends Component {
static propTypes = { static propTypes = {
error: nullableProptype(PropTypes.object.isRequired), error: nullableProptype(PropTypes.object.isRequired),
pending: PropTypes.bool.isRequired, pending: PropTypes.bool.isRequired,

View File

@ -80,7 +80,8 @@ export default class Application extends Component {
return ( return (
<Header <Header
blockNumber={ blockNumber } blockNumber={ blockNumber }
totalSignatures={ totalSignatures } /> totalSignatures={ totalSignatures }
/>
); );
} }
@ -95,7 +96,8 @@ export default class Application extends Component {
instance={ instance } instance={ instance }
visible={ showImport } visible={ showImport }
onClose={ this.toggleImport } onClose={ this.toggleImport }
onSetFromAddress={ this.setFromAddress } /> onSetFromAddress={ this.setFromAddress }
/>
); );
} }
@ -112,7 +114,8 @@ export default class Application extends Component {
return ( return (
<Events <Events
accountsInfo={ accountsInfo } accountsInfo={ accountsInfo }
contract={ contract } /> contract={ contract }
/>
); );
} }

View File

@ -30,7 +30,8 @@ export default class IdentityIcon extends Component {
return ( return (
<img <img
className={ styles.icon } className={ styles.icon }
src={ api.util.createIdentityImg(address, 3) } /> src={ api.util.createIdentityImg(address, 3) }
/>
); );
} }
} }

View File

@ -24,7 +24,6 @@ import IdentityIcon from '../../IdentityIcon';
import styles from './account-selector.css'; import styles from './account-selector.css';
class AccountSelectorItem extends Component { class AccountSelectorItem extends Component {
static propTypes = { static propTypes = {
onSelectAccount: PropTypes.func.isRequired, onSelectAccount: PropTypes.func.isRequired,
account: PropTypes.object.isRequired account: PropTypes.object.isRequired
@ -37,15 +36,19 @@ class AccountSelectorItem extends Component {
delete props.account; delete props.account;
delete props.onSelectAccount; delete props.onSelectAccount;
const icon = (<IdentityIcon const icon = (
inline center <IdentityIcon
address={ account.address } /> inline center
address={ account.address }
/>
); );
const avatar = (<Avatar const avatar = (
className={ styles.avatar } <Avatar
backgroundColor='none' className={ styles.avatar }
icon={ icon } /> backgroundColor='none'
icon={ icon }
/>
); );
return ( return (
@ -55,18 +58,17 @@ class AccountSelectorItem extends Component {
primaryText={ account.name } primaryText={ account.name }
secondaryText={ account.address } secondaryText={ account.address }
leftAvatar={ avatar } leftAvatar={ avatar }
{ ...props } /> { ...props }
/>
); );
} }
onSelectAccount = () => { onSelectAccount = () => {
this.props.onSelectAccount(this.props.account.address); this.props.onSelectAccount(this.props.account.address);
} }
} }
export default class AccountSelector extends Component { export default class AccountSelector extends Component {
static propTypes = { static propTypes = {
list: PropTypes.array.isRequired, list: PropTypes.array.isRequired,
selected: PropTypes.object.isRequired, selected: PropTypes.object.isRequired,
@ -87,7 +89,8 @@ export default class AccountSelector extends Component {
open={ this.state.open } open={ this.state.open }
onSelectAccount={ this.onToggleOpen } onSelectAccount={ this.onToggleOpen }
autoGenerateNestedIndicator={ false } autoGenerateNestedIndicator={ false }
nestedListStyle={ { maxHeight: '14em', overflow: 'auto' } } /> nestedListStyle={ { maxHeight: '14em', overflow: 'auto' } }
/>
); );
return ( return (
@ -106,7 +109,8 @@ export default class AccountSelector extends Component {
<AccountSelectorItem <AccountSelectorItem
account={ account } account={ account }
onSelectAccount={ this.onSelectAccount } onSelectAccount={ this.onSelectAccount }
key={ index } /> key={ index }
/>
)); ));
} }
@ -122,5 +126,4 @@ export default class AccountSelector extends Component {
this.props.handleSetSelected(address); this.props.handleSetSelected(address);
this.onToggleOpen(); this.onToggleOpen();
} }
} }

View File

@ -23,9 +23,11 @@ import { setSelectedAccount } from '../actions';
class AccountSelectorContainer extends Component { class AccountSelectorContainer extends Component {
render () { render () {
return (<AccountSelector return (
{ ...this.props } <AccountSelector
/>); { ...this.props }
/>
);
} }
} }
@ -42,4 +44,7 @@ const mapDispatchToProps = (dispatch) => {
}; };
}; };
export default connect(mapStateToProps, mapDispatchToProps)(AccountSelectorContainer); export default connect(
mapStateToProps,
mapDispatchToProps
)(AccountSelectorContainer);

View File

@ -35,7 +35,6 @@ const initState = {
}; };
export default class QueryAction extends Component { export default class QueryAction extends Component {
static propTypes = { static propTypes = {
show: PropTypes.bool.isRequired, show: PropTypes.bool.isRequired,
loading: PropTypes.bool.isRequired, loading: PropTypes.bool.isRequired,
@ -56,7 +55,8 @@ export default class QueryAction extends Component {
open={ this.props.show } open={ this.props.show }
className={ styles.dialog } className={ styles.dialog }
onRequestClose={ this.onClose } onRequestClose={ this.onClose }
actions={ this.renderActions() } > actions={ this.renderActions() }
>
{ this.renderContent() } { this.renderContent() }
</Dialog> </Dialog>
); );
@ -70,7 +70,8 @@ export default class QueryAction extends Component {
<FlatButton <FlatButton
label='Loading...' label='Loading...'
primary primary
disabled /> disabled
/>
); );
} }
@ -81,7 +82,8 @@ export default class QueryAction extends Component {
<FlatButton <FlatButton
label='Close' label='Close'
primary primary
onTouchTap={ this.onClose } /> onTouchTap={ this.onClose }
/>
]); ]);
} }
@ -91,12 +93,14 @@ export default class QueryAction extends Component {
<FlatButton <FlatButton
label='Cancel' label='Cancel'
primary primary
onTouchTap={ this.onClose } />, onTouchTap={ this.onClose }
/>,
<FlatButton <FlatButton
label='Query' label='Query'
primary primary
disabled={ !isValid } disabled={ !isValid }
onTouchTap={ this.onQuery } /> onTouchTap={ this.onQuery }
/>
]); ]);
} }
@ -140,31 +144,38 @@ export default class QueryAction extends Component {
floatingLabelText='Select which field to query' floatingLabelText='Select which field to query'
fullWidth fullWidth
value={ this.state.queryKey } value={ this.state.queryKey }
onChange={ this.onQueryKeyChange }> onChange={ this.onQueryKeyChange }
>
<MenuItem value='tla' label='TLA' primaryText='TLA' /> <MenuItem value='tla' label='TLA' primaryText='TLA' />
<MenuItem value='address' label='Address' primaryText='Address' /> <MenuItem value='address' label='Address' primaryText='Address' />
</SelectField> </SelectField>
{ {
this.state.queryKey !== 'tla' this.state.queryKey !== 'tla'
? (<InputText ? (
key={ 0 } <InputText
key={ 0 }
floatingLabelText="Token's address" floatingLabelText="Token's address"
hintText='0xdeadbeef...' hintText='0xdeadbeef...'
validationType={ SIMPLE_TOKEN_ADDRESS_TYPE } validationType={ SIMPLE_TOKEN_ADDRESS_TYPE }
onChange={ this.onChange } onChange={ this.onChange }
onEnter={ this.onQuery } />) onEnter={ this.onQuery }
: (<InputText />
key={ 1 } )
: (
<InputText
key={ 1 }
floatingLabelText="Token's TLA" floatingLabelText="Token's TLA"
hintText='GAV' hintText='GAV'
validationType={ SIMPLE_TLA_TYPE } validationType={ SIMPLE_TLA_TYPE }
onChange={ this.onChange } onChange={ this.onChange }
onEnter={ this.onQuery } />) onEnter={ this.onQuery }
/>
)
} }
</div> </div>
); );
@ -203,5 +214,4 @@ export default class QueryAction extends Component {
this.setState(initState); this.setState(initState);
this.props.onClose(); this.props.onClose();
} }
} }

View File

@ -57,7 +57,6 @@ const initState = {
}; };
export default class RegisterAction extends Component { export default class RegisterAction extends Component {
static propTypes = { static propTypes = {
show: PropTypes.bool.isRequired, show: PropTypes.bool.isRequired,
sending: PropTypes.bool.isRequired, sending: PropTypes.bool.isRequired,
@ -97,7 +96,8 @@ export default class RegisterAction extends Component {
<FlatButton <FlatButton
label='Close' label='Close'
primary primary
onTouchTap={ this.onClose } /> onTouchTap={ this.onClose }
/>
); );
} }
@ -106,7 +106,8 @@ export default class RegisterAction extends Component {
<FlatButton <FlatButton
label='Done' label='Done'
primary primary
onTouchTap={ this.onClose } /> onTouchTap={ this.onClose }
/>
); );
} }
@ -116,12 +117,14 @@ export default class RegisterAction extends Component {
<FlatButton <FlatButton
label='Cancel' label='Cancel'
primary primary
onTouchTap={ this.onClose } />, onTouchTap={ this.onClose }
/>,
<FlatButton <FlatButton
label={ sending ? 'Sending...' : 'Register' } label={ sending ? 'Sending...' : 'Register' }
primary primary
disabled={ !isValid || sending } disabled={ !isValid || sending }
onTouchTap={ this.onRegister } /> onTouchTap={ this.onRegister }
/>
]); ]);
} }
@ -177,7 +180,8 @@ export default class RegisterAction extends Component {
hintText={ field.hintText } hintText={ field.hintText }
validationType={ field.type } validationType={ field.type }
onChange={ onChange } /> onChange={ onChange }
/>
); );
}); });
} }
@ -227,5 +231,4 @@ export default class RegisterAction extends Component {
this.setState(initState); this.setState(initState);
this.props.onClose(); this.props.onClose();
} }
} }

View File

@ -29,7 +29,6 @@ const REGISTER_ACTION = 'REGISTER_ACTION';
const QUERY_ACTION = 'QUERY_ACTION'; const QUERY_ACTION = 'QUERY_ACTION';
export default class Actions extends Component { export default class Actions extends Component {
static propTypes = { static propTypes = {
handleRegisterToken: PropTypes.func.isRequired, handleRegisterToken: PropTypes.func.isRequired,
handleRegisterClose: PropTypes.func.isRequired, handleRegisterClose: PropTypes.func.isRequired,
@ -62,26 +61,30 @@ export default class Actions extends Component {
icon={ <ContentSendIcon /> } icon={ <ContentSendIcon /> }
label='Register Token' label='Register Token'
primary primary
onTouchTap={ this.onShowRegister } /> onTouchTap={ this.onShowRegister }
/>
<RaisedButton <RaisedButton
className={ styles.button } className={ styles.button }
icon={ <ActionSearchIcon /> } icon={ <ActionSearchIcon /> }
label='Search Token' label='Search Token'
primary primary
onTouchTap={ this.onShowQuery } /> onTouchTap={ this.onShowQuery }
/>
<Register <Register
show={ this.state.show[ REGISTER_ACTION ] } show={ this.state.show[ REGISTER_ACTION ] }
onClose={ this.onRegisterClose } onClose={ this.onRegisterClose }
handleRegisterToken={ this.props.handleRegisterToken } handleRegisterToken={ this.props.handleRegisterToken }
{ ...this.props.register } /> { ...this.props.register }
/>
<Query <Query
show={ this.state.show[ QUERY_ACTION ] } show={ this.state.show[ QUERY_ACTION ] }
onClose={ this.onQueryClose } onClose={ this.onQueryClose }
handleQueryToken={ this.props.handleQueryToken } handleQueryToken={ this.props.handleQueryToken }
{ ...this.props.query } /> { ...this.props.query }
/>
</div> </div>
); );
} }
@ -113,5 +116,4 @@ export default class Actions extends Component {
} }
}); });
} }
} }

View File

@ -22,11 +22,12 @@ import Actions from './component';
import { registerToken, registerReset, queryToken, queryReset } from './actions'; import { registerToken, registerReset, queryToken, queryReset } from './actions';
class TokensContainer extends Component { class TokensContainer extends Component {
render () { render () {
return (<Actions return (
{ ...this.props } <Actions
/>); { ...this.props }
/>
);
} }
} }

View File

@ -56,7 +56,8 @@ export default class Application extends Component {
<div className={ styles.application }> <div className={ styles.application }>
<Status <Status
address={ contract.address } address={ contract.address }
fee={ contract.fee } /> fee={ contract.fee }
/>
<Actions /> <Actions />
@ -73,5 +74,4 @@ export default class Application extends Component {
muiTheme muiTheme
}; };
} }
} }

View File

@ -44,7 +44,8 @@ export default class CustomChip extends Component {
background: '#27ae60', background: '#27ae60',
display: 'flex', display: 'flex',
flexDirection: 'column' flexDirection: 'column'
} }> } }
>
{ this.renderIcon(isAddress, value) } { this.renderIcon(isAddress, value) }
<span className={ styles.value } title={ value }> <span className={ styles.value } title={ value }>
{ displayValue } { displayValue }
@ -64,7 +65,8 @@ export default class CustomChip extends Component {
return ( return (
<IdentityIcon <IdentityIcon
inline center inline center
address={ address } /> address={ address }
/>
); );
} }
} }

View File

@ -36,10 +36,12 @@ class Container extends Component {
render () { render () {
const { isLoading, contract } = this.props; const { isLoading, contract } = this.props;
return (<Application return (
isLoading={ isLoading } <Application
contract={ contract } isLoading={ isLoading }
/>); contract={ contract }
/>
);
} }
} }

View File

@ -30,7 +30,8 @@ export default class IdentityIcon extends Component {
return ( return (
<img <img
className={ styles.icon } className={ styles.icon }
src={ api.util.createIdentityImg(address, 4) } /> src={ api.util.createIdentityImg(address, 4) }
/>
); );
} }
} }

View File

@ -20,11 +20,12 @@ import { connect } from 'react-redux';
import InputText from './input-text'; import InputText from './input-text';
class InputTextContainer extends Component { class InputTextContainer extends Component {
render () { render () {
return (<InputText return (
{ ...this.props } <InputText
/>); { ...this.props }
/>
);
} }
} }

View File

@ -35,7 +35,6 @@ const initState = {
}; };
export default class InputText extends Component { export default class InputText extends Component {
static propTypes = { static propTypes = {
validationType: PropTypes.string.isRequired, validationType: PropTypes.string.isRequired,
onChange: PropTypes.func.isRequired, onChange: PropTypes.func.isRequired,
@ -64,7 +63,8 @@ export default class InputText extends Component {
disabled={ disabled } disabled={ disabled }
errorText={ error } errorText={ error }
onChange={ this.onChange } onChange={ this.onChange }
onKeyDown={ this.onKeyDown } /> onKeyDown={ this.onKeyDown }
/>
{ this.renderLoading() } { this.renderLoading() }
{ this.renderIsValid() } { this.renderIsValid() }
@ -146,5 +146,4 @@ export default class InputText extends Component {
return this.props.onChange(false, value); return this.props.onChange(false, value);
} }
} }

View File

@ -38,7 +38,8 @@ export default class Status extends Component {
<Chip <Chip
isAddress={ false } isAddress={ false }
value={ api.util.fromWei(fee).toFixed(3) + 'ETH' } value={ api.util.fromWei(fee).toFixed(3) + 'ETH' }
label='Fee' /> label='Fee'
/>
</div> </div>
); );
} }

View File

@ -56,7 +56,8 @@ export default class AddMeta extends Component {
icon={ <AddIcon /> } icon={ <AddIcon /> }
primary primary
fullWidth fullWidth
onTouchTap={ this.onShowDialog } /> onTouchTap={ this.onShowDialog }
/>
<Dialog <Dialog
title='add meta data' title='add meta data'
@ -64,7 +65,8 @@ export default class AddMeta extends Component {
modal={ this.state.complete } modal={ this.state.complete }
className={ styles.dialog } className={ styles.dialog }
onRequestClose={ this.onClose } onRequestClose={ this.onClose }
actions={ this.renderActions() } > actions={ this.renderActions() }
>
{ this.renderContent() } { this.renderContent() }
</Dialog> </Dialog>
</div>); </div>);
@ -78,7 +80,8 @@ export default class AddMeta extends Component {
<FlatButton <FlatButton
label='Done' label='Done'
primary primary
onTouchTap={ this.onClose } /> onTouchTap={ this.onClose }
/>
); );
} }
@ -88,12 +91,14 @@ export default class AddMeta extends Component {
<FlatButton <FlatButton
label='Cancel' label='Cancel'
primary primary
onTouchTap={ this.onClose } />, onTouchTap={ this.onClose }
/>,
<FlatButton <FlatButton
label='Add' label='Add'
primary primary
disabled={ !isValid } disabled={ !isValid }
onTouchTap={ this.onAdd } /> onTouchTap={ this.onAdd }
/>
]); ]);
} }
@ -130,7 +135,8 @@ export default class AddMeta extends Component {
floatingLabelText='Choose the meta-data to add' floatingLabelText='Choose the meta-data to add'
fullWidth fullWidth
value={ this.state.metaKeyIndex } value={ this.state.metaKeyIndex }
onChange={ this.onMetaKeyChange }> onChange={ this.onMetaKeyChange }
>
{ this.renderMetaKeyItems() } { this.renderMetaKeyItems() }
@ -142,7 +148,8 @@ export default class AddMeta extends Component {
hintText={ `The value of the ${selectedMeta.label.toLowerCase()} (${selectedMeta.validation === ADDRESS_TYPE ? 'Address' : 'Url Hint'})` } hintText={ `The value of the ${selectedMeta.label.toLowerCase()} (${selectedMeta.validation === ADDRESS_TYPE ? 'Address' : 'Url Hint'})` }
validationType={ selectedMeta.validation } validationType={ selectedMeta.validation }
onChange={ this.onChange } /> onChange={ this.onChange }
/>
</div> </div>
); );
} }
@ -152,7 +159,8 @@ export default class AddMeta extends Component {
<MenuItem <MenuItem
value={ index } value={ index }
key={ index } key={ index }
label={ key.label } primaryText={ key.label } /> label={ key.label } primaryText={ key.label }
/>
)); ));
} }
@ -194,5 +202,4 @@ export default class AddMeta extends Component {
value: '' value: ''
} }); } });
} }
} }

View File

@ -99,7 +99,8 @@ export default class Token extends Component {
return (<div> return (<div>
<Paper zDepth={ 1 } className={ styles.token } style={ { <Paper zDepth={ 1 } className={ styles.token } style={ {
backgroundColor: 'none' backgroundColor: 'none'
} }> } }
>
<div className={ styles['token-bg'] } /> <div className={ styles['token-bg'] } />
{ this.renderContent() } { this.renderContent() }
</Paper> </Paper>
@ -128,7 +129,8 @@ export default class Token extends Component {
floatingLabelText='Choose the meta-data to look-up' floatingLabelText='Choose the meta-data to look-up'
fullWidth fullWidth
value={ this.state.metaKeyIndex } value={ this.state.metaKeyIndex }
onChange={ this.onMetaKeyChange }> onChange={ this.onMetaKeyChange }
>
{ this.renderMetaKeyItems() } { this.renderMetaKeyItems() }
@ -139,7 +141,8 @@ export default class Token extends Component {
icon={ <FindIcon /> } icon={ <FindIcon /> }
primary primary
fullWidth fullWidth
onTouchTap={ this.onMetaLookup } /> onTouchTap={ this.onMetaLookup }
/>
</div> </div>
{ this.renderMeta(meta) } { this.renderMeta(meta) }
@ -157,7 +160,8 @@ export default class Token extends Component {
<MenuItem <MenuItem
value={ index } value={ index }
key={ index } key={ index }
label={ key.label } primaryText={ key.label } /> label={ key.label } primaryText={ key.label }
/>
)); ));
} }
@ -169,7 +173,8 @@ export default class Token extends Component {
return ( return (
<Chip <Chip
value={ Math.log10(base).toString() } value={ Math.log10(base).toString() }
label='Decimals' /> label='Decimals'
/>
); );
} }
@ -182,7 +187,8 @@ export default class Token extends Component {
<Chip <Chip
isAddress isAddress
value={ address } value={ address }
label='Address' /> label='Address'
/>
); );
} }
@ -192,7 +198,8 @@ export default class Token extends Component {
return ( return (
<Chip <Chip
value={ `${balance.toString()} ${tla}` } value={ `${balance.toString()} ${tla}` }
label='Total' /> label='Total'
/>
); );
} }
@ -212,7 +219,8 @@ export default class Token extends Component {
isAddress isAddress
displayValue={ displayValue } displayValue={ displayValue }
value={ owner } value={ owner }
label='Owner' /> label='Owner'
/>
); );
} }
@ -237,7 +245,8 @@ export default class Token extends Component {
<AddMeta <AddMeta
handleAddMeta={ this.props.handleAddMeta } handleAddMeta={ this.props.handleAddMeta }
isTokenOwner={ this.props.isTokenOwner } isTokenOwner={ this.props.isTokenOwner }
index={ this.props.index } /> index={ this.props.index }
/>
); );
} }
@ -253,7 +262,8 @@ export default class Token extends Component {
icon={ <DeleteIcon /> } icon={ <DeleteIcon /> }
secondary secondary
fullWidth fullWidth
onTouchTap={ this.onUnregister } /> onTouchTap={ this.onUnregister }
/>
); );
} }

View File

@ -51,9 +51,11 @@ export default class AddAddress extends Component {
title={ title={
<FormattedMessage <FormattedMessage
id='addAddress.label' id='addAddress.label'
defaultMessage='add saved address' /> defaultMessage='add saved address'
/>
} }
visible> visible
>
{ this.renderFields() } { this.renderFields() }
</Modal> </Modal>
); );
@ -68,20 +70,24 @@ export default class AddAddress extends Component {
label={ label={
<FormattedMessage <FormattedMessage
id='addAddress.button.close' id='addAddress.button.close'
defaultMessage='Cancel' /> defaultMessage='Cancel'
/>
} }
onClick={ this.onClose } onClick={ this.onClose }
ref='closeButton' />, ref='closeButton'
/>,
<Button <Button
disabled={ hasError } disabled={ hasError }
icon={ <ContentAdd /> } icon={ <ContentAdd /> }
label={ label={
<FormattedMessage <FormattedMessage
id='addAddress.button.add' id='addAddress.button.add'
defaultMessage='Save Address' /> defaultMessage='Save Address'
/>
} }
onClick={ this.onAdd } onClick={ this.onAdd }
ref='addButton' /> ref='addButton'
/>
]); ]);
} }
@ -97,45 +103,54 @@ export default class AddAddress extends Component {
hint={ hint={
<FormattedMessage <FormattedMessage
id='addAddress.input.address.hint' id='addAddress.input.address.hint'
defaultMessage='the network address for the entry' /> defaultMessage='the network address for the entry'
/>
} }
label={ label={
<FormattedMessage <FormattedMessage
id='addAddress.input.address.label' id='addAddress.input.address.label'
defaultMessage='network address' /> defaultMessage='network address'
/>
} }
onChange={ this.onEditAddress } onChange={ this.onEditAddress }
ref='inputAddress' ref='inputAddress'
value={ address } /> value={ address }
/>
<Input <Input
error={ nameError } error={ nameError }
hint={ hint={
<FormattedMessage <FormattedMessage
id='addAddress.input.name.hint' id='addAddress.input.name.hint'
defaultMessage='a descriptive name for the entry' /> defaultMessage='a descriptive name for the entry'
/>
} }
label={ label={
<FormattedMessage <FormattedMessage
id='addAddress.input.name.label' id='addAddress.input.name.label'
defaultMessage='address name' /> defaultMessage='address name'
/>
} }
onChange={ this.onEditName } onChange={ this.onEditName }
ref='inputName' ref='inputName'
value={ name } /> value={ name }
/>
<Input <Input
hint={ hint={
<FormattedMessage <FormattedMessage
id='addAddress.input.description.hint' id='addAddress.input.description.hint'
defaultMessage='an expanded description for the entry' /> defaultMessage='an expanded description for the entry'
/>
} }
label={ label={
<FormattedMessage <FormattedMessage
id='addAddress.input.description.label' id='addAddress.input.description.label'
defaultMessage='(optional) address description' /> defaultMessage='(optional) address description'
/>
} }
onChange={ this.onEditDescription } onChange={ this.onEditDescription }
ref='inputDescription' ref='inputDescription'
value={ description } /> value={ description }
/>
</Form> </Form>
); );
} }

View File

@ -51,13 +51,16 @@ class AddContract extends Component {
<FormattedMessage <FormattedMessage
id='addContract.title.type' id='addContract.title.type'
defaultMessage='choose a contract type' defaultMessage='choose a contract type'
key='type' />, key='type'
/>,
<FormattedMessage <FormattedMessage
id='addContract.title.details' id='addContract.title.details'
defaultMessage='enter contract details' defaultMessage='enter contract details'
key='details' /> key='details'
/>
] } ] }
visible> visible
>
{ this.renderStep() } { this.renderStep() }
</Modal> </Modal>
); );
@ -98,9 +101,11 @@ class AddContract extends Component {
label={ label={
<FormattedMessage <FormattedMessage
id='addContract.button.cancel' id='addContract.button.cancel'
defaultMessage='Cancel' /> defaultMessage='Cancel'
/>
} }
onClick={ this.onClose } /> onClick={ this.onClose }
/>
); );
if (step === 0) { if (step === 0) {
@ -112,9 +117,11 @@ class AddContract extends Component {
label={ label={
<FormattedMessage <FormattedMessage
id='addContract.button.next' id='addContract.button.next'
defaultMessage='Next' /> defaultMessage='Next'
/>
} }
onClick={ this.onNext } /> onClick={ this.onNext }
/>
]; ];
} }
@ -126,19 +133,23 @@ class AddContract extends Component {
label={ label={
<FormattedMessage <FormattedMessage
id='addContract.button.prev' id='addContract.button.prev'
defaultMessage='Back' /> defaultMessage='Back'
/>
} }
onClick={ this.onPrev } />, onClick={ this.onPrev }
/>,
<Button <Button
icon={ <AddIcon /> } icon={ <AddIcon /> }
key='add' key='add'
label={ label={
<FormattedMessage <FormattedMessage
id='addContract.button.add' id='addContract.button.add'
defaultMessage='Add Contract' /> defaultMessage='Add Contract'
/>
} }
disabled={ this.store.hasError } disabled={ this.store.hasError }
onClick={ this.onAdd } /> onClick={ this.onAdd }
/>
]; ];
} }
@ -152,58 +163,70 @@ class AddContract extends Component {
hint={ hint={
<FormattedMessage <FormattedMessage
id='addContract.address.hint' id='addContract.address.hint'
defaultMessage='the network address for the contract' /> defaultMessage='the network address for the contract'
/>
} }
label={ label={
<FormattedMessage <FormattedMessage
id='addContract.address.label' id='addContract.address.label'
defaultMessage='network address' /> defaultMessage='network address'
/>
} }
onChange={ this.onChangeAddress } onChange={ this.onChangeAddress }
onSubmit={ this.onEditAddress } onSubmit={ this.onEditAddress }
value={ address } /> value={ address }
/>
<Input <Input
error={ nameError } error={ nameError }
hint={ hint={
<FormattedMessage <FormattedMessage
id='addContract.name.hint' id='addContract.name.hint'
defaultMessage='a descriptive name for the contract' /> defaultMessage='a descriptive name for the contract'
/>
} }
label={ label={
<FormattedMessage <FormattedMessage
id='addContract.name.label' id='addContract.name.label'
defaultMessage='contract name' /> defaultMessage='contract name'
/>
} }
onSubmit={ this.onEditName } onSubmit={ this.onEditName }
value={ name } /> value={ name }
/>
<Input <Input
hint={ hint={
<FormattedMessage <FormattedMessage
id='addContract.description.hint' id='addContract.description.hint'
defaultMessage='an expanded description for the entry' /> defaultMessage='an expanded description for the entry'
/>
} }
label={ label={
<FormattedMessage <FormattedMessage
id='addContract.description.label' id='addContract.description.label'
defaultMessage='(optional) contract description' /> defaultMessage='(optional) contract description'
/>
} }
onSubmit={ this.onEditDescription } onSubmit={ this.onEditDescription }
value={ description } /> value={ description }
/>
<Input <Input
error={ abiError } error={ abiError }
hint={ hint={
<FormattedMessage <FormattedMessage
id='addContract.abi.hint' id='addContract.abi.hint'
defaultMessage='the abi for the contract' /> defaultMessage='the abi for the contract'
/>
} }
label={ label={
<FormattedMessage <FormattedMessage
id='addContract.abi.label' id='addContract.abi.label'
defaultMessage='contract abi' /> defaultMessage='contract abi'
/>
} }
onSubmit={ this.onEditAbi } onSubmit={ this.onEditAbi }
readOnly={ abiType.readOnly } readOnly={ abiType.readOnly }
value={ abi } /> value={ abi }
/>
</Form> </Form>
); );
} }

View File

@ -37,7 +37,8 @@ function render (props = {}) {
<AddContract <AddContract
{ ...props } { ...props }
contracts={ CONTRACTS } contracts={ CONTRACTS }
onClose={ onClose } />, onClose={ onClose }
/>,
{ context: { store: reduxStore } } { context: { store: reduxStore } }
).find('AddContract').shallow({ context: { api } }); ).find('AddContract').shallow({ context: { api } });
instance = component.instance(); instance = component.instance();

View File

@ -30,15 +30,18 @@ const ABI_TYPES = [
<a href='https://github.com/ethereum/EIPs/issues/20' target='_blank'> <a href='https://github.com/ethereum/EIPs/issues/20' target='_blank'>
<FormattedMessage <FormattedMessage
id='addContract.abiType.token.erc20' id='addContract.abiType.token.erc20'
defaultMessage='ERC 20' /> defaultMessage='ERC 20'
/>
</a> </a>
) )
} } /> } }
/>
), ),
label: ( label: (
<FormattedMessage <FormattedMessage
id='addContract.abiType.token.label' id='addContract.abiType.token.label'
defaultMessage='Token' /> defaultMessage='Token'
/>
), ),
readOnly: true, readOnly: true,
type: 'token', type: 'token',
@ -54,15 +57,18 @@ const ABI_TYPES = [
<a href='https://github.com/ethereum/dapp-bin/blob/master/wallet/wallet.sol' target='_blank'> <a href='https://github.com/ethereum/dapp-bin/blob/master/wallet/wallet.sol' target='_blank'>
<FormattedMessage <FormattedMessage
id='addContract.abiType.multisigWallet.link' id='addContract.abiType.multisigWallet.link'
defaultMessage='see contract code' /> defaultMessage='see contract code'
/>
</a> </a>
) )
} } /> } }
/>
), ),
label: ( label: (
<FormattedMessage <FormattedMessage
id='addContract.abiType.multisigWallet.label' id='addContract.abiType.multisigWallet.label'
defaultMessage='Multisig Wallet' /> defaultMessage='Multisig Wallet'
/>
), ),
readOnly: true, readOnly: true,
type: 'multisig', type: 'multisig',
@ -72,12 +78,14 @@ const ABI_TYPES = [
description: ( description: (
<FormattedMessage <FormattedMessage
id='addContract.abiType.custom.description' id='addContract.abiType.custom.description'
defaultMessage='Contract created from custom ABI' /> defaultMessage='Contract created from custom ABI'
/>
), ),
label: ( label: (
<FormattedMessage <FormattedMessage
id='addContract.abiType.custom.label' id='addContract.abiType.custom.label'
defaultMessage='Custom Contract' /> defaultMessage='Custom Contract'
/>
), ),
type: 'custom', type: 'custom',
value: '' value: ''

View File

@ -47,46 +47,56 @@ export default class AddDapps extends Component {
label={ label={
<FormattedMessage <FormattedMessage
id='dapps.add.button.done' id='dapps.add.button.done'
defaultMessage='Done' /> defaultMessage='Done'
/>
} }
onClick={ store.closeModal } /> onClick={ store.closeModal }
/>
] } ] }
compact compact
title={ title={
<FormattedMessage <FormattedMessage
id='dapps.add.label' id='dapps.add.label'
defaultMessage='visible applications' /> defaultMessage='visible applications'
/>
} }
visible> visible
>
<div className={ styles.warning } /> <div className={ styles.warning } />
{ {
this.renderList(store.sortedLocal, this.renderList(store.sortedLocal,
<FormattedMessage <FormattedMessage
id='dapps.add.local.label' id='dapps.add.local.label'
defaultMessage='Applications locally available' />, defaultMessage='Applications locally available'
/>,
<FormattedMessage <FormattedMessage
id='dapps.add.local.desc' id='dapps.add.local.desc'
defaultMessage='All applications installed locally on the machine by the user for access by the Parity client.' /> defaultMessage='All applications installed locally on the machine by the user for access by the Parity client.'
/>
) )
} }
{ {
this.renderList(store.sortedBuiltin, this.renderList(store.sortedBuiltin,
<FormattedMessage <FormattedMessage
id='dapps.add.builtin.label' id='dapps.add.builtin.label'
defaultMessage='Applications bundled with Parity' />, defaultMessage='Applications bundled with Parity'
/>,
<FormattedMessage <FormattedMessage
id='dapps.add.builtin.desc' id='dapps.add.builtin.desc'
defaultMessage='Experimental applications developed by the Parity team to show off dapp capabilities, integration, experimental features and to control certain network-wide client behaviour.' /> defaultMessage='Experimental applications developed by the Parity team to show off dapp capabilities, integration, experimental features and to control certain network-wide client behaviour.'
/>
) )
} }
{ {
this.renderList(store.sortedNetwork, this.renderList(store.sortedNetwork,
<FormattedMessage <FormattedMessage
id='dapps.add.network.label' id='dapps.add.network.label'
defaultMessage='Applications on the global network' />, defaultMessage='Applications on the global network'
/>,
<FormattedMessage <FormattedMessage
id='dapps.add.network.desc' id='dapps.add.network.desc'
defaultMessage='These applications are not affiliated with Parity nor are they published by Parity. Each remain under the control of their respective authors. Please ensure that you understand the goals for each application before interacting.' /> defaultMessage='These applications are not affiliated with Parity nor are they published by Parity. Each remain under the control of their respective authors. Please ensure that you understand the goals for each application before interacting.'
/>
) )
} }
</Modal> </Modal>

View File

@ -35,12 +35,14 @@ export default class AccountDetails extends Component {
allowCopy allowCopy
hint='a descriptive name for the account' hint='a descriptive name for the account'
label='account name' label='account name'
value={ name } /> value={ name }
/>
<InputAddress <InputAddress
disabled disabled
hint='the network address for the account' hint='the network address for the account'
label='address' label='address'
value={ address } /> value={ address }
/>
{ this.renderPhrase() } { this.renderPhrase() }
</Form> </Form>
); );
@ -59,7 +61,8 @@ export default class AccountDetails extends Component {
allowCopy allowCopy
hint='the account recovery phrase' hint='the account recovery phrase'
label='owner recovery phrase (keep private and secure, it allows full and unlimited access to the account)' label='owner recovery phrase (keep private and secure, it allows full and unlimited access to the account)'
value={ phrase } /> value={ phrase }
/>
); );
} }
} }

View File

@ -34,25 +34,32 @@ export default class CreationType extends Component {
<RadioButtonGroup <RadioButtonGroup
defaultSelected='fromNew' defaultSelected='fromNew'
name='creationType' name='creationType'
onChange={ this.onChange }> onChange={ this.onChange }
>
<RadioButton <RadioButton
label='Create new account manually' label='Create new account manually'
value='fromNew' /> value='fromNew'
/>
<RadioButton <RadioButton
label='Recover account from recovery phrase' label='Recover account from recovery phrase'
value='fromPhrase' /> value='fromPhrase'
/>
<RadioButton <RadioButton
label='Import accounts from Geth keystore' label='Import accounts from Geth keystore'
value='fromGeth' /> value='fromGeth'
/>
<RadioButton <RadioButton
label='Import account from a backup JSON file' label='Import account from a backup JSON file'
value='fromJSON' /> value='fromJSON'
/>
<RadioButton <RadioButton
label='Import account from an Ethereum pre-sale wallet' label='Import account from an Ethereum pre-sale wallet'
value='fromPresale' /> value='fromPresale'
/>
<RadioButton <RadioButton
label='Import raw private key' label='Import raw private key'
value='fromRaw' /> value='fromRaw'
/>
</RadioButtonGroup> </RadioButtonGroup>
</div> </div>
); );

View File

@ -64,12 +64,14 @@ export default class CreateAccount extends Component {
hint='a descriptive name for the account' hint='a descriptive name for the account'
error={ accountNameError } error={ accountNameError }
value={ accountName } value={ accountName }
onChange={ this.onEditAccountName } /> onChange={ this.onEditAccountName }
/>
<Input <Input
label='password hint' label='password hint'
hint='(optional) a hint to help with remembering the password' hint='(optional) a hint to help with remembering the password'
value={ passwordHint } value={ passwordHint }
onChange={ this.onEditPasswordHint } /> onChange={ this.onEditPasswordHint }
/>
<div className={ styles.passwords }> <div className={ styles.passwords }>
<div className={ styles.password }> <div className={ styles.password }>
<Input <Input
@ -78,7 +80,8 @@ export default class CreateAccount extends Component {
type='password' type='password'
error={ password1Error } error={ password1Error }
value={ password1 } value={ password1 }
onChange={ this.onEditPassword1 } /> onChange={ this.onEditPassword1 }
/>
</div> </div>
<div className={ styles.password }> <div className={ styles.password }>
<Input <Input
@ -87,7 +90,8 @@ export default class CreateAccount extends Component {
type='password' type='password'
error={ password2Error } error={ password2Error }
value={ password2 } value={ password2 }
onChange={ this.onEditPassword2 } /> onChange={ this.onEditPassword2 }
/>
</div> </div>
</div> </div>
{ this.renderIdentitySelector() } { this.renderIdentitySelector() }
@ -108,7 +112,8 @@ export default class CreateAccount extends Component {
<RadioButton <RadioButton
className={ styles.button } className={ styles.button }
key={ address } key={ address }
value={ address } /> value={ address }
/>
); );
}); });
@ -117,7 +122,8 @@ export default class CreateAccount extends Component {
valueSelected={ selectedAddress } valueSelected={ selectedAddress }
className={ styles.selector } className={ styles.selector }
name='identitySelector' name='identitySelector'
onChange={ this.onChangeIdentity }> onChange={ this.onChangeIdentity }
>
{ buttons } { buttons }
</RadioButtonGroup> </RadioButtonGroup>
); );
@ -135,10 +141,12 @@ export default class CreateAccount extends Component {
<div <div
className={ styles.identity } className={ styles.identity }
key={ address } key={ address }
onTouchTap={ this.onChangeIdentity }> onTouchTap={ this.onChangeIdentity }
>
<IdentityIcon <IdentityIcon
address={ address } address={ address }
center /> center
/>
</div> </div>
); );
}); });
@ -148,9 +156,11 @@ export default class CreateAccount extends Component {
{ identities } { identities }
<div className={ styles.refresh }> <div className={ styles.refresh }>
<IconButton <IconButton
onTouchTap={ this.createIdentities }> onTouchTap={ this.createIdentities }
>
<ActionAutorenew <ActionAutorenew
color='rgb(0, 151, 167)' /> color='rgb(0, 151, 167)'
/>
</IconButton> </IconButton>
</div> </div>
</div> </div>

View File

@ -54,7 +54,8 @@ export default class NewGeth extends Component {
<div className={ styles.icon }> <div className={ styles.icon }>
<IdentityIcon <IdentityIcon
center inline center inline
address={ account.address } /> address={ account.address }
/>
</div> </div>
<div className={ styles.detail }> <div className={ styles.detail }>
<div className={ styles.address }>{ account.address }</div> <div className={ styles.address }>{ account.address }</div>
@ -69,7 +70,8 @@ export default class NewGeth extends Component {
checked={ account.checked } checked={ account.checked }
label={ label } label={ label }
data-address={ account.address } data-address={ account.address }
onCheck={ this.onSelect } /> onCheck={ this.onSelect }
/>
); );
}); });

View File

@ -59,12 +59,14 @@ export default class NewImport extends Component {
hint='a descriptive name for the account' hint='a descriptive name for the account'
error={ this.state.accountNameError } error={ this.state.accountNameError }
value={ this.state.accountName } value={ this.state.accountName }
onChange={ this.onEditAccountName } /> onChange={ this.onEditAccountName }
/>
<Input <Input
label='password hint' label='password hint'
hint='(optional) a hint to help with remembering the password' hint='(optional) a hint to help with remembering the password'
value={ this.state.passwordHint } value={ this.state.passwordHint }
onChange={ this.onEditpasswordHint } /> onChange={ this.onEditpasswordHint }
/>
<div className={ styles.passwords }> <div className={ styles.passwords }>
<div className={ styles.password }> <div className={ styles.password }>
<Input <Input
@ -73,7 +75,8 @@ export default class NewImport extends Component {
type='password' type='password'
error={ this.state.passwordError } error={ this.state.passwordError }
value={ this.state.password } value={ this.state.password }
onChange={ this.onEditPassword } /> onChange={ this.onEditPassword }
/>
</div> </div>
</div> </div>
<div> <div>
@ -82,18 +85,21 @@ export default class NewImport extends Component {
label='wallet file' label='wallet file'
hint='the wallet file for import' hint='the wallet file for import'
error={ this.state.walletFileError } error={ this.state.walletFileError }
value={ this.state.walletFile } /> value={ this.state.walletFile }
/>
<div className={ styles.upload }> <div className={ styles.upload }>
<FloatingActionButton <FloatingActionButton
mini mini
onTouchTap={ this.openFileDialog }> onTouchTap={ this.openFileDialog }
>
<EditorAttachFile /> <EditorAttachFile />
</FloatingActionButton> </FloatingActionButton>
<input <input
ref='fileUpload' ref='fileUpload'
type='file' type='file'
style={ STYLE_HIDDEN } style={ STYLE_HIDDEN }
onChange={ this.onFileChange } /> onChange={ this.onFileChange }
/>
</div> </div>
</div> </div>
</Form> </Form>

View File

@ -60,18 +60,21 @@ export default class RawKey extends Component {
label='private key' label='private key'
error={ rawKeyError } error={ rawKeyError }
value={ rawKey } value={ rawKey }
onChange={ this.onEditKey } /> onChange={ this.onEditKey }
/>
<Input <Input
label='account name' label='account name'
hint='a descriptive name for the account' hint='a descriptive name for the account'
error={ accountNameError } error={ accountNameError }
value={ accountName } value={ accountName }
onChange={ this.onEditAccountName } /> onChange={ this.onEditAccountName }
/>
<Input <Input
label='password hint' label='password hint'
hint='(optional) a hint to help with remembering the password' hint='(optional) a hint to help with remembering the password'
value={ passwordHint } value={ passwordHint }
onChange={ this.onEditPasswordHint } /> onChange={ this.onEditPasswordHint }
/>
<div className={ styles.passwords }> <div className={ styles.passwords }>
<div className={ styles.password }> <div className={ styles.password }>
<Input <Input
@ -80,7 +83,8 @@ export default class RawKey extends Component {
type='password' type='password'
error={ password1Error } error={ password1Error }
value={ password1 } value={ password1 }
onChange={ this.onEditPassword1 } /> onChange={ this.onEditPassword1 }
/>
</div> </div>
<div className={ styles.password }> <div className={ styles.password }>
<Input <Input
@ -89,7 +93,8 @@ export default class RawKey extends Component {
type='password' type='password'
error={ password2Error } error={ password2Error }
value={ password2 } value={ password2 }
onChange={ this.onEditPassword2 } /> onChange={ this.onEditPassword2 }
/>
</div> </div>
</div> </div>
</Form> </Form>

View File

@ -57,18 +57,21 @@ export default class RecoveryPhrase extends Component {
hint='the account recovery phrase' hint='the account recovery phrase'
label='account recovery phrase' label='account recovery phrase'
value={ recoveryPhrase } value={ recoveryPhrase }
onChange={ this.onEditPhrase } /> onChange={ this.onEditPhrase }
/>
<Input <Input
label='account name' label='account name'
hint='a descriptive name for the account' hint='a descriptive name for the account'
error={ accountNameError } error={ accountNameError }
value={ accountName } value={ accountName }
onChange={ this.onEditAccountName } /> onChange={ this.onEditAccountName }
/>
<Input <Input
label='password hint' label='password hint'
hint='(optional) a hint to help with remembering the password' hint='(optional) a hint to help with remembering the password'
value={ passwordHint } value={ passwordHint }
onChange={ this.onEditPasswordHint } /> onChange={ this.onEditPasswordHint }
/>
<div className={ styles.passwords }> <div className={ styles.passwords }>
<div className={ styles.password }> <div className={ styles.password }>
<Input <Input
@ -77,7 +80,8 @@ export default class RecoveryPhrase extends Component {
type='password' type='password'
error={ password1Error } error={ password1Error }
value={ password1 } value={ password1 }
onChange={ this.onEditPassword1 } /> onChange={ this.onEditPassword1 }
/>
</div> </div>
<div className={ styles.password }> <div className={ styles.password }>
<Input <Input
@ -86,7 +90,8 @@ export default class RecoveryPhrase extends Component {
type='password' type='password'
error={ password2Error } error={ password2Error }
value={ password2 } value={ password2 }
onChange={ this.onEditPassword2 } /> onChange={ this.onEditPassword2 }
/>
</div> </div>
</div> </div>
<Checkbox <Checkbox

View File

@ -87,7 +87,8 @@ export default class CreateAccount extends Component {
visible visible
actions={ this.renderDialogActions() } actions={ this.renderDialogActions() }
current={ stage } current={ stage }
steps={ steps }> steps={ steps }
>
{ this.renderWarning() } { this.renderWarning() }
{ this.renderPage() } { this.renderPage() }
</Modal> </Modal>
@ -162,11 +163,13 @@ export default class CreateAccount extends Component {
<Button <Button
icon={ <ContentClear /> } icon={ <ContentClear /> }
label='Cancel' label='Cancel'
onClick={ this.onClose } />, onClick={ this.onClose }
/>,
<Button <Button
icon={ <NavigationArrowForward /> } icon={ <NavigationArrowForward /> }
label='Next' label='Next'
onClick={ this.onNext } /> onClick={ this.onNext }
/>
]; ];
case 1: case 1:
const createLabel = createType === 'fromNew' const createLabel = createType === 'fromNew'
@ -177,16 +180,19 @@ export default class CreateAccount extends Component {
<Button <Button
icon={ <ContentClear /> } icon={ <ContentClear /> }
label='Cancel' label='Cancel'
onClick={ this.onClose } />, onClick={ this.onClose }
/>,
<Button <Button
icon={ <NavigationArrowBack /> } icon={ <NavigationArrowBack /> }
label='Back' label='Back'
onClick={ this.onPrev } />, onClick={ this.onPrev }
/>,
<Button <Button
icon={ <ActionDone /> } icon={ <ActionDone /> }
label={ createLabel } label={ createLabel }
disabled={ !this.state.canCreate } disabled={ !this.state.canCreate }
onClick={ this.onCreate } /> onClick={ this.onCreate }
/>
]; ];
case 2: case 2:
@ -195,12 +201,14 @@ export default class CreateAccount extends Component {
<Button <Button
icon={ <PrintIcon /> } icon={ <PrintIcon /> }
label='Print Phrase' label='Print Phrase'
onClick={ this.printPhrase } /> onClick={ this.printPhrase }
/>
) : null, ) : null,
<Button <Button
icon={ <ActionDoneAll /> } icon={ <ActionDoneAll /> }
label='Close' label='Close'
onClick={ this.onClose } /> onClick={ this.onClose }
/>
]; ];
} }
} }

View File

@ -21,30 +21,35 @@ export default {
noFile: ( noFile: (
<FormattedMessage <FormattedMessage
id='createAccount.error.noFile' id='createAccount.error.noFile'
defaultMessage='select a valid wallet file to import' /> defaultMessage='select a valid wallet file to import'
/>
), ),
noKey: ( noKey: (
<FormattedMessage <FormattedMessage
id='createAccount.error.noKey' id='createAccount.error.noKey'
defaultMessage='you need to provide the raw private key' /> defaultMessage='you need to provide the raw private key'
/>
), ),
noMatchPassword: ( noMatchPassword: (
<FormattedMessage <FormattedMessage
id='createAccount.error.noMatchPassword' id='createAccount.error.noMatchPassword'
defaultMessage='the supplied passwords does not match' /> defaultMessage='the supplied passwords does not match'
/>
), ),
noName: ( noName: (
<FormattedMessage <FormattedMessage
id='createAccount.error.noName' id='createAccount.error.noName'
defaultMessage='you need to specify a valid name for the account' /> defaultMessage='you need to specify a valid name for the account'
/>
), ),
invalidKey: ( invalidKey: (
<FormattedMessage <FormattedMessage
id='createAccount.error.invalidKey' id='createAccount.error.invalidKey'
defaultMessage='the raw key needs to be hex, 64 characters in length and contain the prefix "0x"' /> defaultMessage='the raw key needs to be hex, 64 characters in length and contain the prefix "0x"'
/>
) )
}; };

View File

@ -204,7 +204,6 @@ export default class CreateWallet extends Component {
default: default:
case 'TYPE': case 'TYPE':
return [ cancelBtn, nextBtn ]; return [ cancelBtn, nextBtn ];
} }
} }

View File

@ -47,17 +47,21 @@ export default class DappPermissions extends Component {
label={ label={
<FormattedMessage <FormattedMessage
id='dapps.permissions.button.done' id='dapps.permissions.button.done'
defaultMessage='Done' /> defaultMessage='Done'
/>
} }
onClick={ store.closeModal } /> onClick={ store.closeModal }
/>
] } ] }
compact compact
title={ title={
<FormattedMessage <FormattedMessage
id='dapps.permissions.label' id='dapps.permissions.label'
defaultMessage='visible dapp accounts' /> defaultMessage='visible dapp accounts'
/>
} }
visible> visible
>
<List> <List>
{ this.renderListItems() } { this.renderListItems() }
</List> </List>
@ -105,7 +109,8 @@ export default class DappPermissions extends Component {
</div> </div>
</div> </div>
</div> </div>
} /> }
/>
); );
}); });
} }

View File

@ -49,14 +49,16 @@ class DeleteAccount extends Component {
title='confirm removal' title='confirm removal'
visible visible
onDeny={ this.closeDeleteDialog } onDeny={ this.closeDeleteDialog }
onConfirm={ this.onDeleteConfirmed }> onConfirm={ this.onDeleteConfirmed }
>
<div className={ styles.hero }> <div className={ styles.hero }>
Are you sure you want to permanently delete the following account? Are you sure you want to permanently delete the following account?
</div> </div>
<div className={ styles.info }> <div className={ styles.info }>
<IdentityIcon <IdentityIcon
className={ styles.icon } className={ styles.icon }
address={ account.address } /> address={ account.address }
/>
<div className={ styles.nameinfo }> <div className={ styles.nameinfo }>
<div className={ styles.header }> <div className={ styles.header }>
<IdentityName address={ account.address } unknown /> <IdentityName address={ account.address } unknown />
@ -75,7 +77,8 @@ class DeleteAccount extends Component {
hint='provide the account password to confirm the account deletion' hint='provide the account password to confirm the account deletion'
type='password' type='password'
value={ password } value={ password }
onChange={ this.onChangePassword } /> onChange={ this.onChangePassword }
/>
</div> </div>
</ConfirmDialog> </ConfirmDialog>
); );

View File

@ -99,12 +99,14 @@ export default class DetailsStep extends Component {
hint={ hint={
<FormattedMessage <FormattedMessage
id='deployContract.details.address.hint' id='deployContract.details.address.hint'
defaultMessage='the owner account for this contract' /> defaultMessage='the owner account for this contract'
/>
} }
label={ label={
<FormattedMessage <FormattedMessage
id='deployContract.details.address.label' id='deployContract.details.address.label'
defaultMessage='from account (contract owner)' /> defaultMessage='from account (contract owner)'
/>
} }
onChange={ this.onFromAddressChange } onChange={ this.onFromAddressChange }
value={ fromAddress } value={ fromAddress }
@ -115,12 +117,14 @@ export default class DetailsStep extends Component {
hint={ hint={
<FormattedMessage <FormattedMessage
id='deployContract.details.name.hint' id='deployContract.details.name.hint'
defaultMessage='a name for the deployed contract' /> defaultMessage='a name for the deployed contract'
/>
} }
label={ label={
<FormattedMessage <FormattedMessage
id='deployContract.details.name.label' id='deployContract.details.name.label'
defaultMessage='contract name' /> defaultMessage='contract name'
/>
} }
onChange={ this.onNameChange } onChange={ this.onNameChange }
value={ name || '' } value={ name || '' }
@ -131,12 +135,14 @@ export default class DetailsStep extends Component {
hint={ hint={
<FormattedMessage <FormattedMessage
id='deployContract.details.description.hint' id='deployContract.details.description.hint'
defaultMessage='a description for the contract' /> defaultMessage='a description for the contract'
/>
} }
label={ label={
<FormattedMessage <FormattedMessage
id='deployContract.details.description.label' id='deployContract.details.description.label'
defaultMessage='contract description (optional)' /> defaultMessage='contract description (optional)'
/>
} }
onChange={ this.onDescriptionChange } onChange={ this.onDescriptionChange }
value={ description } value={ description }
@ -149,12 +155,14 @@ export default class DetailsStep extends Component {
hint={ hint={
<FormattedMessage <FormattedMessage
id='deployContract.details.abi.hint' id='deployContract.details.abi.hint'
defaultMessage='the abi of the contract to deploy or solc combined-output' /> defaultMessage='the abi of the contract to deploy or solc combined-output'
/>
} }
label={ label={
<FormattedMessage <FormattedMessage
id='deployContract.details.abi.label' id='deployContract.details.abi.label'
defaultMessage='abi / solc combined-output' /> defaultMessage='abi / solc combined-output'
/>
} }
onChange={ this.onSolcChange } onChange={ this.onSolcChange }
onSubmit={ this.onSolcSubmit } onSubmit={ this.onSolcSubmit }
@ -166,12 +174,14 @@ export default class DetailsStep extends Component {
hint={ hint={
<FormattedMessage <FormattedMessage
id='deployContract.details.code.hint' id='deployContract.details.code.hint'
defaultMessage='the compiled code of the contract to deploy' /> defaultMessage='the compiled code of the contract to deploy'
/>
} }
label={ label={
<FormattedMessage <FormattedMessage
id='deployContract.details.code.label' id='deployContract.details.code.label'
defaultMessage='code' /> defaultMessage='code'
/>
} }
onSubmit={ this.onCodeChange } onSubmit={ this.onCodeChange }
readOnly={ readOnly || solc } readOnly={ readOnly || solc }
@ -196,7 +206,8 @@ export default class DetailsStep extends Component {
<MenuItem <MenuItem
key={ index } key={ index }
label={ name } label={ name }
value={ index }> value={ index }
>
{ name } { name }
</MenuItem> </MenuItem>
)); ));
@ -206,10 +217,12 @@ export default class DetailsStep extends Component {
label={ label={
<FormattedMessage <FormattedMessage
id='deployContract.details.contract.label' id='deployContract.details.contract.label'
defaultMessage='select a contract' /> defaultMessage='select a contract'
/>
} }
onChange={ this.onContractChange } onChange={ this.onContractChange }
value={ selectedContractIndex }> value={ selectedContractIndex }
>
{ contractsItems } { contractsItems }
</Select> </Select>
); );

View File

@ -84,7 +84,8 @@ export default class ParametersStep extends Component {
label={ label } label={ label }
onChange={ onChange } onChange={ onChange }
param={ param } param={ param }
value={ value } /> value={ value }
/>
</div> </div>
); );
}); });
@ -94,7 +95,8 @@ export default class ParametersStep extends Component {
<p> <p>
<FormattedMessage <FormattedMessage
id='deployContract.parameters.choose' id='deployContract.parameters.choose'
defaultMessage='Choose the contract parameters' /> defaultMessage='Choose the contract parameters'
/>
</p> </p>
{ inputsComponents } { inputsComponents }
</div> </div>

View File

@ -37,14 +37,16 @@ const STEPS = {
title: ( title: (
<FormattedMessage <FormattedMessage
id='deployContract.title.details' id='deployContract.title.details'
defaultMessage='contract details' /> defaultMessage='contract details'
/>
) )
}, },
CONTRACT_PARAMETERS: { CONTRACT_PARAMETERS: {
title: ( title: (
<FormattedMessage <FormattedMessage
id='deployContract.title.parameters' id='deployContract.title.parameters'
defaultMessage='contract parameters' /> defaultMessage='contract parameters'
/>
) )
}, },
DEPLOYMENT: { DEPLOYMENT: {
@ -52,14 +54,16 @@ const STEPS = {
title: ( title: (
<FormattedMessage <FormattedMessage
id='deployContract.title.deployment' id='deployContract.title.deployment'
defaultMessage='deployment' /> defaultMessage='deployment'
/>
) )
}, },
COMPLETED: { COMPLETED: {
title: ( title: (
<FormattedMessage <FormattedMessage
id='deployContract.title.completed' id='deployContract.title.completed'
defaultMessage='completed' /> defaultMessage='completed'
/>
) )
} }
}; };
@ -149,10 +153,12 @@ class DeployContract extends Component {
: (deployError : (deployError
? <FormattedMessage ? <FormattedMessage
id='deployContract.title.failed' id='deployContract.title.failed'
defaultMessage='deployment failed' /> defaultMessage='deployment failed'
/>
: <FormattedMessage : <FormattedMessage
id='deployContract.title.rejected' id='deployContract.title.rejected'
defaultMessage='rejected' /> defaultMessage='rejected'
/>
); );
const waiting = realSteps const waiting = realSteps
@ -170,7 +176,8 @@ class DeployContract extends Component {
} }
title={ title } title={ title }
visible visible
waiting={ waiting }> waiting={ waiting }
>
{ this.renderExceptionWarning() } { this.renderExceptionWarning() }
{ this.renderStep() } { this.renderStep() }
</Modal> </Modal>
@ -188,7 +195,8 @@ class DeployContract extends Component {
return ( return (
<Warning <Warning
warning={ errorEstimated } /> warning={ errorEstimated }
/>
); );
} }
@ -202,9 +210,11 @@ class DeployContract extends Component {
label={ label={
<FormattedMessage <FormattedMessage
id='deployContract.button.cancel' id='deployContract.button.cancel'
defaultMessage='Cancel' /> defaultMessage='Cancel'
/>
} }
onClick={ this.onClose } /> onClick={ this.onClose }
/>
); );
const closeBtn = ( const closeBtn = (
@ -213,9 +223,11 @@ class DeployContract extends Component {
label={ label={
<FormattedMessage <FormattedMessage
id='deployContract.button.close' id='deployContract.button.close'
defaultMessage='Close' /> defaultMessage='Close'
/>
} }
onClick={ this.onClose } /> onClick={ this.onClose }
/>
); );
const closeBtnOk = ( const closeBtnOk = (
@ -224,9 +236,11 @@ class DeployContract extends Component {
label={ label={
<FormattedMessage <FormattedMessage
id='deployContract.button.done' id='deployContract.button.done'
defaultMessage='Done' /> defaultMessage='Done'
/>
} }
onClick={ this.onClose } /> onClick={ this.onClose }
/>
); );
if (deployError) { if (deployError) {
@ -242,14 +256,17 @@ class DeployContract extends Component {
icon={ icon={
<IdentityIcon <IdentityIcon
address={ fromAddress } address={ fromAddress }
button /> button
/>
} }
label={ label={
<FormattedMessage <FormattedMessage
id='deployContract.button.next' id='deployContract.button.next'
defaultMessage='Next' /> defaultMessage='Next'
/>
} }
onClick={ this.onParametersStep } /> onClick={ this.onParametersStep }
/>
]; ];
case 'CONTRACT_PARAMETERS': case 'CONTRACT_PARAMETERS':
@ -259,14 +276,17 @@ class DeployContract extends Component {
icon={ icon={
<IdentityIcon <IdentityIcon
address={ fromAddress } address={ fromAddress }
button /> button
/>
} }
label={ label={
<FormattedMessage <FormattedMessage
id='deployContract.button.create' id='deployContract.button.create'
defaultMessage='Create' /> defaultMessage='Create'
/>
} }
onClick={ this.onDeployStart } /> onClick={ this.onDeployStart }
/>
]; ];
case 'DEPLOYMENT': case 'DEPLOYMENT':
@ -293,13 +313,16 @@ class DeployContract extends Component {
title={ title={
<FormattedMessage <FormattedMessage
id='deployContract.rejected.title' id='deployContract.rejected.title'
defaultMessage='The deployment has been rejected' /> defaultMessage='The deployment has been rejected'
/>
} }
state={ state={
<FormattedMessage <FormattedMessage
id='deployContract.rejected.description' id='deployContract.rejected.description'
defaultMessage='You can safely close this window, the contract deployment will not occur.' /> defaultMessage='You can safely close this window, the contract deployment will not occur.'
} /> />
}
/>
); );
} }
@ -340,9 +363,11 @@ class DeployContract extends Component {
title={ title={
<FormattedMessage <FormattedMessage
id='deployContract.busy.title' id='deployContract.busy.title'
defaultMessage='The deployment is currently in progress' /> defaultMessage='The deployment is currently in progress'
/>
} }
state={ deployState }> state={ deployState }
>
{ body } { body }
</BusyStep> </BusyStep>
); );
@ -353,7 +378,8 @@ class DeployContract extends Component {
<div> <div>
<FormattedMessage <FormattedMessage
id='deployContract.completed.description' id='deployContract.completed.description'
defaultMessage='Your contract has been deployed at' /> defaultMessage='Your contract has been deployed at'
/>
</div> </div>
<div> <div>
<CopyToClipboard data={ address } /> <CopyToClipboard data={ address } />
@ -361,7 +387,8 @@ class DeployContract extends Component {
address={ address } address={ address }
center center
className={ styles.identityicon } className={ styles.identityicon }
inline /> inline
/>
<div className={ styles.address }> <div className={ styles.address }>
{ address } { address }
</div> </div>
@ -420,7 +447,8 @@ class DeployContract extends Component {
: ( : (
<FormattedMessage <FormattedMessage
id='deployContract.owner.noneSelected' id='deployContract.owner.noneSelected'
defaultMessage='a valid account as the contract owner needs to be selected' /> defaultMessage='a valid account as the contract owner needs to be selected'
/>
); );
this.setState({ fromAddress, fromAddressError }, this.estimateGas); this.setState({ fromAddress, fromAddressError }, this.estimateGas);
@ -510,7 +538,8 @@ class DeployContract extends Component {
deployState: ( deployState: (
<FormattedMessage <FormattedMessage
id='deployContract.state.preparing' id='deployContract.state.preparing'
defaultMessage='Preparing transaction for network transmission' /> defaultMessage='Preparing transaction for network transmission'
/>
) )
}); });
return; return;
@ -520,7 +549,8 @@ class DeployContract extends Component {
deployState: ( deployState: (
<FormattedMessage <FormattedMessage
id='deployContract.state.waitSigner' id='deployContract.state.waitSigner'
defaultMessage='Waiting for confirmation of the transaction in the Parity Secure Signer' /> defaultMessage='Waiting for confirmation of the transaction in the Parity Secure Signer'
/>
) )
}); });
return; return;
@ -531,7 +561,8 @@ class DeployContract extends Component {
deployState: ( deployState: (
<FormattedMessage <FormattedMessage
id='deployContract.state.waitReceipt' id='deployContract.state.waitReceipt'
defaultMessage='Waiting for the contract deployment transaction receipt' /> defaultMessage='Waiting for the contract deployment transaction receipt'
/>
) )
}); });
return; return;
@ -542,7 +573,8 @@ class DeployContract extends Component {
deployState: ( deployState: (
<FormattedMessage <FormattedMessage
id='deployContract.state.validatingCode' id='deployContract.state.validatingCode'
defaultMessage='Validating the deployed contract code' /> defaultMessage='Validating the deployed contract code'
/>
) )
}); });
return; return;
@ -552,7 +584,8 @@ class DeployContract extends Component {
deployState: ( deployState: (
<FormattedMessage <FormattedMessage
id='deployContract.state.completed' id='deployContract.state.completed'
defaultMessage='The contract deployment has been completed' /> defaultMessage='The contract deployment has been completed'
/>
) )
}); });
return; return;

View File

@ -41,7 +41,8 @@ function renderShallow () {
<DeployContract <DeployContract
accounts={ {} } accounts={ {} }
store={ STORE } store={ STORE }
onClose={ sinon.stub() } /> onClose={ sinon.stub() }
/>
); );
} }

View File

@ -49,47 +49,57 @@ class EditMeta extends Component {
title={ title={
<FormattedMessage <FormattedMessage
id='editMeta.title' id='editMeta.title'
defaultMessage='edit metadata' /> defaultMessage='edit metadata'
/>
} }
visible> visible
>
<Form> <Form>
<Input <Input
error={ nameError } error={ nameError }
label={ label={
<FormattedMessage <FormattedMessage
id='editMeta.name.label' id='editMeta.name.label'
defaultMessage='name' /> defaultMessage='name'
/>
} }
onSubmit={ this.store.setName } onSubmit={ this.store.setName }
value={ name } /> value={ name }
/>
<Input <Input
hint={ hint={
<FormattedMessage <FormattedMessage
id='editMeta.description.hint' id='editMeta.description.hint'
defaultMessage='description for this address' /> defaultMessage='description for this address'
/>
} }
label={ label={
<FormattedMessage <FormattedMessage
id='editMeta.description.label' id='editMeta.description.label'
defaultMessage='address description' /> defaultMessage='address description'
/>
} }
value={ description } value={ description }
onSubmit={ this.store.setDescription } /> onSubmit={ this.store.setDescription }
/>
{ this.renderAccountFields() } { this.renderAccountFields() }
<InputChip <InputChip
addOnBlur addOnBlur
hint={ hint={
<FormattedMessage <FormattedMessage
id='editMeta.tags.hint' id='editMeta.tags.hint'
defaultMessage='press <Enter> to add a tag' /> defaultMessage='press <Enter> to add a tag'
/>
} }
label={ label={
<FormattedMessage <FormattedMessage
id='editMeta.tags.label' id='editMeta.tags.label'
defaultMessage='(optional) tags' /> defaultMessage='(optional) tags'
/>
} }
onTokensChange={ this.store.setTags } onTokensChange={ this.store.setTags }
tokens={ tags.slice() } /> tokens={ tags.slice() }
/>
</Form> </Form>
</Modal> </Modal>
); );
@ -102,12 +112,14 @@ class EditMeta extends Component {
<Button <Button
label='Cancel' label='Cancel'
icon={ <CancelIcon /> } icon={ <CancelIcon /> }
onClick={ this.props.onClose } />, onClick={ this.props.onClose }
/>,
<Button <Button
disabled={ hasError } disabled={ hasError }
label='Save' label='Save'
icon={ <SaveIcon /> } icon={ <SaveIcon /> }
onClick={ this.onSave } /> onClick={ this.onSave }
/>
]; ];
} }
@ -123,15 +135,18 @@ class EditMeta extends Component {
hint={ hint={
<FormattedMessage <FormattedMessage
id='editMeta.passwordHint.hint' id='editMeta.passwordHint.hint'
defaultMessage='a hint to allow password recovery' /> defaultMessage='a hint to allow password recovery'
/>
} }
label={ label={
<FormattedMessage <FormattedMessage
id='editMeta.passwordHint.label' id='editMeta.passwordHint.label'
defaultMessage='(optional) password hint' /> defaultMessage='(optional) password hint'
/>
} }
value={ passwordHint } value={ passwordHint }
onSubmit={ this.store.setPasswordHint } /> onSubmit={ this.store.setPasswordHint }
/>
); );
} }

View File

@ -37,7 +37,8 @@ function render (props) {
<EditMeta <EditMeta
{ ...props } { ...props }
account={ ACCOUNT } account={ ACCOUNT }
onClose={ onClose } />, onClose={ onClose }
/>,
{ context: { store: reduxStore } } { context: { store: reduxStore } }
).find('EditMeta').shallow({ context: { api } }); ).find('EditMeta').shallow({ context: { api } });
instance = component.instance(); instance = component.instance();

View File

@ -39,15 +39,18 @@ export default class AdvancedStep extends Component {
hint={ hint={
<FormattedMessage <FormattedMessage
id='executeContract.advanced.minBlock.hint' id='executeContract.advanced.minBlock.hint'
defaultMessage='Only post the transaction after this block' /> defaultMessage='Only post the transaction after this block'
/>
} }
label={ label={
<FormattedMessage <FormattedMessage
id='executeContract.advanced.minBlock.label' id='executeContract.advanced.minBlock.label'
defaultMessage='BlockNumber to send from' /> defaultMessage='BlockNumber to send from'
/>
} }
value={ minBlock } value={ minBlock }
onSubmit={ onMinBlockChange } /> onSubmit={ onMinBlockChange }
/>
<div className={ styles.gaseditor }> <div className={ styles.gaseditor }>
<GasPriceEditor store={ gasStore } /> <GasPriceEditor store={ gasStore } />
</div> </div>

View File

@ -62,15 +62,18 @@ export default class DetailsStep extends Component {
hint={ hint={
<FormattedMessage <FormattedMessage
id='executeContract.details.address.label' id='executeContract.details.address.label'
defaultMessage='the account to transact with' /> defaultMessage='the account to transact with'
/>
} }
label={ label={
<FormattedMessage <FormattedMessage
id='executeContract.details.address.hint' id='executeContract.details.address.hint'
defaultMessage='from account' /> defaultMessage='from account'
/>
} }
onChange={ onFromAddressChange } onChange={ onFromAddressChange }
value={ fromAddress } /> value={ fromAddress }
/>
{ this.renderFunctionSelect() } { this.renderFunctionSelect() }
{ this.renderParameters() } { this.renderParameters() }
<div className={ styles.columns }> <div className={ styles.columns }>
@ -80,15 +83,18 @@ export default class DetailsStep extends Component {
hint={ hint={
<FormattedMessage <FormattedMessage
id='executeContract.details.amount.hint' id='executeContract.details.amount.hint'
defaultMessage='the amount to send to with the transaction' /> defaultMessage='the amount to send to with the transaction'
/>
} }
label={ label={
<FormattedMessage <FormattedMessage
id='executeContract.details.amount.label' id='executeContract.details.amount.label'
defaultMessage='transaction value (in ETH)' /> defaultMessage='transaction value (in ETH)'
/>
} }
onSubmit={ onAmountChange } onSubmit={ onAmountChange }
value={ amount } /> value={ amount }
/>
</div> </div>
<div> <div>
<Checkbox <Checkbox
@ -96,10 +102,12 @@ export default class DetailsStep extends Component {
label={ label={
<FormattedMessage <FormattedMessage
id='executeContract.details.advancedCheck.label' id='executeContract.details.advancedCheck.label'
defaultMessage='advanced sending options' /> defaultMessage='advanced sending options'
/>
} }
onCheck={ onAdvancedClick } onCheck={ onAdvancedClick }
style={ CHECK_STYLE } /> style={ CHECK_STYLE }
/>
</div> </div>
</div> </div>
</Form> </Form>
@ -140,7 +148,8 @@ export default class DetailsStep extends Component {
<MenuItem <MenuItem
key={ func.signature } key={ func.signature }
value={ func.signature } value={ func.signature }
label={ func.name || '()' }> label={ func.name || '()' }
>
{ name } { name }
</MenuItem> </MenuItem>
); );
@ -152,15 +161,18 @@ export default class DetailsStep extends Component {
hint={ hint={
<FormattedMessage <FormattedMessage
id='executeContract.details.function.hint' id='executeContract.details.function.hint'
defaultMessage='the function to call on the contract' /> defaultMessage='the function to call on the contract'
/>
} }
label={ label={
<FormattedMessage <FormattedMessage
id='executeContract.details.function.label' id='executeContract.details.function.label'
defaultMessage='function to execute' /> defaultMessage='function to execute'
/>
} }
onChange={ this.onFuncChange } onChange={ this.onFuncChange }
value={ func.signature }> value={ func.signature }
>
{ functions } { functions }
</Select> </Select>
); );

View File

@ -47,7 +47,8 @@ function render (props) {
onFromAddressChange={ onFromAddressChange } onFromAddressChange={ onFromAddressChange }
onFuncChange={ onFuncChange } onFuncChange={ onFuncChange }
onGasEditClick={ onGasEditClick } onGasEditClick={ onGasEditClick }
onValueChange={ onValueChange } /> onValueChange={ onValueChange }
/>
); );
return component; return component;

View File

@ -41,27 +41,32 @@ const TITLES = {
transfer: ( transfer: (
<FormattedMessage <FormattedMessage
id='executeContract.steps.transfer' id='executeContract.steps.transfer'
defaultMessage='function details' /> defaultMessage='function details'
/>
), ),
sending: ( sending: (
<FormattedMessage <FormattedMessage
id='executeContract.steps.sending' id='executeContract.steps.sending'
defaultMessage='sending' /> defaultMessage='sending'
/>
), ),
complete: ( complete: (
<FormattedMessage <FormattedMessage
id='executeContract.steps.complete' id='executeContract.steps.complete'
defaultMessage='complete' /> defaultMessage='complete'
/>
), ),
advanced: ( advanced: (
<FormattedMessage <FormattedMessage
id='executeContract.steps.advanced' id='executeContract.steps.advanced'
defaultMessage='advanced options' /> defaultMessage='advanced options'
/>
), ),
rejected: ( rejected: (
<FormattedMessage <FormattedMessage
id='executeContract.steps.rejected' id='executeContract.steps.rejected'
defaultMessage='rejected' /> defaultMessage='rejected'
/>
) )
}; };
const STAGES_BASIC = [TITLES.transfer, TITLES.sending, TITLES.complete]; const STAGES_BASIC = [TITLES.transfer, TITLES.sending, TITLES.complete];
@ -139,7 +144,8 @@ class ExecuteContract extends Component {
advancedOptions advancedOptions
? [STEP_BUSY] ? [STEP_BUSY]
: [STEP_BUSY_OR_ADVANCED] : [STEP_BUSY_OR_ADVANCED]
}> }
>
{ this.renderExceptionWarning() } { this.renderExceptionWarning() }
{ this.renderStep() } { this.renderStep() }
</Modal> </Modal>
@ -170,10 +176,12 @@ class ExecuteContract extends Component {
label={ label={
<FormattedMessage <FormattedMessage
id='executeContract.button.cancel' id='executeContract.button.cancel'
defaultMessage='cancel' /> defaultMessage='cancel'
/>
} }
icon={ <CancelIcon /> } icon={ <CancelIcon /> }
onClick={ onClose } /> onClick={ onClose }
/>
); );
const postBtn = ( const postBtn = (
<Button <Button
@ -181,11 +189,13 @@ class ExecuteContract extends Component {
label={ label={
<FormattedMessage <FormattedMessage
id='executeContract.button.post' id='executeContract.button.post'
defaultMessage='post transaction' /> defaultMessage='post transaction'
/>
} }
disabled={ !!(sending || hasError) } disabled={ !!(sending || hasError) }
icon={ <IdentityIcon address={ fromAddress } button /> } icon={ <IdentityIcon address={ fromAddress } button /> }
onClick={ this.postTransaction } /> onClick={ this.postTransaction }
/>
); );
const nextBtn = ( const nextBtn = (
<Button <Button
@ -193,10 +203,12 @@ class ExecuteContract extends Component {
label={ label={
<FormattedMessage <FormattedMessage
id='executeContract.button.next' id='executeContract.button.next'
defaultMessage='next' /> defaultMessage='next'
/>
} }
icon={ <NextIcon /> } icon={ <NextIcon /> }
onClick={ this.onNextClick } /> onClick={ this.onNextClick }
/>
); );
const prevBtn = ( const prevBtn = (
<Button <Button
@ -204,10 +216,12 @@ class ExecuteContract extends Component {
label={ label={
<FormattedMessage <FormattedMessage
id='executeContract.button.prev' id='executeContract.button.prev'
defaultMessage='prev' /> defaultMessage='prev'
/>
} }
icon={ <PrevIcon /> } icon={ <PrevIcon /> }
onClick={ this.onPrevClick } /> onClick={ this.onPrevClick }
/>
); );
if (step === STEP_DETAILS) { if (step === STEP_DETAILS) {
@ -233,10 +247,12 @@ class ExecuteContract extends Component {
label={ label={
<FormattedMessage <FormattedMessage
id='executeContract.button.done' id='executeContract.button.done'
defaultMessage='done' /> defaultMessage='done'
/>
} }
icon={ <DoneIcon /> } icon={ <DoneIcon /> }
onClick={ onClose } /> onClick={ onClose }
/>
]; ];
} }
@ -250,13 +266,16 @@ class ExecuteContract extends Component {
title={ title={
<FormattedMessage <FormattedMessage
id='executeContract.rejected.title' id='executeContract.rejected.title'
defaultMessage='The execution has been rejected' /> defaultMessage='The execution has been rejected'
/>
} }
state={ state={
<FormattedMessage <FormattedMessage
id='executeContract.rejected.state' id='executeContract.rejected.state'
defaultMessage='You can safely close this window, the function execution will not occur.' /> defaultMessage='You can safely close this window, the function execution will not occur.'
} /> />
}
/>
); );
} }
@ -269,7 +288,8 @@ class ExecuteContract extends Component {
onFromAddressChange={ onFromAddressChange } onFromAddressChange={ onFromAddressChange }
onFuncChange={ this.onFuncChange } onFuncChange={ this.onFuncChange }
onAdvancedClick={ this.onAdvancedClick } onAdvancedClick={ this.onAdvancedClick }
onValueChange={ this.onValueChange } /> onValueChange={ this.onValueChange }
/>
); );
} else if (step === (advancedOptions ? STEP_BUSY : STEP_BUSY_OR_ADVANCED)) { } else if (step === (advancedOptions ? STEP_BUSY : STEP_BUSY_OR_ADVANCED)) {
return ( return (
@ -277,9 +297,11 @@ class ExecuteContract extends Component {
title={ title={
<FormattedMessage <FormattedMessage
id='executeContract.busy.title' id='executeContract.busy.title'
defaultMessage='The function execution is in progress' /> defaultMessage='The function execution is in progress'
/>
} }
state={ busyState } /> state={ busyState }
/>
); );
} else if (advancedOptions && (step === STEP_BUSY_OR_ADVANCED)) { } else if (advancedOptions && (step === STEP_BUSY_OR_ADVANCED)) {
return ( return (
@ -287,7 +309,8 @@ class ExecuteContract extends Component {
gasStore={ this.gasStore } gasStore={ this.gasStore }
minBlock={ minBlock } minBlock={ minBlock }
minBlockError={ minBlockError } minBlockError={ minBlockError }
onMinBlockChange={ this.onMinBlockChange } /> onMinBlockChange={ this.onMinBlockChange }
/>
); );
} }
@ -406,7 +429,8 @@ class ExecuteContract extends Component {
busyState: ( busyState: (
<FormattedMessage <FormattedMessage
id='executeContract.busy.waitAuth' id='executeContract.busy.waitAuth'
defaultMessage='Waiting for authorization in the Parity Signer' /> defaultMessage='Waiting for authorization in the Parity Signer'
/>
) )
}); });
@ -429,7 +453,8 @@ class ExecuteContract extends Component {
busyState: ( busyState: (
<FormattedMessage <FormattedMessage
id='executeContract.busy.posted' id='executeContract.busy.posted'
defaultMessage='Your transaction has been posted to the network' /> defaultMessage='Your transaction has been posted to the network'
/>
) )
}); });
}) })

View File

@ -35,7 +35,8 @@ function render (props) {
{ ...props } { ...props }
contract={ CONTRACT } contract={ CONTRACT }
onClose={ onClose } onClose={ onClose }
onFromAddressChange={ onFromAddressChange } />, onFromAddressChange={ onFromAddressChange }
/>,
{ context: { api: createApi(), store: STORE } } { context: { api: createApi(), store: STORE } }
).find('ExecuteContract').shallow(); ).find('ExecuteContract').shallow();

View File

@ -167,7 +167,8 @@ export default class TnC extends Component {
className={ styles.accept } className={ styles.accept }
label='I accept these terms and conditions' label='I accept these terms and conditions'
checked={ hasAccepted } checked={ hasAccepted }
onCheck={ onAccept } /> onCheck={ onAccept }
/>
</div> </div>
); );
} }

View File

@ -32,7 +32,8 @@ export default class FirstRun extends Component {
<img <img
src={ imagesEthcore } src={ imagesEthcore }
alt='Ethcore Ltd.' alt='Ethcore Ltd.'
style={ LOGO_STYLE } /> style={ LOGO_STYLE }
/>
<p>Welcome to <strong>Parity</strong>, the fastest and simplest way to run your node.</p> <p>Welcome to <strong>Parity</strong>, the fastest and simplest way to run your node.</p>
<p>The next few steps will guide you through the process of setting up you Parity instance and the associated account.</p> <p>The next few steps will guide you through the process of setting up you Parity instance and the associated account.</p>
<p>Click <strong>Next</strong> to continue your journey.</p> <p>Click <strong>Next</strong> to continue your journey.</p>

View File

@ -71,7 +71,8 @@ class FirstRun extends Component {
actions={ this.renderDialogActions() } actions={ this.renderDialogActions() }
current={ stage } current={ stage }
steps={ STAGE_NAMES } steps={ STAGE_NAMES }
visible> visible
>
{ this.renderStage() } { this.renderStage() }
</Modal> </Modal>
); );
@ -89,19 +90,22 @@ class FirstRun extends Component {
return ( return (
<TnC <TnC
hasAccepted={ hasAcceptedTnc } hasAccepted={ hasAcceptedTnc }
onAccept={ this.onAcceptTnC } /> onAccept={ this.onAcceptTnC }
/>
); );
case 2: case 2:
return ( return (
<NewAccount <NewAccount
onChange={ this.onChangeDetails } /> onChange={ this.onChangeDetails }
/>
); );
case 3: case 3:
return ( return (
<AccountDetails <AccountDetails
address={ address } address={ address }
name={ name } name={ name }
phrase={ phrase } /> phrase={ phrase }
/>
); );
case 4: case 4:
return ( return (
@ -120,7 +124,8 @@ class FirstRun extends Component {
<Button <Button
icon={ <NavigationArrowForward /> } icon={ <NavigationArrowForward /> }
label='Next' label='Next'
onClick={ this.onNext } /> onClick={ this.onNext }
/>
); );
case 1: case 1:
@ -129,7 +134,8 @@ class FirstRun extends Component {
disabled={ !hasAcceptedTnc } disabled={ !hasAcceptedTnc }
icon={ <NavigationArrowForward /> } icon={ <NavigationArrowForward /> }
label='Next' label='Next'
onClick={ this.onNext } /> onClick={ this.onNext }
/>
); );
case 2: case 2:
@ -173,7 +179,8 @@ class FirstRun extends Component {
<Button <Button
icon={ <ActionDoneAll /> } icon={ <ActionDoneAll /> }
label='Close' label='Close'
onClick={ this.onClose } /> onClick={ this.onClose }
/>
); );
} }
} }

View File

@ -35,7 +35,6 @@ const SELECTED_STYLE = {
}; };
export default class LoadContract extends Component { export default class LoadContract extends Component {
static propTypes = { static propTypes = {
onClose: PropTypes.func.isRequired, onClose: PropTypes.func.isRequired,
onLoad: PropTypes.func.isRequired, onLoad: PropTypes.func.isRequired,
@ -279,5 +278,4 @@ export default class LoadContract extends Component {
deleteId: -1 deleteId: -1
}); });
} }
} }

View File

@ -65,9 +65,11 @@ class PasswordManager extends Component {
title={ title={
<FormattedMessage <FormattedMessage
id='passwordChange.title' id='passwordChange.title'
defaultMessage='Password Manager' /> defaultMessage='Password Manager'
/>
} }
visible> visible
>
{ this.renderAccount() } { this.renderAccount() }
{ this.renderPage() } { this.renderPage() }
{ this.renderMessage() } { this.renderMessage() }
@ -90,7 +92,8 @@ class PasswordManager extends Component {
? MSG_SUCCESS_STYLE ? MSG_SUCCESS_STYLE
: MSG_FAILURE_STYLE : MSG_FAILURE_STYLE
} }
zDepth={ 1 }> zDepth={ 1 }
>
{ infoMessage.value } { infoMessage.value }
</Paper> </Paper>
); );
@ -106,7 +109,8 @@ class PasswordManager extends Component {
<IdentityName <IdentityName
address={ address } address={ address }
className={ styles.accountName } className={ styles.accountName }
unknown /> unknown
/>
<span className={ styles.accountAddress }> <span className={ styles.accountAddress }>
{ address } { address }
</span> </span>
@ -125,14 +129,17 @@ class PasswordManager extends Component {
return ( return (
<Tabs <Tabs
inkBarStyle={ TABS_INKBAR_STYLE } inkBarStyle={ TABS_INKBAR_STYLE }
tabItemContainerStyle={ TABS_ITEM_STYLE }> tabItemContainerStyle={ TABS_ITEM_STYLE }
>
<Tab <Tab
label={ label={
<FormattedMessage <FormattedMessage
id='passwordChange.tabTest.label' id='passwordChange.tabTest.label'
defaultMessage='Test Password' /> defaultMessage='Test Password'
/>
} }
onActive={ this.onActivateTestTab }> onActive={ this.onActivateTestTab }
>
<Form className={ styles.form }> <Form className={ styles.form }>
<div> <div>
<Input <Input
@ -140,17 +147,20 @@ class PasswordManager extends Component {
hint={ hint={
<FormattedMessage <FormattedMessage
id='passwordChange.testPassword.hint' id='passwordChange.testPassword.hint'
defaultMessage='your account password' /> defaultMessage='your account password'
/>
} }
label={ label={
<FormattedMessage <FormattedMessage
id='passwordChange.testPassword.label' id='passwordChange.testPassword.label'
defaultMessage='password' /> defaultMessage='password'
/>
} }
onChange={ this.onEditTestPassword } onChange={ this.onEditTestPassword }
onSubmit={ this.testPassword } onSubmit={ this.testPassword }
submitOnBlur={ false } submitOnBlur={ false }
type='password' /> type='password'
/>
</div> </div>
</Form> </Form>
</Tab> </Tab>
@ -158,9 +168,11 @@ class PasswordManager extends Component {
label={ label={
<FormattedMessage <FormattedMessage
id='passwordChange.tabChange.label' id='passwordChange.tabChange.label'
defaultMessage='Change Password' /> defaultMessage='Change Password'
/>
} }
onActive={ this.onActivateChangeTab }> onActive={ this.onActivateChangeTab }
>
<Form className={ styles.form }> <Form className={ styles.form }>
<div> <div>
<Input <Input
@ -168,29 +180,35 @@ class PasswordManager extends Component {
hint={ hint={
<FormattedMessage <FormattedMessage
id='passwordChange.currentPassword.hint' id='passwordChange.currentPassword.hint'
defaultMessage='your current password for this account' /> defaultMessage='your current password for this account'
/>
} }
label={ label={
<FormattedMessage <FormattedMessage
id='passwordChange.currentPassword.label' id='passwordChange.currentPassword.label'
defaultMessage='current password' /> defaultMessage='current password'
/>
} }
onChange={ this.onEditCurrentPassword } onChange={ this.onEditCurrentPassword }
type='password' /> type='password'
/>
<Input <Input
disabled={ busy } disabled={ busy }
hint={ hint={
<FormattedMessage <FormattedMessage
id='passwordChange.passwordHint.hint' id='passwordChange.passwordHint.hint'
defaultMessage='hint for the new password' /> defaultMessage='hint for the new password'
/>
} }
label={ label={
<FormattedMessage <FormattedMessage
id='passwordChange.passwordHint.label' id='passwordChange.passwordHint.label'
defaultMessage='(optional) new password hint' /> defaultMessage='(optional) new password hint'
/>
} }
onChange={ this.onEditNewPasswordHint } onChange={ this.onEditNewPasswordHint }
value={ passwordHint } /> value={ passwordHint }
/>
<div className={ styles.passwords }> <div className={ styles.passwords }>
<div className={ styles.password }> <div className={ styles.password }>
<Input <Input
@ -198,17 +216,20 @@ class PasswordManager extends Component {
hint={ hint={
<FormattedMessage <FormattedMessage
id='passwordChange.newPassword.hint' id='passwordChange.newPassword.hint'
defaultMessage='the new password for this account' /> defaultMessage='the new password for this account'
/>
} }
label={ label={
<FormattedMessage <FormattedMessage
id='passwordChange.newPassword.label' id='passwordChange.newPassword.label'
defaultMessage='new password' /> defaultMessage='new password'
/>
} }
onChange={ this.onEditNewPassword } onChange={ this.onEditNewPassword }
onSubmit={ this.changePassword } onSubmit={ this.changePassword }
submitOnBlur={ false } submitOnBlur={ false }
type='password' /> type='password'
/>
</div> </div>
<div className={ styles.password }> <div className={ styles.password }>
<Input <Input
@ -218,22 +239,26 @@ class PasswordManager extends Component {
? null ? null
: <FormattedMessage : <FormattedMessage
id='passwordChange.repeatPassword.error' id='passwordChange.repeatPassword.error'
defaultMessage='the supplied passwords do not match' /> defaultMessage='the supplied passwords do not match'
/>
} }
hint={ hint={
<FormattedMessage <FormattedMessage
id='passwordChange.repeatPassword.hint' id='passwordChange.repeatPassword.hint'
defaultMessage='repeat the new password for this account' /> defaultMessage='repeat the new password for this account'
/>
} }
label={ label={
<FormattedMessage <FormattedMessage
id='passwordChange.repeatPassword.label' id='passwordChange.repeatPassword.label'
defaultMessage='repeat new password' /> defaultMessage='repeat new password'
/>
} }
onChange={ this.onEditNewPasswordRepeat } onChange={ this.onEditNewPasswordRepeat }
onSubmit={ this.changePassword } onSubmit={ this.changePassword }
submitOnBlur={ false } submitOnBlur={ false }
type='password' /> type='password'
/>
</div> </div>
</div> </div>
@ -256,9 +281,11 @@ class PasswordManager extends Component {
label={ label={
<FormattedMessage <FormattedMessage
id='passwordChange.button.cancel' id='passwordChange.button.cancel'
defaultMessage='Cancel' /> defaultMessage='Cancel'
/>
} }
onClick={ onClose } /> onClick={ onClose }
/>
); );
if (busy) { if (busy) {
@ -270,8 +297,10 @@ class PasswordManager extends Component {
label={ label={
<FormattedMessage <FormattedMessage
id='passwordChange.button.wait' id='passwordChange.button.wait'
defaultMessage='Wait...' /> defaultMessage='Wait...'
} /> />
}
/>
]; ];
} }
@ -284,9 +313,11 @@ class PasswordManager extends Component {
label={ label={
<FormattedMessage <FormattedMessage
id='passwordChange.button.test' id='passwordChange.button.test'
defaultMessage='Test' /> defaultMessage='Test'
/>
} }
onClick={ this.testPassword } /> onClick={ this.testPassword }
/>
]; ];
} }
@ -299,9 +330,11 @@ class PasswordManager extends Component {
label={ label={
<FormattedMessage <FormattedMessage
id='passwordChange.button.change' id='passwordChange.button.change'
defaultMessage='Change' /> defaultMessage='Change'
/>
} }
onClick={ this.changePassword } /> onClick={ this.changePassword }
/>
]; ];
} }
@ -342,7 +375,8 @@ class PasswordManager extends Component {
<div> <div>
<FormattedMessage <FormattedMessage
id='passwordChange.success' id='passwordChange.success'
defaultMessage='Your password has been successfully changed' /> defaultMessage='Your password has been successfully changed'
/>
</div> </div>
); );
this.props.onClose(); this.props.onClose();

View File

@ -35,7 +35,8 @@ function render (props) {
<PasswordManager <PasswordManager
{ ...props } { ...props }
account={ ACCOUNT } account={ ACCOUNT }
onClose={ onClose } />, onClose={ onClose }
/>,
{ context: { store: reduxStore } } { context: { store: reduxStore } }
).find('PasswordManager').shallow({ context: { api: createApi() } }); ).find('PasswordManager').shallow({ context: { api: createApi() } });
instance = component.instance(); instance = component.instance();

View File

@ -25,7 +25,6 @@ import { ERRORS, validateName } from '~/util/validation';
import styles from './saveContract.css'; import styles from './saveContract.css';
export default class SaveContract extends Component { export default class SaveContract extends Component {
static propTypes = { static propTypes = {
sourcecode: PropTypes.string.isRequired, sourcecode: PropTypes.string.isRequired,
onClose: PropTypes.func.isRequired, onClose: PropTypes.func.isRequired,
@ -105,5 +104,4 @@ export default class SaveContract extends Component {
const { name, nameError } = validateName(value); const { name, nameError } = validateName(value);
this.setState({ name, nameError }); this.setState({ name, nameError });
} }
} }

View File

@ -42,7 +42,8 @@ export default class AwaitingDepositStep extends Component {
<FormattedMessage <FormattedMessage
id='shapeshift.awaitingDepositStep.awaitingConfirmation' id='shapeshift.awaitingDepositStep.awaitingConfirmation'
defaultMessage='Awaiting confirmation of the deposit address for your {typeSymbol} funds exchange' defaultMessage='Awaiting confirmation of the deposit address for your {typeSymbol} funds exchange'
values={ { typeSymbol } } /> values={ { typeSymbol } }
/>
</div> </div>
</div> </div>
); );
@ -57,7 +58,8 @@ export default class AwaitingDepositStep extends Component {
values={ { values={ {
shapeshiftLink: <a href='https://shapeshift.io' target='_blank'>ShapeShift.io</a>, shapeshiftLink: <a href='https://shapeshift.io' target='_blank'>ShapeShift.io</a>,
typeSymbol typeSymbol
} } /> } }
/>
</div> </div>
<div className={ styles.hero }> <div className={ styles.hero }>
{ depositAddress } { depositAddress }
@ -70,7 +72,8 @@ export default class AwaitingDepositStep extends Component {
values={ { values={ {
maximum: <Value amount={ price.limit } symbol={ coinSymbol } />, maximum: <Value amount={ price.limit } symbol={ coinSymbol } />,
minimum: <Value amount={ price.minimum } symbol={ coinSymbol } /> minimum: <Value amount={ price.minimum } symbol={ coinSymbol } />
} } /> } }
/>
</div> </div>
</div> </div>
</div> </div>

View File

@ -27,7 +27,8 @@ function render () {
store={ { store={ {
coinSymbol: 'BTC', coinSymbol: 'BTC',
price: { rate: 0.001, minimum: 0, limit: 1.999 } price: { rate: 0.001, minimum: 0, limit: 1.999 }
} } /> } }
/>
); );
return component; return component;

View File

@ -39,7 +39,8 @@ export default class AwaitingExchangeStep extends Component {
defaultMessage='{shapeshiftLink} has received a deposit of -' defaultMessage='{shapeshiftLink} has received a deposit of -'
values={ { values={ {
shapeshiftLink: <a href='https://shapeshift.io' target='_blank'>ShapeShift.io</a> shapeshiftLink: <a href='https://shapeshift.io' target='_blank'>ShapeShift.io</a>
} } /> } }
/>
</div> </div>
<div className={ styles.hero }> <div className={ styles.hero }>
<Value amount={ incomingCoin } symbol={ incomingType } /> <Value amount={ incomingCoin } symbol={ incomingType } />
@ -47,7 +48,8 @@ export default class AwaitingExchangeStep extends Component {
<div className={ styles.info }> <div className={ styles.info }>
<FormattedMessage <FormattedMessage
id='shapeshift.awaitingExchangeStep.awaitingCompletion' id='shapeshift.awaitingExchangeStep.awaitingCompletion'
defaultMessage='Awaiting the completion of the funds exchange and transfer of funds to your Parity account.' /> defaultMessage='Awaiting the completion of the funds exchange and transfer of funds to your Parity account.'
/>
</div> </div>
</div> </div>
); );

View File

@ -26,7 +26,8 @@ function render () {
<AwaitingExchangeStep <AwaitingExchangeStep
store={ { store={ {
depositInfo: { incomingCoin: 0.01, incomingType: 'BTC' } depositInfo: { incomingCoin: 0.01, incomingType: 'BTC' }
} } /> } }
/>
); );
return component; return component;

View File

@ -40,7 +40,8 @@ export default class CompletedStep extends Component {
defaultMessage='{shapeshiftLink} has completed the funds exchange.' defaultMessage='{shapeshiftLink} has completed the funds exchange.'
values={ { values={ {
shapeshiftLink: <a href='https://shapeshift.io' target='_blank'>ShapeShift.io</a> shapeshiftLink: <a href='https://shapeshift.io' target='_blank'>ShapeShift.io</a>
} } /> } }
/>
</div> </div>
<div className={ styles.hero }> <div className={ styles.hero }>
<Value amount={ incomingCoin } symbol={ incomingType } /> => <Value amount={ outgoingCoin } symbol={ outgoingType } /> <Value amount={ incomingCoin } symbol={ incomingType } /> => <Value amount={ outgoingCoin } symbol={ outgoingType } />
@ -48,7 +49,8 @@ export default class CompletedStep extends Component {
<div className={ styles.info }> <div className={ styles.info }>
<FormattedMessage <FormattedMessage
id='shapeshift.completedStep.parityFunds' id='shapeshift.completedStep.parityFunds'
defaultMessage='The change in funds will be reflected in your Parity account shortly.' /> defaultMessage='The change in funds will be reflected in your Parity account shortly.'
/>
</div> </div>
</div> </div>
); );

View File

@ -27,7 +27,8 @@ function render () {
store={ { store={ {
depositInfo: { incomingCoin: 0.01, incomingType: 'BTC' }, depositInfo: { incomingCoin: 0.01, incomingType: 'BTC' },
exchangeInfo: { outgoingCoin: 0.1, outgoingType: 'ETH' } exchangeInfo: { outgoingCoin: 0.1, outgoingType: 'ETH' }
} } /> } }
/>
); );
return component; return component;

View File

@ -37,7 +37,8 @@ export default class ErrorStep extends Component {
defaultMessage='The funds shifting via {shapeshiftLink} failed with a fatal error on the exchange. The error message received from the exchange is as follow:' defaultMessage='The funds shifting via {shapeshiftLink} failed with a fatal error on the exchange. The error message received from the exchange is as follow:'
values={ { values={ {
shapeshiftLink: <a href='https://shapeshift.io' target='_blank'>ShapeShift.io</a> shapeshiftLink: <a href='https://shapeshift.io' target='_blank'>ShapeShift.io</a>
} } /> } }
/>
</div> </div>
<div className={ styles.error }> <div className={ styles.error }>
{ error.message } { error.message }

View File

@ -26,7 +26,8 @@ function render () {
<ErrorStep <ErrorStep
store={ { store={ {
error: new Error('testing') error: new Error('testing')
} } /> } }
/>
); );
return component; return component;

View File

@ -29,7 +29,8 @@ const WARNING_LABELS = {
[WARNING_NO_PRICE]: ( [WARNING_NO_PRICE]: (
<FormattedMessage <FormattedMessage
id='shapeshift.warning.noPrice' id='shapeshift.warning.noPrice'
defaultMessage='No price match was found for the selected type' /> defaultMessage='No price match was found for the selected type'
/>
) )
}; };
@ -47,7 +48,8 @@ export default class OptionsStep extends Component {
<div className={ styles.empty }> <div className={ styles.empty }>
<FormattedMessage <FormattedMessage
id='shapeshift.optionsStep.noPairs' id='shapeshift.optionsStep.noPairs'
defaultMessage='There are currently no exchange pairs/coins available to fund with.' /> defaultMessage='There are currently no exchange pairs/coins available to fund with.'
/>
</div> </div>
); );
} }
@ -60,15 +62,18 @@ export default class OptionsStep extends Component {
hint={ hint={
<FormattedMessage <FormattedMessage
id='shapeshift.optionsStep.typeSelect.hint' id='shapeshift.optionsStep.typeSelect.hint'
defaultMessage='the type of crypto conversion to do' /> defaultMessage='the type of crypto conversion to do'
/>
} }
label={ label={
<FormattedMessage <FormattedMessage
id='shapeshift.optionsStep.typeSelect.label' id='shapeshift.optionsStep.typeSelect.label'
defaultMessage='fund account from' /> defaultMessage='fund account from'
/>
} }
onChange={ this.onSelectCoin } onChange={ this.onSelectCoin }
value={ coinSymbol }> value={ coinSymbol }
>
{ {
coins.map(this.renderCoinSelectItem) coins.map(this.renderCoinSelectItem)
} }
@ -77,30 +82,36 @@ export default class OptionsStep extends Component {
hint={ hint={
<FormattedMessage <FormattedMessage
id='shapeshift.optionsStep.returnAddr.hint' id='shapeshift.optionsStep.returnAddr.hint'
defaultMessage='the return address for send failures' /> defaultMessage='the return address for send failures'
/>
} }
label={ label={
<FormattedMessage <FormattedMessage
id='shapeshift.optionsStep.returnAddr.label' id='shapeshift.optionsStep.returnAddr.label'
defaultMessage='(optional) {coinSymbol} return address' defaultMessage='(optional) {coinSymbol} return address'
values={ { coinSymbol } } /> values={ { coinSymbol } }
/>
} }
onSubmit={ this.onChangeRefundAddress } onSubmit={ this.onChangeRefundAddress }
value={ refundAddress } /> value={ refundAddress }
/>
<Checkbox <Checkbox
checked={ hasAcceptedTerms } checked={ hasAcceptedTerms }
className={ styles.accept } className={ styles.accept }
label={ label={
<FormattedMessage <FormattedMessage
id='shapeshift.optionsStep.terms.label' id='shapeshift.optionsStep.terms.label'
defaultMessage='I understand that ShapeShift.io is a 3rd-party service and by using the service any transfer of information and/or funds is completely out of the control of Parity' /> defaultMessage='I understand that ShapeShift.io is a 3rd-party service and by using the service any transfer of information and/or funds is completely out of the control of Parity'
/>
} }
onCheck={ this.onToggleAcceptTerms } /> onCheck={ this.onToggleAcceptTerms }
/>
</Form> </Form>
<Warning warning={ WARNING_LABELS[warning] } /> <Warning warning={ WARNING_LABELS[warning] } />
<Price <Price
coinSymbol={ coinSymbol } coinSymbol={ coinSymbol }
price={ price } /> price={ price }
/>
</div> </div>
); );
} }
@ -112,7 +123,8 @@ export default class OptionsStep extends Component {
<div className={ styles.coinselect }> <div className={ styles.coinselect }>
<img <img
className={ styles.coinimage } className={ styles.coinimage }
src={ image } /> src={ image }
/>
<div className={ styles.coindetails }> <div className={ styles.coindetails }>
<div className={ styles.coinsymbol }> <div className={ styles.coinsymbol }>
{ symbol } { symbol }
@ -128,7 +140,8 @@ export default class OptionsStep extends Component {
<MenuItem <MenuItem
key={ symbol } key={ symbol }
value={ symbol } value={ symbol }
label={ item }> label={ item }
>
{ item } { item }
</MenuItem> </MenuItem>
); );

View File

@ -49,7 +49,8 @@ export default class Price extends Component {
values={ { values={ {
maximum: <Value amount={ price.limit } symbol={ coinSymbol } />, maximum: <Value amount={ price.limit } symbol={ coinSymbol } />,
minimum: <Value amount={ price.minimum } symbol={ coinSymbol } /> minimum: <Value amount={ price.minimum } symbol={ coinSymbol } />
} } /> } }
/>
</div> </div>
</div> </div>
); );

View File

@ -27,7 +27,8 @@ function render (props = {}) {
coinSymbol='BTC' coinSymbol='BTC'
price={ { rate: 0.1, minimum: 0.1, limit: 0.9 } } price={ { rate: 0.1, minimum: 0.1, limit: 0.9 } }
error={ new Error('testing') } error={ new Error('testing') }
{ ...props } /> { ...props }
/>
); );
return component; return component;

View File

@ -34,21 +34,26 @@ import styles from './shapeshift.css';
const STAGE_TITLES = [ const STAGE_TITLES = [
<FormattedMessage <FormattedMessage
id='shapeshift.title.details' id='shapeshift.title.details'
defaultMessage='details' />, defaultMessage='details'
/>,
<FormattedMessage <FormattedMessage
id='shapeshift.title.deposit' id='shapeshift.title.deposit'
defaultMessage='awaiting deposit' />, defaultMessage='awaiting deposit'
/>,
<FormattedMessage <FormattedMessage
id='shapeshift.title.exchange' id='shapeshift.title.exchange'
defaultMessage='awaiting exchange' />, defaultMessage='awaiting exchange'
/>,
<FormattedMessage <FormattedMessage
id='shapeshift.title.completed' id='shapeshift.title.completed'
defaultMessage='completed' /> defaultMessage='completed'
/>
]; ];
const ERROR_TITLE = ( const ERROR_TITLE = (
<FormattedMessage <FormattedMessage
id='shapeshift.title.error' id='shapeshift.title.error'
defaultMessage='exchange failed' /> defaultMessage='exchange failed'
/>
); );
@observer @observer
@ -93,7 +98,8 @@ export default class Shapeshift extends Component {
waiting={ [ waiting={ [
STAGE_WAIT_DEPOSIT, STAGE_WAIT_DEPOSIT,
STAGE_WAIT_EXCHANGE STAGE_WAIT_EXCHANGE
] }> ] }
>
{ this.renderPage() } { this.renderPage() }
</Modal> </Modal>
); );
@ -114,9 +120,11 @@ export default class Shapeshift extends Component {
label={ label={
<FormattedMessage <FormattedMessage
id='shapeshift.button.cancel' id='shapeshift.button.cancel'
defaultMessage='Cancel' /> defaultMessage='Cancel'
/>
} }
onClick={ this.onClose } /> onClick={ this.onClose }
/>
); );
if (error) { if (error) {
@ -136,14 +144,17 @@ export default class Shapeshift extends Component {
icon={ icon={
<IdentityIcon <IdentityIcon
address={ address } address={ address }
button /> button
/>
} }
label={ label={
<FormattedMessage <FormattedMessage
id='shapeshift.button.shift' id='shapeshift.button.shift'
defaultMessage='Shift Funds' /> defaultMessage='Shift Funds'
/>
} }
onClick={ this.onShift } /> onClick={ this.onShift }
/>
]; ];
case STAGE_WAIT_DEPOSIT: case STAGE_WAIT_DEPOSIT:
@ -161,9 +172,11 @@ export default class Shapeshift extends Component {
label={ label={
<FormattedMessage <FormattedMessage
id='shapeshift.button.done' id='shapeshift.button.done'
defaultMessage='Close' /> defaultMessage='Close'
/>
} }
onClick={ this.onClose } /> onClick={ this.onClose }
/>
]; ];
} }
} }

View File

@ -33,7 +33,8 @@ function render (props = {}) {
<Shapeshift <Shapeshift
address={ ADDRESS } address={ ADDRESS }
onClose={ onClose } onClose={ onClose }
{ ...props } />, { ...props }
/>,
{ context: { store: {} } } { context: { store: {} } }
); );
instance = component.instance(); instance = component.instance();

View File

@ -98,7 +98,8 @@ class TokenSelect extends Component {
<MenuItem <MenuItem
key={ token.tag } key={ token.tag }
value={ token.tag } value={ token.tag }
label={ label }> label={ label }
>
{ label } { label }
</MenuItem> </MenuItem>
); );
@ -169,14 +170,16 @@ export default class Details extends Component {
hint='the amount to transfer to the recipient' hint='the amount to transfer to the recipient'
value={ value } value={ value }
error={ valueError } error={ valueError }
onChange={ this.onEditValue } /> onChange={ this.onEditValue }
/>
</div> </div>
<div> <div>
<Checkbox <Checkbox
checked={ all } checked={ all }
label='full account balance' label='full account balance'
onCheck={ this.onCheckAll } onCheck={ this.onCheckAll }
style={ CHECK_STYLE } /> style={ CHECK_STYLE }
/>
</div> </div>
</div> </div>
<div className={ styles.columns }> <div className={ styles.columns }>
@ -184,7 +187,8 @@ export default class Details extends Component {
<Input <Input
disabled disabled
label='total transaction amount' label='total transaction amount'
error={ totalError }> error={ totalError }
>
<div className={ styles.inputoverride }> <div className={ styles.inputoverride }>
{ total }<small> ETH</small> { total }<small> ETH</small>
</div> </div>
@ -196,7 +200,8 @@ export default class Details extends Component {
checked={ extras } checked={ extras }
label='advanced sending options' label='advanced sending options'
onCheck={ this.onCheckExtras } onCheck={ this.onCheckExtras }
style={ CHECK_STYLE } /> style={ CHECK_STYLE }
/>
</div> </div>
</div> </div>
</Form> </Form>
@ -235,7 +240,8 @@ export default class Details extends Component {
hint='the recipient address' hint='the recipient address'
error={ recipientError } error={ recipientError }
value={ recipient } value={ recipient }
onChange={ this.onEditRecipient } /> onChange={ this.onEditRecipient }
/>
</div> </div>
); );
} }

View File

@ -45,19 +45,23 @@ export default class Extras extends Component {
hint={ hint={
<FormattedMessage <FormattedMessage
id='transferModal.minBlock.hint' id='transferModal.minBlock.hint'
defaultMessage='Only post the transaction after this block' /> defaultMessage='Only post the transaction after this block'
/>
} }
label={ label={
<FormattedMessage <FormattedMessage
id='transferModal.minBlock.label' id='transferModal.minBlock.label'
defaultMessage='BlockNumber to send from' /> defaultMessage='BlockNumber to send from'
/>
} }
value={ minBlock } value={ minBlock }
onChange={ this.onEditMinBlock } /> onChange={ this.onEditMinBlock }
/>
<div className={ styles.gaseditor }> <div className={ styles.gaseditor }>
<GasPriceEditor <GasPriceEditor
store={ gasStore } store={ gasStore }
onChange={ onChange } /> onChange={ onChange }
/>
</div> </div>
</Form> </Form>
); );
@ -76,15 +80,18 @@ export default class Extras extends Component {
hint={ hint={
<FormattedMessage <FormattedMessage
id='transfer.advanced.data.hint' id='transfer.advanced.data.hint'
defaultMessage='the data to pass through with the transaction' /> defaultMessage='the data to pass through with the transaction'
/>
} }
label={ label={
<FormattedMessage <FormattedMessage
id='transfer.advanced.data.label' id='transfer.advanced.data.label'
defaultMessage='transaction data' /> defaultMessage='transaction data'
/>
} }
onChange={ this.onEditData } onChange={ this.onEditData }
value={ data } /> value={ data }
/>
); );
} }

View File

@ -86,8 +86,7 @@ class Transfer extends Component {
} }
return ( return (
<Warning <Warning warning={ errorEstimated } />
warning={ errorEstimated } />
); );
} }
@ -100,7 +99,8 @@ class Transfer extends Component {
<IdentityIcon <IdentityIcon
address={ account.address } address={ account.address }
center center
inline /> inline
/>
</div> </div>
<div className={ styles.hdrdetails }> <div className={ styles.hdrdetails }>
<div className={ styles.hdrname }> <div className={ styles.hdrname }>
@ -142,7 +142,8 @@ class Transfer extends Component {
return ( return (
<BusyStep <BusyStep
title='The transaction is in progress' title='The transaction is in progress'
state={ busyState } /> state={ busyState }
/>
); );
} }
@ -218,7 +219,8 @@ class Transfer extends Component {
minBlockError={ minBlockError } minBlockError={ minBlockError }
onChange={ this.store.onUpdateDetails } onChange={ this.store.onUpdateDetails }
total={ total } total={ total }
totalError={ totalError } /> totalError={ totalError }
/>
); );
} }
@ -230,33 +232,38 @@ class Transfer extends Component {
<Button <Button
icon={ <CancelIcon /> } icon={ <CancelIcon /> }
label='Cancel' label='Cancel'
onClick={ this.handleClose } /> onClick={ this.handleClose }
/>
); );
const nextBtn = ( const nextBtn = (
<Button <Button
disabled={ !this.store.isValid } disabled={ !this.store.isValid }
icon={ <NextIcon /> } icon={ <NextIcon /> }
label='Next' label='Next'
onClick={ this.store.onNext } /> onClick={ this.store.onNext }
/>
); );
const prevBtn = ( const prevBtn = (
<Button <Button
icon={ <PrevIcon /> } icon={ <PrevIcon /> }
label='Back' label='Back'
onClick={ this.store.onPrev } /> onClick={ this.store.onPrev }
/>
); );
const sendBtn = ( const sendBtn = (
<Button <Button
disabled={ !this.store.isValid || sending } disabled={ !this.store.isValid || sending }
icon={ <IdentityIcon address={ account.address } button /> } icon={ <IdentityIcon address={ account.address } button /> }
label='Send' label='Send'
onClick={ this.store.onSend } /> onClick={ this.store.onSend }
/>
); );
const doneBtn = ( const doneBtn = (
<Button <Button
icon={ <DoneIcon /> } icon={ <DoneIcon /> }
label='Close' label='Close'
onClick={ this.handleClose } /> onClick={ this.handleClose }
/>
); );
switch (stage) { switch (stage) {

View File

@ -50,22 +50,27 @@ export default class UpgradeParity extends Component {
<FormattedMessage <FormattedMessage
id='upgradeParity.step.info' id='upgradeParity.step.info'
key='info' key='info'
defaultMessage='upgrade available' />, defaultMessage='upgrade available'
/>,
<FormattedMessage <FormattedMessage
key='updating' key='updating'
id='upgradeParity.step.updating' id='upgradeParity.step.updating'
defaultMessage='upgrading parity' />, defaultMessage='upgrading parity'
/>,
store.step === STEP_ERROR store.step === STEP_ERROR
? <FormattedMessage ? <FormattedMessage
id='upgradeParity.step.error' id='upgradeParity.step.error'
key='error' key='error'
defaultMessage='error' /> defaultMessage='error'
/>
: <FormattedMessage : <FormattedMessage
id='upgradeParity.step.completed' id='upgradeParity.step.completed'
key='completed' key='completed'
defaultMessage='upgrade completed' /> defaultMessage='upgrade completed'
/>
] } ] }
visible> visible
>
{ this.renderStep() } { this.renderStep() }
</Modal> </Modal>
); );
@ -81,9 +86,11 @@ export default class UpgradeParity extends Component {
label={ label={
<FormattedMessage <FormattedMessage
id='upgradeParity.button.close' id='upgradeParity.button.close'
defaultMessage='close' /> defaultMessage='close'
/>
} }
onClick={ store.closeModal } />; onClick={ store.closeModal }
/>;
const doneButton = const doneButton =
<Button <Button
icon={ <DoneIcon /> } icon={ <DoneIcon /> }
@ -91,9 +98,11 @@ export default class UpgradeParity extends Component {
label={ label={
<FormattedMessage <FormattedMessage
id='upgradeParity.button.done' id='upgradeParity.button.done'
defaultMessage='done' /> defaultMessage='done'
/>
} }
onClick={ store.closeModal } />; onClick={ store.closeModal }
/>;
switch (store.step) { switch (store.step) {
case STEP_INFO: case STEP_INFO:
@ -104,9 +113,11 @@ export default class UpgradeParity extends Component {
label={ label={
<FormattedMessage <FormattedMessage
id='upgradeParity.button.upgrade' id='upgradeParity.button.upgrade'
defaultMessage='upgrade now' /> defaultMessage='upgrade now'
/>
} }
onClick={ store.upgradeNow } />, onClick={ store.upgradeNow }
/>,
closeButton closeButton
]; ];
@ -142,7 +153,8 @@ export default class UpgradeParity extends Component {
values={ { values={ {
currentversion: <div className={ styles.version }>{ currentversion }</div>, currentversion: <div className={ styles.version }>{ currentversion }</div>,
newversion: <div className={ styles.version }>{ newversion }</div> newversion: <div className={ styles.version }>{ newversion }</div>
} } /> } }
/>
</div> </div>
{ this.renderConsensusInfo() } { this.renderConsensusInfo() }
</div> </div>
@ -157,8 +169,10 @@ export default class UpgradeParity extends Component {
defaultMessage='Your upgrade to Parity {newversion} is currently in progress' defaultMessage='Your upgrade to Parity {newversion} is currently in progress'
values={ { values={ {
newversion: <div className={ styles.version }>{ newversion }</div> newversion: <div className={ styles.version }>{ newversion }</div>
} } /> } }
} /> />
}
/>
); );
case STEP_COMPLETED: case STEP_COMPLETED:
@ -172,7 +186,8 @@ export default class UpgradeParity extends Component {
defaultMessage='Your upgrade to Parity {newversion} has failed with an error.' defaultMessage='Your upgrade to Parity {newversion} has failed with an error.'
values={ { values={ {
newversion: <div className={ styles.version }>{ newversion }</div> newversion: <div className={ styles.version }>{ newversion }</div>
} } /> } }
/>
</div> </div>
<div className={ styles.error }> <div className={ styles.error }>
{ store.error.message } { store.error.message }
@ -188,7 +203,8 @@ export default class UpgradeParity extends Component {
defaultMessage='Your upgrade to Parity {newversion} has been successfully completed.' defaultMessage='Your upgrade to Parity {newversion} has been successfully completed.'
values={ { values={ {
newversion: <div className={ styles.version }>{ newversion }</div> newversion: <div className={ styles.version }>{ newversion }</div>
} } /> } }
/>
</Completed> </Completed>
); );
} }
@ -204,7 +220,8 @@ export default class UpgradeParity extends Component {
<div> <div>
<FormattedMessage <FormattedMessage
id='upgradeParity.consensus.capable' id='upgradeParity.consensus.capable'
defaultMessage='Your current Parity version is capable of handling the network requirements.' /> defaultMessage='Your current Parity version is capable of handling the network requirements.'
/>
</div> </div>
); );
} else if (consensusCapability.capableUntil) { } else if (consensusCapability.capableUntil) {
@ -215,7 +232,8 @@ export default class UpgradeParity extends Component {
defaultMessage='Your current Parity version is capable of handling the network requirements until block {blockNumber}' defaultMessage='Your current Parity version is capable of handling the network requirements until block {blockNumber}'
values={ { values={ {
blockNumber: consensusCapability.capableUntil blockNumber: consensusCapability.capableUntil
} } /> } }
/>
</div> </div>
); );
} else if (consensusCapability.incapableSince) { } else if (consensusCapability.incapableSince) {
@ -226,7 +244,8 @@ export default class UpgradeParity extends Component {
defaultMessage='Your current Parity version is incapable of handling the network requirements since block {blockNumber}' defaultMessage='Your current Parity version is incapable of handling the network requirements since block {blockNumber}'
values={ { values={ {
blockNumber: consensusCapability.incapableSince blockNumber: consensusCapability.incapableSince
} } /> } }
/>
</div> </div>
); );
} }
@ -236,7 +255,8 @@ export default class UpgradeParity extends Component {
<div> <div>
<FormattedMessage <FormattedMessage
id='upgradeParity.consensus.unknown' id='upgradeParity.consensus.unknown'
defaultMessage='Your current Parity version is capable of handling the network requirements.' /> defaultMessage='Your current Parity version is capable of handling the network requirements.'
/>
</div> </div>
); );
} }
@ -246,7 +266,8 @@ export default class UpgradeParity extends Component {
return ( return (
<FormattedMessage <FormattedMessage
id='upgradeParity.version.unknown' id='upgradeParity.version.unknown'
defaultMessage='unknown' /> defaultMessage='unknown'
/>
); );
} }

View File

@ -317,7 +317,6 @@ class WalletSettings extends Component {
default: default:
case 'TYPE': case 'TYPE':
return [ cancelBtn, nextBtn ]; return [ cancelBtn, nextBtn ];
} }
} }
} }
@ -333,4 +332,7 @@ function mapStateToProps (initState, initProps) {
}; };
} }
export default connect(mapStateToProps)(WalletSettings); export default connect(
mapStateToProps,
null
)(WalletSettings);

View File

@ -26,7 +26,6 @@ import { fromWei } from '~/api/util/wei';
import styles from './accountCard.css'; import styles from './accountCard.css';
export default class AccountCard extends Component { export default class AccountCard extends Component {
static propTypes = { static propTypes = {
account: PropTypes.object.isRequired, account: PropTypes.object.isRequired,
onClick: PropTypes.func.isRequired, onClick: PropTypes.func.isRequired,

View File

@ -36,7 +36,6 @@ const initialState = {
}; };
export default class ActionbarImport extends Component { export default class ActionbarImport extends Component {
static propTypes = { static propTypes = {
onConfirm: PropTypes.func.isRequired, onConfirm: PropTypes.func.isRequired,
renderValidation: PropTypes.func, renderValidation: PropTypes.func,
@ -219,5 +218,4 @@ export default class ActionbarImport extends Component {
onCloseModal = () => { onCloseModal = () => {
this.setState(initialState); this.setState(initialState);
} }
} }

Some files were not shown because too many files have changed in this diff Show More