Skip to content

Commit

Permalink
Using the reverse proxy env var to use a regular link or react-router…
Browse files Browse the repository at this point in the history
… for navigation
  • Loading branch information
EdwinGuzman committed May 6, 2024
1 parent 8ff0cf1 commit 8e3221b
Showing 1 changed file with 22 additions and 24 deletions.
46 changes: 22 additions & 24 deletions src/app/components/BibPage/BibDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -291,30 +291,28 @@ const BibDetails = (props) => {
router.push(`${appConfig.baseUrl}/search?${query}`);
};

return (
<DSLink dir={stringDirection(label, useParallels)}>
{/* In the reverse proxy state, we want to navigate to the page and
cause a refresh. Otherwise, we want to use react-router to
stay within the app. This is to work with the new
Research Catalog update. */}
{appConfig.reverseProxyEnabled ? (
<DSLink
key={label.trim().replace(/ /g, '')}
onClick={onClick}
href={`${appConfig.baseUrl}/search?${query}`}
>
{label}
</DSLink>
) : (
<Link
key={label.trim().replace(/ /g, '')}
onClick={onClick}
to={`${appConfig.baseUrl}/search?${query}`}
>
{label}
</Link>
)}
</DSLink>
// In the reverse proxy state, we want to navigate to the page and
// cause a refresh. Otherwise, we want to use react-router to
// stay within the app. This is to work with the new
// Research Catalog update.
return (appConfig.reverseProxyEnabled ? (
<DSLink
dir={stringDirection(label, useParallels)}
key={label.trim().replace(/ /g, '')}
href={`${appConfig.baseUrl}/search?${query}`}
>
{label}
</DSLink>
) : (
<Link
dir={stringDirection(label, useParallels)}
key={label.trim().replace(/ /g, '')}
onClick={onClick}
to={`${appConfig.baseUrl}/search?${query}`}
>
{label}
</Link>
)
);
};

Expand Down

0 comments on commit 8e3221b

Please sign in to comment.