@@ -16,6 +16,10 @@ import {
|
|||||||
RadioGroup,
|
RadioGroup,
|
||||||
TextField,
|
TextField,
|
||||||
Typography,
|
Typography,
|
||||||
|
IconButton,
|
||||||
|
FormControl,
|
||||||
|
InputLabel,
|
||||||
|
Input,
|
||||||
} from '@material-ui/core'
|
} from '@material-ui/core'
|
||||||
import { makePublishEvent, rendererEvents } from '../../../../../events'
|
import { makePublishEvent, rendererEvents } from '../../../../../events'
|
||||||
|
|
||||||
@@ -24,6 +28,7 @@ import { AppState } from '../../../reducers'
|
|||||||
import History from '../History'
|
import History from '../History'
|
||||||
import Message from './Model/Message'
|
import Message from './Model/Message'
|
||||||
import Navigation from '@material-ui/icons/Navigation'
|
import Navigation from '@material-ui/icons/Navigation'
|
||||||
|
import Clear from '@material-ui/icons/Clear'
|
||||||
import { bindActionCreators } from 'redux'
|
import { bindActionCreators } from 'redux'
|
||||||
import { connect } from 'react-redux'
|
import { connect } from 'react-redux'
|
||||||
import { sidebarActions } from '../../../actions'
|
import { sidebarActions } from '../../../actions'
|
||||||
@@ -96,21 +101,28 @@ class Publish extends React.Component<Props, State> {
|
|||||||
return (topic !== undefined) ? topic : selectedNodePath
|
return (topic !== undefined) ? topic : selectedNodePath
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private clearTopic = () => {
|
||||||
|
this.props.actions.setPublishTopic(undefined)
|
||||||
|
}
|
||||||
|
|
||||||
private topic() {
|
private topic() {
|
||||||
const topicStr = this.currentTopic() || ''
|
const topicStr = this.currentTopic() || ''
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Typography>Topic</Typography>
|
<FormControl style={{ width: '100%' }}>
|
||||||
<TextField
|
<InputLabel htmlFor="publish-topic">Topic</InputLabel>
|
||||||
placeholder="example/topic"
|
<Input
|
||||||
style={{ width: '100%' }}
|
id="publish-topic"
|
||||||
margin="normal"
|
value={topicStr}
|
||||||
value={topicStr}
|
startAdornment={<span/>}
|
||||||
multiline={true}
|
endAdornment={<IconButton style={{ padding: '4px' }} onClick={this.clearTopic}><Clear style={{ fontSize: '14px' }} /></IconButton>}
|
||||||
onChange={this.updateTopic}
|
onBlur={this.onTopicBlur}
|
||||||
InputProps={{ onBlur: this.onTopicBlur }}
|
onChange={this.updateTopic}
|
||||||
/>
|
multiline={true}
|
||||||
|
placeholder="example/topic"
|
||||||
|
/>
|
||||||
|
</FormControl>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user