mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-04 08:28:11 +00:00
change viewer (#3115)
This commit is contained in:
@@ -18,6 +18,10 @@ const propTypes = {
|
||||
toggleStar: PropTypes.func.isRequired,
|
||||
backToParentDirectory: PropTypes.func.isRequired,
|
||||
openDialogs: PropTypes.func.isRequired,
|
||||
showFileHistory: PropTypes.bool.isRequired,
|
||||
toggleHistory: PropTypes.func.isRequired,
|
||||
commentsNumber: PropTypes.number.isRequired,
|
||||
toggleCommentList: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
class MarkdownViewerToolbar extends React.Component {
|
||||
@@ -47,12 +51,25 @@ class MarkdownViewerToolbar extends React.Component {
|
||||
<ButtonGroup>
|
||||
<IconButton id={'shareBtn'} text={gettext('Share')} icon={'fa fa-share-alt'}
|
||||
onMouseDown={this.props.toggleShareLinkDialog}/>
|
||||
{
|
||||
this.props.commentsNumber > 0 ?
|
||||
<button className="btn btn-icon btn-secondary btn-active" id="commentsNumber" type="button"
|
||||
data-active="false" onMouseDown={this.props.toggleCommentList}>
|
||||
<i className="fa fa-comments"></i>{' '}<span>{this.props.commentsNumber}</span>
|
||||
</button>
|
||||
:
|
||||
<IconButton id={'commentsNumber'} text={gettext('Comments')} icon={'fa fa-comments'} onMouseDown={this.props.toggleCommentList}/>
|
||||
}
|
||||
<IconButton text={gettext('Back to parent directory')} id={'parentDirectory'}
|
||||
icon={'fa fa-folder-open'} onMouseDown={this.props.backToParentDirectory}/>
|
||||
{
|
||||
(!this.props.hasDraft && this.props.fileInfo.permission === 'rw')? <IconButton text={gettext('Edit')}
|
||||
id={'editButton'} icon={'fa fa-edit'} onMouseDown={this.props.onEdit}/>: null
|
||||
}
|
||||
{
|
||||
this.props.showFileHistory && <IconButton id={'historyButton'}
|
||||
text={gettext('File history')} onMouseDown={this.props.toggleHistory} icon={'fa fa-history'}/>
|
||||
}
|
||||
</ButtonGroup>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user