-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththeme.config.tsx
65 lines (61 loc) · 1.6 KB
/
theme.config.tsx
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import type { DocsThemeConfig } from "nextra-theme-docs";
import ThemeToggle from "./src/widgets/theme-toggle";
import LocaleToggle from "./src/widgets/locale-toggle";
import { CustomFooter } from "@/components/CustomFooter";
import { useLocale } from "@/hooks";
const Logo = () => {
const { t, currentLocale } = useLocale();
return (
<div
className="flex hover:nx-opacity-75 items-center"
onClick={() => {
window.location.href = "/";
}}
>
<img src="/logo.svg" style={{ width: "32px" }} alt="" />
<span className="mx-2 font-extrabold hidden md:inline select-none">
CANYON
</span>
<span className="text-gray-600 font-normal hidden lg:!inline whitespace-no-wrap">
{t("logo.desc")}
</span>
</div>
);
};
const docsThemeConfig = {
logo: <Logo></Logo>,
project: {
link: "https://github.com/canyon-project/canyon",
},
themeSwitch: {
component: () => <></>,
},
footer: {
component: () => <CustomFooter />,
},
navbar: {
extraContent: () => {
return (
<>
<LocaleToggle className="max-md:hidden" />
<ThemeToggle className="max-md:hidden" />
</>
);
},
},
editLink: {
component: ({ children, filePath, className }) => (
<a
className={className}
target={"_blank"}
href={`https://github.com/canyon-project/docs/blob/main/${filePath}`}
>
{children}
</a>
),
},
feedback: {
useLink: () => `https://github.com/canyon-project/canyon/issues/new`,
}
} satisfies DocsThemeConfig;
export default docsThemeConfig;