diy-template-components 2.0.49 → 2.0.51
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 +12 -1
- package/build/index.es.js.map +1 -1
- package/build/index.js +12 -1
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.es.js
CHANGED
|
@@ -1073,12 +1073,23 @@ 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
|
+
const slugFromPathname = pathname?.split('/')[1];
|
|
1080
|
+
if (slug && slugFromPathname.includes(slug)) {
|
|
1081
|
+
return true;
|
|
1082
|
+
} else {
|
|
1083
|
+
return false;
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1076
1087
|
const tabsDataModifier = () => {
|
|
1077
1088
|
return optionsData?.map(dt => {
|
|
1078
1089
|
return {
|
|
1079
1090
|
value: dt.title,
|
|
1080
1091
|
link: dt.slug,
|
|
1081
|
-
active: dt.
|
|
1092
|
+
active: checkIsActiveTab(dt.slug),
|
|
1082
1093
|
isLink: true,
|
|
1083
1094
|
isExternal: 0
|
|
1084
1095
|
};
|