diy-template-components 2.0.49 → 2.0.50
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/build/index.es.js +11 -1
- package/build/index.es.js.map +1 -1
- package/build/index.js +11 -1
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -1089,12 +1089,22 @@ function OptionList({
|
|
|
1089
1089
|
isPreview,
|
|
1090
1090
|
countryCode
|
|
1091
1091
|
} = React.useContext(PageContext);
|
|
1092
|
+
function checkIsActiveTab(slug = "") {
|
|
1093
|
+
if (typeof window !== "undefined") {
|
|
1094
|
+
const pathname = window.location.pathname;
|
|
1095
|
+
if (slug && pathname.includes(slug)) {
|
|
1096
|
+
return true;
|
|
1097
|
+
} else {
|
|
1098
|
+
return false;
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1092
1102
|
const tabsDataModifier = () => {
|
|
1093
1103
|
return optionsData?.map(dt => {
|
|
1094
1104
|
return {
|
|
1095
1105
|
value: dt.title,
|
|
1096
1106
|
link: dt.slug,
|
|
1097
|
-
active: dt.
|
|
1107
|
+
active: checkIsActiveTab(dt.slug),
|
|
1098
1108
|
isLink: true,
|
|
1099
1109
|
isExternal: 0
|
|
1100
1110
|
};
|