forked from denoland/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
raw.tsx
75 lines (72 loc) · 2.15 KB
/
raw.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
66
67
68
69
70
71
72
73
74
75
export const layout = "layout.tsx";
export default function Raw(props: Lume.Data, helpers: Lume.Helpers) {
const reference = props.url.startsWith("/api");
if (reference) {
return (
<div>
{props.children}
</div>
);
}
return (
<>
{props.sidebar && (
<>
<aside
class="absolute top-0 bottom-0 -left-74 sidebar-open:left-0 w-74 border-r border-foreground-tertiary bg-background-primary z-50 xl:hidden transition-all"
id="sidebar"
data-open="false"
>
<div class="p-4 shadow-sm flex justify-between h-16">
<a class="flex items-center gap-3 mr-6" href="/">
<img
src="/img/logo.svg"
class="block size-6"
alt=""
aria-hidden="true"
/>
<b class="text-xl">
<span class="sr-only">Deno</span> Docs
</b>
</a>
<button
type="button"
aria-label="Close navigation bar"
id="sidebar-close"
>
<svg
viewBox="0 0 15 15"
width="21"
height="21"
class="text-foreground-secondary"
>
<g stroke="currentColor" stroke-width="1.2">
<path d="M.75.75l13.5 13.5M14.25.75L.75 14.25"></path>
</g>
</svg>
</button>
</div>
<props.comp.Sidebar
sidebar={props.sidebar}
search={props.search}
url={props.url}
/>
</aside>
<div
class="absolute inset-0 backdrop-brightness-50 z-40 hidden sidebar-open:block sidebar-open:xl:hidden"
id="sidebar-cover"
data-open="false"
>
</div>
</>
)}
<div
class="absolute top-16 bottom-0 left-0 right-0 overflow-y-auto"
style={{ scrollbarGutter: "stable" }}
>
{props.children}
<props.comp.Footer />
</div>
</>
);
}