-
Notifications
You must be signed in to change notification settings - Fork 0
/
_tools.tsx
37 lines (35 loc) · 1020 Bytes
/
_tools.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
import { React } from "./_deps.tsx";
import type { PagicLayout } from "./_deps.tsx";
const Tools: PagicLayout = ({ config, pagePath }) => {
if (!config.tools) {
return null;
}
return (
<div className="tools flex_center hide_on_mobile">
{config.tools.editOnGitHub && (
<a
className="czs-pen button"
href={`${config.github}/edit/${config.branch ??
"main"}/${config.srcDir}/${pagePath}`}
target="_blank"
style={{ backgroundImage: `url("${config.root}assets/czs-pen.svg")` }}
/>
)}
{config.tools.backToTop && (
<a
className="czs-angle-up-l button"
href="#"
onClick={(e) => {
e.preventDefault();
// deno-lint-ignore no-explicit-any
(window as any).scrollTo(0, 0);
}}
style={{
backgroundImage: `url("${config.root}assets/czs-angle-up-l.svg")`,
}}
/>
)}
</div>
);
};
export default Tools;