diff --git a/src/App/AppHeader/index.js b/src/App/AppHeader/index.js index 8561df231a..592b7eb7cd 100644 --- a/src/App/AppHeader/index.js +++ b/src/App/AppHeader/index.js @@ -6,15 +6,11 @@ import routes from "../routes/all"; import SearchBox from "../utils/SearchBox"; -import swedbankpayLogo from "@src/img/swedbankpay/logo/swedbankpay-logo-h.svg"; -import payexLogo from "@src/img/payex/logo/payex-logo.svg"; - -const brand = process.env.brand; -const devLogo = brand === "swedbankpay" ? swedbankpayLogo : payexLogo; -const isDev = process.env.version === "LOCAL_DEV"; - const basename = process.env.basename; +const brand = process.env.brand; +// feature toggle. Switch once we switch default to topbar v2 (and update rest of docs and code) +// other corresponding feature toggle for topbar at "src/App/utils/SelectPanel/index.js" const useTopbarLegacy = true; // mobile & tablet topbar and hamburger menu diff --git a/src/App/ComponentsDocumentation/components/Topbar/constants.js b/src/App/ComponentsDocumentation/components/Topbar/constants.js index 8dfe13fbda..191930391d 100644 --- a/src/App/ComponentsDocumentation/components/Topbar/constants.js +++ b/src/App/ComponentsDocumentation/components/Topbar/constants.js @@ -117,7 +117,6 @@ export const topbarShowcase = { title: "Desktop", description: (

