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.es.js
CHANGED
|
@@ -1073,12 +1073,22 @@ function OptionList({
|
|
|
1073
1073
|
isPreview,
|
|
1074
1074
|
countryCode
|
|
1075
1075
|
} = useContext(PageContext);
|
|
1076
|
+
function checkIsActiveTab(slug = "") {
|
|
1077
|
+
if (typeof window !== "undefined") {
|
|
1078
|
+
const pathname = window.location.pathname;
|
|
1079
|
+
if (slug && pathname.includes(slug)) {
|
|
1080
|
+
return true;
|
|
1081
|
+
} else {
|
|
1082
|
+
return false;
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1076
1086
|
const tabsDataModifier = () => {
|
|
1077
1087
|
return optionsData?.map(dt => {
|
|
1078
1088
|
return {
|
|
1079
1089
|
value: dt.title,
|
|
1080
1090
|
link: dt.slug,
|
|
1081
|
-
active: dt.
|
|
1091
|
+
active: checkIsActiveTab(dt.slug),
|
|
1082
1092
|
isLink: true,
|
|
1083
1093
|
isExternal: 0
|
|
1084
1094
|
};
|