tycho-components 0.7.13 → 0.7.14
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.
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from
|
|
3
|
-
import { useTranslation } from
|
|
4
|
-
import { useParams } from
|
|
5
|
-
import AppModal from
|
|
6
|
-
import AppPicture from
|
|
7
|
-
import { useCorpusUtils } from
|
|
8
|
-
import CorpusService from
|
|
9
|
-
import
|
|
10
|
-
import
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
4
|
+
import { useParams } from "react-router-dom";
|
|
5
|
+
import AppModal from "../../AppModal";
|
|
6
|
+
import AppPicture from "../../AppPicture";
|
|
7
|
+
import { useCorpusUtils } from "../../configs/useCorpusUtils";
|
|
8
|
+
import CorpusService from "../types/CorpusService";
|
|
9
|
+
import HeaderCorpus from "./HeaderCorpus";
|
|
10
|
+
import "./style.scss";
|
|
11
11
|
export default function HeaderCorpora({ navigateCorpora, redirect, autoload, freeAccess, }) {
|
|
12
|
-
const { t } = useTranslation(
|
|
12
|
+
const { t } = useTranslation("header");
|
|
13
13
|
const { setCorpus, getCorpus, hasCorpus } = useCorpusUtils();
|
|
14
14
|
const { uid } = useParams();
|
|
15
15
|
const [corpora, setCorpora] = useState([]);
|
|
@@ -61,5 +61,5 @@ export default function HeaderCorpora({ navigateCorpora, redirect, autoload, fre
|
|
|
61
61
|
useEffect(() => {
|
|
62
62
|
autoload && loadAndApply();
|
|
63
63
|
}, [autoload]);
|
|
64
|
-
return (_jsxs(_Fragment, { children: [hasCorpus() && _jsx(HeaderCorpus, { onClick: handleCorpusClick }), openCorpora && (_jsx(AppModal, { className: "modal-corpora", title: t(
|
|
64
|
+
return (_jsxs(_Fragment, { children: [hasCorpus() && _jsx(HeaderCorpus, { onClick: handleCorpusClick }), openCorpora && (_jsx(AppModal, { className: "modal-corpora", title: t("label.choose"), close: () => setOpenCorpora(false), children: corpora.map((corpus) => (_jsxs("div", { className: "item", onClick: () => handleChooseCorpus(corpus), children: [_jsx(AppPicture, { src: corpus.picture, title: corpus.name, className: "modal-corpus-image" }), _jsx("span", { children: corpus.name })] }, corpus.uid))) }))] }));
|
|
65
65
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tycho-components",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.14",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"react-hook-form": "^7.45.2",
|
|
52
52
|
"react-i18next": "^13.0.2",
|
|
53
53
|
"react-router-dom": "^6.14.2",
|
|
54
|
-
"tycho-storybook": "0.4.
|
|
54
|
+
"tycho-storybook": "0.4.12",
|
|
55
55
|
"yup": "^1.2.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|