Skip to content
This repository has been archived by the owner on Feb 2, 2025. It is now read-only.

Commit

Permalink
Getting help link to work
Browse files Browse the repository at this point in the history
  • Loading branch information
tjayrush committed Jan 9, 2023
1 parent 8058ee8 commit 9e6de65
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/ui/components/SidePanels/HelpPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@ export const HelpPanel = () => {

const url = useMemo(
() => {
if (!matchedRoute) { return 'https://docs.trueblocks.io/'; }
const parts = `docs/explorer${matchedRoute.path}`.split('/');
const ret = 'https://trueblocks.io/explorer/';
if (!matchedRoute) { return ret; }
const parts = `${matchedRoute.path}`.split('/');
const tag = parts.pop();
let rr = String(new URL(`${parts.join('/')}#${tag}`, ret));
rr = rr.replace('https://trueblocks.io/explorer/#', 'https://trueblocks.io/');
rr = rr.replace('https://trueblocks.io/', 'https://trueblocks.io/explorer/');
return (
String(new URL(`${parts.join('/')}#${tag}`, 'https://docs.trueblocks.io/'))
rr
);
},
[matchedRoute],
Expand Down

0 comments on commit 9e6de65

Please sign in to comment.