Allow tags for Accounts, Addresses and Contracts (#2712)
* Added tag to the editMeta Modal (#2643) * Added Tags to ui and to contract/address/account Header (#2643) * Added tags to summary (#2643) * Added Search capabilities to contracts/address book/accounts from tokens (#2643) * fixes eslint * Using Chips/Tokens for search (#2643) * Add search tokens, clickable from List (#2643) * Add sort capabilities to Accounts / Addresses / Contracts (#2643) * Fixes formatting issues + state updates after component unmount bug (#2643) * Remove unused import * Small fixes for PR #2697 * Added default sort order for Contracts/Addresses/Accounts * Using official `material-ui-chip-input` NPM package * Removed LESS from webpack
This commit is contained in:
committed by
Gav Wood
parent
dadd6b1e7c
commit
cc10f412dc
@@ -17,6 +17,8 @@
|
||||
import React, { Component, PropTypes } from 'react';
|
||||
import ContentClear from 'material-ui/svg-icons/content/clear';
|
||||
import ContentSave from 'material-ui/svg-icons/content/save';
|
||||
// import ChipInput from 'material-ui-chip-input';
|
||||
import ChipInput from 'material-ui-chip-input/src/ChipInput';
|
||||
|
||||
import { Button, Form, Input, Modal } from '../../ui';
|
||||
import { validateName } from '../../util/validation';
|
||||
@@ -55,6 +57,7 @@ export default class EditMeta extends Component {
|
||||
error={ nameError }
|
||||
onSubmit={ this.onNameChange } />
|
||||
{ this.renderMetaFields() }
|
||||
{ this.renderTags() }
|
||||
</Form>
|
||||
</Modal>
|
||||
);
|
||||
@@ -96,6 +99,23 @@ export default class EditMeta extends Component {
|
||||
});
|
||||
}
|
||||
|
||||
renderTags () {
|
||||
const { meta } = this.state;
|
||||
const { tags } = meta || [];
|
||||
const onChange = (chips) => this.onMetaChange('tags', chips);
|
||||
|
||||
return (
|
||||
<ChipInput
|
||||
defaultValue={ tags }
|
||||
onChange={ onChange }
|
||||
floatingLabelText='(optional) tags'
|
||||
hintText='press <Enter> to add a tag'
|
||||
floatingLabelFixed
|
||||
fullWidth
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
onNameChange = (name) => {
|
||||
this.setState(validateName(name));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user