1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

modify: remove add tag button

This commit is contained in:
sota1235
2016-12-22 14:00:44 +09:00
parent b6fc24c6e7
commit 1118149b9e

View File

@@ -9,7 +9,6 @@ class TagSelect extends React.Component {
this.state = {
newTag: '',
inputReady: false,
}
}
@@ -77,7 +76,6 @@ class TagSelect extends React.Component {
newTag: ''
}, () => {
this.value = value
this.setState({ inputReady: false })
this.props.onChange()
})
}
@@ -100,12 +98,6 @@ class TagSelect extends React.Component {
}
}
handleNewTagInputReady (e) {
this.setState({
inputReady: true,
})
}
render () {
let { value, className } = this.props
@@ -134,27 +126,13 @@ class TagSelect extends React.Component {
styleName='root'
>
{tagList}
{(() => {
if (this.state.inputReady) {
return (
<input styleName='newTag'
ref='newTag'
value={this.state.newTag}
placeholder='Add tag...'
onChange={(e) => this.handleNewTagInputChange(e)}
onKeyDown={(e) => this.handleNewTagInputKeyDown(e)}
/>
)
}
return (
<button styleName='add-tag-button'
onClick={(e) => this.handleNewTagInputReady(e)}
>
<i className='fa fa-plus' />
</button>
)
})()}
<input styleName='newTag'
ref='newTag'
value={this.state.newTag}
placeholder='Add tag...'
onChange={(e) => this.handleNewTagInputChange(e)}
onKeyDown={(e) => this.handleNewTagInputKeyDown(e)}
/>
</div>
)
}