Skip to content

Commit

Permalink
feat: add API docs to the menu
Browse files Browse the repository at this point in the history
  • Loading branch information
vasyl-ivanchuk committed Nov 9, 2023
1 parent e97c6d8 commit f81bd94
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/app/src/components/header/TheHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ const blockExplorerLinks = reactive([
]);
const links = [
{
label: computed(() => t("header.nav.apiDocs")),
url: computed(() => `${currentNetwork.value.apiUrl}/docs`),
},
{
label: computed(() => t("header.nav.contractVerification")),
to: { name: "contract-verification" },
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@
"portal": "Portal",
"documentation": "Documentation",
"tools": "Tools",
"apiDocs": "API Documentation",
"contractVerification": "Smart Contract Verification",
"debugger": "zkEVM Debugger",
"bridge": "Bridge"
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/locales/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
"header": {
"nav": {
"tools": "Інструменти",
"apiDocs": "АРІ Документація",
"contractVerification": "Верифікація Смарт контракту",
"debugger": "zkEVM Налагоджувач",
"blockExplorer": "Провідник",
Expand Down
5 changes: 3 additions & 2 deletions packages/app/tests/components/TheHeader.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ vi.mock("@/composables/useContext", () => {
maintenance: maintenanceMock(),
l2WalletUrl: "https://portal.zksync.io/",
bridgeUrl: "https://bridge.zksync.io/",
apiUrl: "https://api-url",
})),
}),
};
Expand Down Expand Up @@ -57,9 +58,9 @@ describe("TheHeader:", () => {
await fireEvent.click(dropdown[1].find("button")!.element);
const toolsLinksRouter = dropdown[1].findAllComponents(RouterLinkStub);
const toolsLinks = dropdown[1].findAll("a");
expect(toolsLinks[0].attributes("href")).toBe("https://api-url/docs");
expect(toolsLinksRouter[0].props().to.name).toBe("contract-verification");
// expect(toolsLinksRouter[1].props().to.name).toBe("debugger");
expect(toolsLinks[1].attributes("href")).toBe("https://portal.zksync.io/");
expect(toolsLinks[2].attributes("href")).toBe("https://portal.zksync.io/");

expect(wrapper.findAll(".navigation-container > .navigation-link")[0].attributes("href")).toBe(
"https://era.zksync.io/docs/dev/"
Expand Down

0 comments on commit f81bd94

Please sign in to comment.