mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-03 07:55:36 +00:00
Monitor shared repos (#5375)
* [shared with me] added 'watch/unwatch file changes' for libraries * [groups, group] added 'watch/unwatch file changes' for libraries * [shared with me] only libraries shared with 'r', 'rw' permissions can be monitored * [groups, group] only libraries shared with 'r', 'rw' permissions can be monitored * [shared with me] improved the interaction for library items * [groups, group] cleaned up the code
This commit is contained in:
33
frontend/src/components/repo-monitored-icon.js
Normal file
33
frontend/src/components/repo-monitored-icon.js
Normal file
@@ -0,0 +1,33 @@
|
||||
import React, { Fragment } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { UncontrolledTooltip } from 'reactstrap';
|
||||
import Icon from '../components/icon';
|
||||
import { gettext } from '../utils/constants';
|
||||
|
||||
const propTypes = {
|
||||
repoID: PropTypes.string.isRequired
|
||||
};
|
||||
|
||||
class RepoMonitoredIcon extends React.Component {
|
||||
|
||||
render() {
|
||||
const { repoID } = this.props;
|
||||
return (
|
||||
<Fragment>
|
||||
<span id={`watching-${repoID}`} className="ml-1">
|
||||
<Icon symbol='monitor' />
|
||||
</span>
|
||||
<UncontrolledTooltip
|
||||
placement="bottom"
|
||||
target={`#watching-${repoID}`}
|
||||
>
|
||||
{gettext('You are watching file changes of this library.')}
|
||||
</UncontrolledTooltip>
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
RepoMonitoredIcon.propTypes = propTypes;
|
||||
|
||||
export default RepoMonitoredIcon;
|
Reference in New Issue
Block a user