diff --git a/src/App/AppHeader/index.js b/src/App/AppHeader/index.js
index 75eab289d5..585d689a83 100644
--- a/src/App/AppHeader/index.js
+++ b/src/App/AppHeader/index.js
@@ -71,7 +71,7 @@ const AppHeader = () => (
topbarContent={menu}
wide="xl"
logout
- id="demo-topbar"
+ id="app-topbar"
sticky={false}
/>
diff --git a/src/App/ComponentsDocumentation/components/Topbar/constants.js b/src/App/ComponentsDocumentation/components/Topbar/constants.js
index 7b27b75bb3..5d53696f8d 100644
--- a/src/App/ComponentsDocumentation/components/Topbar/constants.js
+++ b/src/App/ComponentsDocumentation/components/Topbar/constants.js
@@ -1,5 +1,6 @@
-import React from "react";
+import React, { useEffect } from "react";
import TopbarComponent from "@components/Topbar";
+import { topbar } from "@src/scripts/main";
import CodeTags from "@components/CodeTags";
@@ -64,18 +65,46 @@ export const menu = {
],
};
-const Topbar = ({ sticky, wide, logout }) => (
-
-
-
-
-);
+const menuLegacy = {
+ btn: {
+ name: "Menu",
+ icon: "menu",
+ },
+ items: [
+ {
+ name: "Home",
+ icon: "home",
+ },
+ {
+ name: "Purchases",
+ icon: "shopping_cart",
+ },
+ {
+ name: "Settings",
+ icon: "settings",
+ },
+ ],
+};
+
+const Topbar = ({ sticky, wide, logout, legacy }) => {
+ useEffect(() => {
+ topbar.init();
+ }, [legacy]);
+
+ return (
+
+
+
+
+ );
+};
export const topbarShowcase = {
id: "overviewTopbar",
@@ -118,5 +147,43 @@ export const topbarShowcase = {
>
),
},
+ {
+ tab: "⚠️ Legacy Desktop",
+ component: ,
+ 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{" "}
+ to show the links
+ listed horizontally in the topbar.{" "}
+
+ ),
+ },
+ {
+ tab: "⚠️ Legacy Mobile/tablet",
+ component: ,
+ title: "Mobile/tablet",
+ 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
+ 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.
+
+ >
+ ),
+ },
],
};
diff --git a/src/App/components/Topbar/index.js b/src/App/components/Topbar/index.js
index b9bc37efa8..82306c00f7 100644
--- a/src/App/components/Topbar/index.js
+++ b/src/App/components/Topbar/index.js
@@ -1,6 +1,7 @@
import React, { Fragment } from "react";
import PropTypes from "prop-types";
-import swedbankpayLogo from "@src/img/swedbankpay/logo/swedbankpay-logo-h.svg";
+import swedbankpayLogoHorizontal from "@src/img/swedbankpay/logo/swedbankpay-logo-h.svg";
+import swedbankpayLogoVertical from "@src/img/swedbankpay/logo/swedbankpay-logo-v.svg";
import payexLogo from "@src/img/payex/logo/payex-logo.svg";
import SidebarComponent from "@components/Sidebar";
@@ -9,28 +10,44 @@ import ButtonComponent from "@components/Button";
const brand = process.env.brand;
-const devLogo = brand === "swedbankpay" ? swedbankpayLogo : payexLogo;
-
const isDev = process.env.version === "LOCAL_DEV";
+const getDevLogo = (legacy) => {
+ if (brand === "swedbankpay" && !legacy) {
+ return swedbankpayLogoHorizontal;
+ } else if (brand === "swedbankpay" && legacy) {
+ return swedbankpayLogoVertical;
+ } else {
+ return payexLogo;
+ }
+};
-const TopbarBtn = () => (
- <>
-
- {"\n\t\t"}
- menu
- {"\n\t\t"}
-
- >
-);
+const TopbarBtn = ({ legacy = false }) => {
+ return (
+ <>
+
+ {"\n\t\t"}
+ menu
+ {"\n\t\t"}
+
+ {legacy && (
+
+ {"\n"}
+ close
+ {"\n\t\t"}
+
+ )}
+ >
+ );
+};
-const TopbarMenu = ({ menu, logout, sidebar }) => {
+const TopbarMenu = ({ menu, logout, sidebar, legacy }) => {
const { items } = menu;
return (
@@ -58,7 +75,7 @@ const TopbarMenu = ({ menu, logout, sidebar }) => {
))}
{"\n"}
- {logout ? : null}
+ {logout ? legacy ? : : null}
);
@@ -74,7 +91,24 @@ const TopbarLogout = () => (
/>
);
-const TopbarLogo = ({ png }) => (
+const TopbarLogoutLegacy = () => (
+ <>
+ e.preventDefault()}
+ >
+ {"\n"}
+ exit_to_app
+ {"\n"}
+ Log out
+ {"\n"}
+
+ {"\n"}
+ >
+);
+
+const TopbarLogo = ({ png, legacy }) => (
<>
(
{brand === "swedbankpay" && png ? (
) : (
)}
{"\n"}
@@ -110,22 +152,46 @@ const TopbarLogo = ({ png }) => (
>
);
-const Topbar = ({ topbarContent, wide, logout, id, png, sticky, sidebar }) => (
+const Topbar = ({
+ topbarContent,
+ wide,
+ logout,
+ id,
+ png,
+ sticky,
+ sidebar,
+ legacy = false,
+}) => (