tycho-components 0.25.7 → 0.25.8
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.
|
@@ -20,18 +20,14 @@ export default function DocumentDrawer({ uid, setOpenFile, setFilter, handleChan
|
|
|
20
20
|
const { getCorpus, hasParameter } = useCorpusUtils();
|
|
21
21
|
const [document, setDocument] = useState();
|
|
22
22
|
const [activeKey, setActiveKey] = useState("actions");
|
|
23
|
-
const hasParticipants = (document?.participants?.length ?? 0) > 0;
|
|
24
23
|
const fileItems = useMemo(() => {
|
|
25
24
|
if (!document)
|
|
26
25
|
return [];
|
|
27
|
-
let items = hasParticipants
|
|
28
|
-
? baseFileItems
|
|
29
|
-
: baseFileItems.filter((item) => item.eventKey !== "participants");
|
|
30
26
|
if (document.github) {
|
|
31
|
-
|
|
27
|
+
return [...baseFileItems, githubFileItem];
|
|
32
28
|
}
|
|
33
|
-
return
|
|
34
|
-
}, [document
|
|
29
|
+
return baseFileItems;
|
|
30
|
+
}, [document]);
|
|
35
31
|
const handleTabChange = (_event, newValue) => {
|
|
36
32
|
setActiveKey(newValue);
|
|
37
33
|
};
|
|
@@ -47,11 +43,6 @@ export default function DocumentDrawer({ uid, setOpenFile, setFilter, handleChan
|
|
|
47
43
|
setDocument(response.data);
|
|
48
44
|
});
|
|
49
45
|
}, [uid]);
|
|
50
|
-
useEffect(() => {
|
|
51
|
-
if (!hasParticipants && activeKey === "participants") {
|
|
52
|
-
setActiveKey("actions");
|
|
53
|
-
}
|
|
54
|
-
}, [activeKey, hasParticipants]);
|
|
55
46
|
if (!document)
|
|
56
47
|
return null;
|
|
57
48
|
return (_jsx(Drawer, { anchor: "left", open: true, onClose: () => setOpenFile(false), className: "offcanvas-file", children: _jsxs("div", { className: "drawer-container", children: [_jsxs("div", { className: "tabs-col", children: [_jsxs("div", { className: "nav-item-close", onClick: () => setOpenFile(false), children: [_jsx("span", { className: "nav-link-icon", children: _jsx(Icon, { name: "arrow_circle_left" }) }), _jsx("span", { className: "title", children: t("menu.label.close") })] }), _jsx(Tabs, { orientation: "vertical", value: activeKey, onChange: handleTabChange, className: "nav", children: fileItems.map((item, idx) => (_jsx(Tab, { value: item.eventKey, label: _jsxs(_Fragment, { children: [_jsx("span", { className: "nav-link-icon", children: _jsx(Icon, { name: item.icon }) }), _jsx("span", { className: "title", children: t(item.title) })] }) }, idx.valueOf()))) })] }), _jsxs("div", { className: "info-col", children: [activeKey === "home" && (_jsx(Info, { document: document, categoriesHierarchy: categoriesHierarchy, handleChange: (updated) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tycho-components",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.25.
|
|
4
|
+
"version": "0.25.8",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"react-i18next": "^13.0.2",
|
|
83
83
|
"react-router-dom": "^6.14.2",
|
|
84
84
|
"react-toastify": "^9.1.3",
|
|
85
|
-
"tycho-storybook": "0.9.
|
|
85
|
+
"tycho-storybook": "0.9.5",
|
|
86
86
|
"wavesurfer-react": "^2.2.2",
|
|
87
87
|
"wavesurfer.js": "^6.6.3"
|
|
88
88
|
},
|