Skip to content

Commit

Permalink
fix: nextprev logic with pathPrefix (#823)
Browse files Browse the repository at this point in the history
  • Loading branch information
vpicone authored Apr 24, 2020
1 parent 279bad4 commit 5099ba4
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ const useNavigationList = () => {
];
};

const getTabItems = ({ tabs, location }) => {
const { pathname } = location;
const currentPage = pathname.split('/');
const getTabItems = ({ tabs, hrefSegments }) => {
if (!tabs) {
return {
prevTabItem: null,
Expand All @@ -53,7 +51,7 @@ const getTabItems = ({ tabs, location }) => {
lower: true,
});
const currentTab =
currentPage.filter((item) => item === slug).toString() === slug;
hrefSegments.filter((item) => item === slug).toString() === slug;
return {
title,
slug,
Expand Down Expand Up @@ -116,7 +114,7 @@ const NextPreviousContainer = (props) => {

const { prevTabItem, nextTabItem } = getTabItems({
currentTitle,
location,
hrefSegments,
tabs,
});

Expand Down

1 comment on commit 5099ba4

@vercel
Copy link

@vercel vercel bot commented on 5099ba4 Apr 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.