Open DilsonsPickles opened 12 months ago
Run locally the active nav link renders blue:
This doesn't appear to be happening in our staging environment.
function getUrlPath(url) { const parts = url.split("/"); return "/" + parts[parts.length - 1]; }
function renderNavLink(navLink, index) { return ( <a href={navLink.href} target={navLink.target} key={index} className={ getUrlPath(currentURL) === navLink.href ? "font-regular text-blue-700" : "font-regular text-gray-800 hover:text-blue-700" } > {navLink.linkText} </a> ); }
Add console.log to above code to check what getUrlPath is returning on staging
Run locally the active nav link renders blue:
This doesn't appear to be happening in our staging environment.
function getUrlPath(url) { const parts = url.split("/"); return "/" + parts[parts.length - 1]; }
Add console.log to above code to check what getUrlPath is returning on staging