- {/* TODO: mention it's legacy topbar and it all involve to use this in terms of breaking changes */} The minimum requirement in a Topbar is to include the Swedbank Pay Logotype, common additional functionality is a list with navigation links. On desktop use{" "} @@ -133,7 +132,6 @@ export const topbarShowcase = { description: ( <>

- {/* TODO: mention it's legacy topbar and it all involve to use this in terms of breaking changes */} The minimum requirement in a Topbar is to include the Swedbank Pay Logotype, common additional functionality is a list with navigation links. On smaller screens use a menu button to toggle a vertical @@ -155,11 +153,8 @@ export const topbarShowcase = { title: "Desktop", description: (

- The minimum requirement in a Topbar is to include the Swedbank Pay - Logotype, common additional functionality is a list with navigation - links. On desktop use{" "} - to show the links - listed horizontally in the topbar.{" "} + The experimental desktop topbar involves breaking changes. Make sure + to check them out before switching.

), }, @@ -169,19 +164,8 @@ export const topbarShowcase = { title: "Mobile/tablet", description: ( <> -

- The minimum requirement in a Topbar is to include the Swedbank Pay - Logotype, common additional functionality is a list with navigation - links. On smaller screens use a menu button to toggle a vertical - navigation drawer with links when the menu button is clicked. -

-

- Be aware; The {" "} - attribute for element {" "} - when it is active is set to 2500px. This is to ensure animation for - the transition to happen. You can easily alter this by creating - custom css. -

+ The experimental desktop topbar involves breaking changes. Make sure + to check them out before switching. ), }, diff --git a/src/App/ComponentsDocumentation/components/Topbar/topbar.e2e.spec.js b/src/App/ComponentsDocumentation/components/Topbar/topbar.e2e.spec.js index 9612da40a2..aacfcd08ca 100644 --- a/src/App/ComponentsDocumentation/components/Topbar/topbar.e2e.spec.js +++ b/src/App/ComponentsDocumentation/components/Topbar/topbar.e2e.spec.js @@ -8,9 +8,9 @@ test("Topbar page exist", async ({ page }) => { name: "Components Find all currently available components here", }) .click(); - await expect(page.getByRole("link", { name: "Topbar" })).toHaveCount( - page.viewportSize().width < 991 ? 1 : 2 - ); + await expect( + page.getByRole("link", { name: "Topbar", exact: true }) + ).toHaveCount(page.viewportSize().width < 991 ? 1 : 2); await page.getByText("call_to_actionTopbararrow_forward").click(); await expect(page).toHaveTitle(/Topbar/); await expect( diff --git a/src/App/ComponentsDocumentation/components/Topbar/topbar.e2e.spec.js-snapshots/SwedbankPay-topbar-desktop-closed-chromium-darwin.png b/src/App/ComponentsDocumentation/components/Topbar/topbar.e2e.spec.js-snapshots/SwedbankPay-topbar-desktop-closed-chromium-darwin.png deleted file mode 100644 index 60bc89d57a..0000000000 Binary files a/src/App/ComponentsDocumentation/components/Topbar/topbar.e2e.spec.js-snapshots/SwedbankPay-topbar-desktop-closed-chromium-darwin.png and /dev/null differ diff --git a/src/App/ComponentsDocumentation/components/Topbar/topbar.e2e.spec.js-snapshots/SwedbankPay-topbar-desktop-links-ui-feedbacks-chromium-darwin.png b/src/App/ComponentsDocumentation/components/Topbar/topbar.e2e.spec.js-snapshots/SwedbankPay-topbar-desktop-links-ui-feedbacks-chromium-darwin.png deleted file mode 100644 index 69fafd1398..0000000000 Binary files a/src/App/ComponentsDocumentation/components/Topbar/topbar.e2e.spec.js-snapshots/SwedbankPay-topbar-desktop-links-ui-feedbacks-chromium-darwin.png and /dev/null differ diff --git a/src/App/ComponentsDocumentation/components/Topbar/topbar.e2e.spec.js-snapshots/SwedbankPay-topbar-desktop-opened-chromium-darwin.png b/src/App/ComponentsDocumentation/components/Topbar/topbar.e2e.spec.js-snapshots/SwedbankPay-topbar-desktop-opened-chromium-darwin.png deleted file mode 100644 index 2ef4fee8ed..0000000000 Binary files a/src/App/ComponentsDocumentation/components/Topbar/topbar.e2e.spec.js-snapshots/SwedbankPay-topbar-desktop-opened-chromium-darwin.png and /dev/null differ diff --git a/src/App/ComponentsDocumentation/components/Topbar/topbar.e2e.spec.js-snapshots/SwedbankPay-topbar-legacy-mobile-opened-webkit-darwin.png b/src/App/ComponentsDocumentation/components/Topbar/topbar.e2e.spec.js-snapshots/SwedbankPay-topbar-legacy-mobile-opened-webkit-darwin.png index ab2736b89f..9cac506809 100644 Binary files a/src/App/ComponentsDocumentation/components/Topbar/topbar.e2e.spec.js-snapshots/SwedbankPay-topbar-legacy-mobile-opened-webkit-darwin.png and b/src/App/ComponentsDocumentation/components/Topbar/topbar.e2e.spec.js-snapshots/SwedbankPay-topbar-legacy-mobile-opened-webkit-darwin.png differ diff --git a/src/App/ComponentsDocumentation/components/Topbar/topbar.e2e.spec.js-snapshots/SwedbankPay-topbar-mobile-closed-chromium-darwin.png b/src/App/ComponentsDocumentation/components/Topbar/topbar.e2e.spec.js-snapshots/SwedbankPay-topbar-mobile-closed-chromium-darwin.png deleted file mode 100644 index f65abe708d..0000000000 Binary files a/src/App/ComponentsDocumentation/components/Topbar/topbar.e2e.spec.js-snapshots/SwedbankPay-topbar-mobile-closed-chromium-darwin.png and /dev/null differ diff --git a/src/App/ComponentsDocumentation/components/Topbar/topbar.e2e.spec.js-snapshots/SwedbankPay-topbar-mobile-opened-chromium-darwin.png b/src/App/ComponentsDocumentation/components/Topbar/topbar.e2e.spec.js-snapshots/SwedbankPay-topbar-mobile-opened-chromium-darwin.png deleted file mode 100644 index 7dd6c47b58..0000000000 Binary files a/src/App/ComponentsDocumentation/components/Topbar/topbar.e2e.spec.js-snapshots/SwedbankPay-topbar-mobile-opened-chromium-darwin.png and /dev/null differ diff --git a/src/App/ComponentsDocumentation/components/TopbarMigratingToV2/index.js b/src/App/ComponentsDocumentation/components/TopbarMigratingToV2/index.js index ce8e2ba06e..d1d70fd7af 100644 --- a/src/App/ComponentsDocumentation/components/TopbarMigratingToV2/index.js +++ b/src/App/ComponentsDocumentation/components/TopbarMigratingToV2/index.js @@ -1,5 +1,4 @@ -import React, { useEffect } from "react"; -import { Link } from "react-router-dom"; +import React from "react"; import { EditableComponentPreview, DocContainer } from "@docutils"; import CodeTags from "@components/CodeTags"; @@ -80,7 +79,8 @@ export const Migration = () => ( {"\n"}