-
-
Notifications
You must be signed in to change notification settings - Fork 259
Expand file tree
/
Copy pathDocsOverview.res
More file actions
45 lines (39 loc) · 1.45 KB
/
DocsOverview.res
File metadata and controls
45 lines (39 loc) · 1.45 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
38
39
40
41
42
43
44
45
module Card = {
@react.component
let make = (~title: string, ~hrefs: array<(string, string)>) => {
<div className="max-w-84 border border-gray-10 bg-gray-5 px-5 py-8 rounded-lg">
<h2 className="font-bold text-24 mb-4"> {React.string(title)} </h2>
<ul>
{Array.map(hrefs, ((text, href)) =>
<li key=text className="text-16 mb-1 last:mb-0 text-fire hover:underline">
<ReactRouter.Link.String to=href> {React.string(text)} </ReactRouter.Link.String>
</li>
)->React.array}
</ul>
</div>
}
}
@react.component
let default = (~showVersionSelect=true) => {
let {pathname} = ReactRouter.useLocation()
let url = (pathname :> string)->Url.parse
let version = url->Url.getVersionString
let languageManual = Constants.languageManual(version)
let ecosystem = [
("Package Index", "/packages"),
("rescript-react", "/docs/react/introduction"),
("GenType", `/docs/manual/${version}/typescript-integration`),
("Reanalyze", "https://github.com/rescript-lang/reanalyze"),
]
<MainLayout>
<div className="max-w-740 w-full m-auto">
// <div className="mb-6" />
<Markdown.H1> {React.string("Docs")} </Markdown.H1>
<div className="grid grid-cols-1 xs:grid-cols-2 gap-8">
<Card title="Language Manual" hrefs=languageManual />
<Card title="Ecosystem" hrefs=ecosystem />
<Card title="Tools" hrefs=Constants.tools />
</div>
</div>
</MainLayout>
}