Skip to content

Commit 46621a4

Browse files
committed
feat: add Raise ticket action
1 parent dd3f0c9 commit 46621a4

File tree

5 files changed

+41
-1
lines changed

5 files changed

+41
-1
lines changed

docusaurus.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ const config: Config = {
5959
cloudLink: siteConfig[lang].cloudLink,
6060
blogTags: ["weekly", "databend"],
6161
askBendUrl: isProduction ? ASKBEND_URL : "",
62+
site
6263
},
6364
presets: [
6465
[

i18n/en/code.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -808,5 +808,9 @@
808808
"DOCUMENTATION": {
809809
"message": "DOCUMENTATION",
810810
"description": "DOCUMENTATION"
811+
},
812+
"Raise issue": {
813+
"message": "Raise issue",
814+
"description": "Raise issue"
811815
}
812816
}

i18n/zh/code.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -832,5 +832,9 @@
832832
"DOCUMENTATION": {
833833
"message": "文档",
834834
"description": "DOCUMENTATION"
835+
},
836+
"Raise issue": {
837+
"message": "提 issue",
838+
"description": "Raise issue"
835839
}
836840
}

src/theme/DocPaginator/index.tsx

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,31 @@ import ThumbsUp from "./ThumbsUp.svg";
1414
import ThumbsDown from "./ThumbsDown.svg";
1515
import clsx from "clsx";
1616
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
17+
import { useLocation } from "@docusaurus/router";
1718
const { TextArea } = Input;
19+
function Alarm() {
20+
return (
21+
<svg
22+
style={{ width: "18px" }}
23+
xmlns="http://www.w3.org/2000/svg"
24+
viewBox="0 0 512 512"
25+
fill="currentColor"
26+
>
27+
<path d="M506.3 417l-213.3-364C284.8 39 270.4 32 256 32C241.6 32 227.2 39 218.1 53l-213.2 364C-10.59 444.9 9.851 480 42.74 480h426.6C502.1 480 522.6 445 506.3 417zM52.58 432L255.1 84.8L459.4 432H52.58zM256 337.1c-17.36 0-31.44 14.08-31.44 31.44c0 17.36 14.11 31.44 31.48 31.44s31.4-14.08 31.4-31.44C287.4 351.2 273.4 337.1 256 337.1zM232 184v96C232 293.3 242.8 304 256 304s24-10.75 24-24v-96C280 170.8 269.3 160 256 160S232 170.8 232 184z"></path>
28+
</svg>
29+
);
30+
}
1831
export default function DocPaginator(props) {
1932
const { previous, next } = props;
2033
const [loading, setLoading] = useState(false);
2134
const [isVoted, setIsVoted] = useState(false);
2235
const [form] = Form.useForm();
2336
const {
2437
siteConfig: {
25-
customFields: { isChina },
38+
customFields: { isChina, site },
2639
},
2740
} = useDocusaurusContext() as any;
41+
const { pathname } = useLocation();
2842
function popover() {
2943
return (
3044
<div style={{ width: "390px", textAlign: "center" }}>
@@ -138,6 +152,15 @@ export default function DocPaginator(props) {
138152
</div>
139153
</div>
140154
)}
155+
<Button
156+
target="_blank"
157+
rel="noopener noreferrer"
158+
href={`https://github.com/databendlabs/databend-docs/issues/new?title=Issue on docs, site=${site}&body=Path: ${pathname}`}
159+
className={styles.RaiseButton}
160+
>
161+
<Alarm />
162+
{$t("Raise issue")}
163+
</Button>
141164
</div>
142165
</Spin>
143166
<nav

src/theme/DocPaginator/styles.module.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,11 @@
9191
flex-direction: column;
9292
}
9393
}
94+
95+
.RaiseButton {
96+
margin-left: auto;
97+
color: var(--color-text-2);
98+
@media screen and (max-width: 500px) {
99+
display: none;
100+
}
101+
}

0 commit comments

Comments
 (0)