forked from OpenAPITools/openapi-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEditThisPage.js
40 lines (36 loc) · 1.11 KB
/
EditThisPage.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
const React = require("react");
const path = require("path");
const CompLibrary = require(path.join(__dirname, "../node_modules/docusaurus/lib/core/CompLibrary.js"));
const Container = CompLibrary.Container;
const MarkdownBlock = CompLibrary.MarkdownBlock;
class EditThisPage extends React.Component {
renderHeader(title) {
if (!title) {
return null;
}
return (
<h1>
<MarkdownBlock>{title}</MarkdownBlock>
</h1>
)
}
render() {
return (
<Container padding={[]}>
<div className="edit-this-page text-center">
{this.renderHeader(this.props.title)}
<p className="link">
<a
href={this.props.url}
target="_blank"
rel="noreferrer noopener"
>
Edit this page
</a>
</p>
</div>
</Container>
);
}
}
module.exports = EditThisPage;