mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-31 06:34:40 +00:00
* [wiki] added 2 new entrances(one in the wiki card, the other in the wiki 'edit' page) for published wikis * [wiki] fixed eslint warning
46 lines
1.1 KiB
JavaScript
46 lines
1.1 KiB
JavaScript
import React, { Component } from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import { UncontrolledTooltip } from 'reactstrap';
|
|
import { serviceURL, gettext } from '../utils/constants';
|
|
|
|
import '../css/published-wiki-entrance.css';
|
|
|
|
const propTypes = {
|
|
wikiID: PropTypes.string.isRequired,
|
|
customURLPart: PropTypes.string.isRequired
|
|
};
|
|
|
|
class PublishedWikiExtrance extends Component {
|
|
constructor(props) {
|
|
super(props);
|
|
}
|
|
|
|
render() {
|
|
const { wikiID, customURLPart } = this.props;
|
|
return (
|
|
<>
|
|
<a
|
|
id={`wiki-${wikiID}`}
|
|
className="view-published-wiki ml-2"
|
|
href={`${serviceURL}/wiki/publish/${customURLPart}`}
|
|
target="_blank"
|
|
rel="noreferrer"
|
|
onClick={(e) => {e.stopPropagation();}}
|
|
>
|
|
{gettext('Published')}
|
|
</a>
|
|
<UncontrolledTooltip
|
|
target={`wiki-${wikiID}`}
|
|
placement="bottom"
|
|
>
|
|
{gettext('View published page')}
|
|
</UncontrolledTooltip>
|
|
</>
|
|
);
|
|
}
|
|
}
|
|
|
|
PublishedWikiExtrance.propTypes = propTypes;
|
|
|
|
export default PublishedWikiExtrance;
|