-
Notifications
You must be signed in to change notification settings - Fork 362
Expand file tree
/
Copy pathpage-issue-link.tsx
More file actions
37 lines (32 loc) · 1.04 KB
/
page-issue-link.tsx
File metadata and controls
37 lines (32 loc) · 1.04 KB
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
import { Component, createMemo, createSignal, onMount } from "solid-js";
import { Icon } from "solid-heroicons";
import { exclamationTriangle } from "solid-heroicons/outline";
import { useI18n } from "~/i18n/i18n-context";
import { getEntryFileName } from "~/i18n/helpers";
export const PageIssueLink: Component = () => {
const i18n = useI18n();
const [mounted, setMounted] = createSignal(false);
onMount(() => setMounted(true));
const srcPath = createMemo(() => {
return (
"https://github.com/solidjs/solid-docs-next/issues/new" +
"?assignees=ladybluenotes" +
"&labels=improve+documentation%2Cpending+review" +
"&projects=" +
"&template=CONTENT.yml" +
"&title=[Content]:" +
`&subject=${getEntryFileName()}` +
`&page=${mounted() ? window.location.href : ""}`
);
});
return (
<a
class="flex no-underline hover:text-blue-700 dark:hover:text-blue-300 dark:text-slate-300"
href={srcPath()}
target="_blank"
>
<Icon class="mr-1 w-[16px]" path={exclamationTriangle} />
{i18n.t("contribute.report")}
</a>
);
};