@c-rex/templates 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c-rex/templates",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"src"
|
|
@@ -18,9 +18,13 @@
|
|
|
18
18
|
"types": "./src/home/page.tsx",
|
|
19
19
|
"import": "./src/home/page.tsx"
|
|
20
20
|
},
|
|
21
|
-
"./info/page": {
|
|
22
|
-
"types": "./src/info/page.tsx",
|
|
23
|
-
"import": "./src/info/page.tsx"
|
|
21
|
+
"./articles/info/page": {
|
|
22
|
+
"types": "./src/articles/info/page.tsx",
|
|
23
|
+
"import": "./src/articles/info/page.tsx"
|
|
24
|
+
},
|
|
25
|
+
"./articles/documents/page": {
|
|
26
|
+
"types": "./src/articles/documents/page.tsx",
|
|
27
|
+
"import": "./src/articles/documents/page.tsx"
|
|
24
28
|
},
|
|
25
29
|
"./layout": {
|
|
26
30
|
"types": "./src/layout.tsx",
|
|
@@ -28,7 +32,8 @@
|
|
|
28
32
|
}
|
|
29
33
|
},
|
|
30
34
|
"scripts": {
|
|
31
|
-
"lint": "eslint .
|
|
35
|
+
"lint": "eslint .",
|
|
36
|
+
"lint:fix": "eslint . --fix"
|
|
32
37
|
},
|
|
33
38
|
"devDependencies": {
|
|
34
39
|
"@c-rex/eslint-config": "*",
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SidebarInset, SidebarProvider } from "@c-rex/ui/sidebar";
|
|
3
|
+
import { AppSidebar } from "@c-rex/components/sidebar";
|
|
4
|
+
import { Breadcrumb } from "@c-rex/components/breadcrumb";
|
|
5
|
+
import { loadArticleData } from "@c-rex/utils";
|
|
6
|
+
|
|
7
|
+
export const DocumentsPageTemplate = async ({ params }: { params: { id: string } }) => {
|
|
8
|
+
const { documentURL, availableVersions: availableVersionsAux, title } = await loadArticleData(params.id)
|
|
9
|
+
|
|
10
|
+
const availableVersions = availableVersionsAux.map((item) => {
|
|
11
|
+
return {
|
|
12
|
+
link: `/documents/${item.shortId}`,
|
|
13
|
+
...item,
|
|
14
|
+
}
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<SidebarProvider>
|
|
19
|
+
<title>{title}</title>
|
|
20
|
+
<AppSidebar
|
|
21
|
+
data={[]}
|
|
22
|
+
availableVersions={availableVersions}
|
|
23
|
+
className="top-20"
|
|
24
|
+
side="right"
|
|
25
|
+
variant="floating"
|
|
26
|
+
collapsible="icon"
|
|
27
|
+
/>
|
|
28
|
+
<SidebarInset>
|
|
29
|
+
<div className="container flex flex-col">
|
|
30
|
+
<header className="flex h-16 shrink-0 items-center justify-between">
|
|
31
|
+
<div className="flex shrink-0 items-center">
|
|
32
|
+
<Breadcrumb items={[
|
|
33
|
+
{
|
|
34
|
+
link: "/",
|
|
35
|
+
label: title,
|
|
36
|
+
id: "title",
|
|
37
|
+
active: false,
|
|
38
|
+
children: [],
|
|
39
|
+
}
|
|
40
|
+
]} />
|
|
41
|
+
</div>
|
|
42
|
+
</header>
|
|
43
|
+
|
|
44
|
+
<div style={{ width: '100%', height: '90.6vh' }}>
|
|
45
|
+
<iframe
|
|
46
|
+
width="100%"
|
|
47
|
+
height="100%"
|
|
48
|
+
style={{ border: 'none' }}
|
|
49
|
+
src={documentURL}
|
|
50
|
+
/>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
</SidebarInset>
|
|
54
|
+
</SidebarProvider>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
@@ -1,28 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import React, { FC } from "react";
|
|
4
|
-
import { TreeOfContent } from "@c-rex/interfaces";
|
|
1
|
+
import React from "react";
|
|
5
2
|
import { SidebarInset, SidebarProvider } from "@c-rex/ui/sidebar";
|
|
6
3
|
import { AppSidebar } from "@c-rex/components/sidebar";
|
|
7
4
|
import { Breadcrumb } from "@c-rex/components/breadcrumb";
|
|
5
|
+
import { loadArticleData } from "@c-rex/utils";
|
|
6
|
+
|
|
7
|
+
export const InfoPageTemplate = async ({ params }: { params: { id: string } }) => {
|
|
8
|
+
const {
|
|
9
|
+
availableVersions: availableVersionsAux,
|
|
10
|
+
title,
|
|
11
|
+
treeOfContent,
|
|
12
|
+
breadcrumbItems,
|
|
13
|
+
htmlContent
|
|
14
|
+
} = await loadArticleData(params.id)
|
|
8
15
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
16
|
+
const availableVersions = availableVersionsAux.map((item) => {
|
|
17
|
+
return {
|
|
18
|
+
link: `/topics/${item.shortId}`,
|
|
19
|
+
...item,
|
|
20
|
+
}
|
|
21
|
+
})
|
|
15
22
|
|
|
16
|
-
export const InfoPageTemplate: FC<InfoPageTemplateProps> = ({
|
|
17
|
-
htmlContent,
|
|
18
|
-
breadcrumbItems,
|
|
19
|
-
sidebarItems,
|
|
20
|
-
availableVersions
|
|
21
|
-
}) => {
|
|
22
23
|
return (
|
|
23
24
|
<SidebarProvider>
|
|
25
|
+
<title>{title}</title>
|
|
26
|
+
|
|
24
27
|
<AppSidebar
|
|
25
|
-
data={
|
|
28
|
+
data={treeOfContent}
|
|
26
29
|
availableVersions={availableVersions}
|
|
27
30
|
className="top-20"
|
|
28
31
|
side="right"
|
package/src/home/layout.tsx
CHANGED