@@ -131,16 +131,20 @@ const href = "#book-a-call-section";
131131 }
132132 </Menu >
133133 </li >
134- <li id =" book-a-call-container" class =" ml-auto pr-2" >
135- <a
136- data-navhidden =" true"
137- id =" book-a-call-action"
138- class =" invisible w-fit font-medium h-[39px] items-center px-4 py-2 rounded-md text-base text-center whitespace-nowrap bg-[#545664] text-[#ffffff] hover:opacity-90"
139- href ={ href }
140- >
141- Book a call
142- </a >
143- </li >
134+ {
135+ ! isBlogPage && (
136+ <li id = " book-a-call-container" class = " ml-auto pr-2" >
137+ <a
138+ data-navhidden = " true"
139+ id = " book-a-call-action"
140+ class = " invisible w-fit font-medium h-[39px] items-center px-4 py-2 rounded-md text-base text-center whitespace-nowrap bg-[#545664] text-[#ffffff] hover:opacity-90"
141+ href = { href }
142+ >
143+ Book a call
144+ </a >
145+ </li >
146+ )
147+ }
144148 </ul >
145149 <div class =" hidden md:inline-block" >
146150 <a
@@ -186,19 +190,23 @@ const href = "#book-a-call-section";
186190 ))
187191 }
188192 </div >
189- <a
190- data-navhidden =" true"
191- id =" mobile-book-a-call-action"
192- class =" w-full
193- font-medium h-[40px]
194- items-center px-4 py-2 rounded-md
195- text-base text-center
196- whitespace-nowrap
197- bg-[#545664] text-[#ffffff] hover:opacity-90"
198- href ={ href }
199- >
200- Book a call
201- </a >
193+ {
194+ ! isBlogPage && (
195+ <a
196+ data-navhidden = " true"
197+ id = " mobile-book-a-call-action"
198+ class = " w-full
199+ font-medium h-[40px]
200+ items-center px-4 py-2 rounded-md
201+ text-base text-center
202+ whitespace-nowrap
203+ bg-[#545664] text-[#ffffff] hover:opacity-90"
204+ href = { href }
205+ >
206+ Book a call
207+ </a >
208+ )
209+ }
202210 <a
203211 class =" font-medium
204212 w-full !h-[40px] items-center px-4 py-2 rounded-md mb-5 md:mb-0
@@ -239,21 +247,26 @@ const href = "#book-a-call-section";
239247
240248 const isBlogPage = window.location.pathname.startsWith("/blog");
241249
250+ const hasBookACall = !!bookACallAction && !!containerElement;
251+
242252 mm.add("(width >= 768px)", () => {
243- if (!navBar || !bookACallAction ) return;
253+ if (!navBar) return;
244254
245255 const navHideItems = [forCtoElem, blogElem, logoElem, caseStudyElem];
246256
247257 gsap.set(navBar, { width: NAV_EXPAND_WIDTH, overwrite: false });
248258 gsap.set(navHideItems, {
249259 autoAlpha: 1,
250260 });
251- gsap.set(containerElement, { autoAlpha: 0 });
252- gsap.set(bookACallAction, {
253- autoAlpha: 0,
254- overflow: "hidden",
255- display: "none",
256- });
261+
262+ if (hasBookACall) {
263+ gsap.set(containerElement, { autoAlpha: 0 });
264+ gsap.set(bookACallAction, {
265+ autoAlpha: 0,
266+ overflow: "hidden",
267+ display: "none",
268+ });
269+ }
257270
258271 if (isBlogPage) return;
259272
@@ -305,13 +318,7 @@ const href = "#book-a-call-section";
305318 });
306319
307320 mm.add("(width < 768px)", () => {
308- if (
309- !navMenuToggle ||
310- !mobileList ||
311- !mobileContact ||
312- !mobileBookACallAction
313- )
314- return;
321+ if (!navMenuToggle || !mobileList || !mobileContact) return;
315322
316323 gsap.set(mobileList, {
317324 height: 0,
@@ -346,13 +353,19 @@ const href = "#book-a-call-section";
346353 tlBurger.reverse();
347354 navMenuToggle.setAttribute("aria-expanded", "false");
348355 };
349-
350- mobileBookACallAction.addEventListener("click", handleBookACallClick);
356+ if (mobileBookACallAction) {
357+ mobileBookACallAction.addEventListener("click", handleBookACallClick);
358+ }
351359 navMenuToggle.addEventListener("click", handleBurgerClick);
352360
353361 return () => {
354362 navMenuToggle.removeEventListener("click", handleBurgerClick);
355- mobileBookACallAction.removeEventListener("click", handleBookACallClick);
363+ if (mobileBookACallAction) {
364+ mobileBookACallAction.removeEventListener(
365+ "click",
366+ handleBookACallClick,
367+ );
368+ }
356369
357370 gsap.killTweensOf([
358371 mobileList,
0 commit comments