diff --git a/src/components/ItaliaTheme/View/CartellaModulisticaView/CartellaModulisticaView.jsx b/src/components/ItaliaTheme/View/CartellaModulisticaView/CartellaModulisticaView.jsx
index 153ffa96b..e8db7b74d 100644
--- a/src/components/ItaliaTheme/View/CartellaModulisticaView/CartellaModulisticaView.jsx
+++ b/src/components/ItaliaTheme/View/CartellaModulisticaView/CartellaModulisticaView.jsx
@@ -138,10 +138,12 @@ const CartellaModulisticaView = ({ content }) => {
);
} else {
@@ -150,6 +152,7 @@ const CartellaModulisticaView = ({ content }) => {
doc={doc}
key={doc['@id']}
searchableText={searchableText}
+ collapsable={!content.non_collassare_gli_elementi}
/>
);
}
@@ -165,12 +168,17 @@ const CartellaModulisticaView = ({ content }) => {
section.items ? section.items.filter(filterItemsFN) : []
}
searchableText={searchableText}
+ collapsable={!content.non_collassare_gli_elementi}
/>
) : (
{/*file,immagine,link*/}
-
+
);
})}
diff --git a/src/components/ItaliaTheme/View/CartellaModulisticaView/DocRow.jsx b/src/components/ItaliaTheme/View/CartellaModulisticaView/DocRow.jsx
index f85c1714f..806b5d62d 100644
--- a/src/components/ItaliaTheme/View/CartellaModulisticaView/DocRow.jsx
+++ b/src/components/ItaliaTheme/View/CartellaModulisticaView/DocRow.jsx
@@ -56,19 +56,21 @@ const Downloads = ({ item, titleDoc, filteredWords }) => {
);
};
-const DocRow = ({ doc, items, searchableText }) => {
+const DocRow = ({ doc, items, searchableText, collapsable }) => {
const filteredWords = searchableText.split(' ');
- const [itemOpen, setItemOpen] = useState(searchableText?.length > 0 ?? false);
+ const [itemOpen, setItemOpen] = useState(!collapsable);
useEffect(() => {
//se ho fatto una ricerca, espando l'elemento
- if (searchableText?.length > 0) {
- setItemOpen(true);
- } else {
- setItemOpen(false);
+ if (collapsable) {
+ if (searchableText?.length > 0) {
+ setItemOpen(true);
+ } else {
+ setItemOpen(false);
+ }
}
- }, [searchableText]);
+ }, [searchableText, collapsable]);
const titleWrapper = (
{
{titleWrapper}
-
+ {collapsable && (
+
+ )}