Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add menu desktop styles

Krzysztof Bialoglowiczc7d38aef35cf
diff --git a/saleor/static/dashboard-next/components/AppLayout/AppLayout.tsx b/saleor/static/dashboard-next/components/AppLayout/AppLayout.tsx
index 9552a37644..1fadef4d07 100644
--- a/saleor/static/dashboard-next/components/AppLayout/AppLayout.tsx
+++ b/saleor/static/dashboard-next/components/AppLayout/AppLayout.tsx
@@ -21,14 +21,15 @@ import AppProgressProvider from "@saleor/components/AppProgress";
import useNavigator from "@saleor/hooks/useNavigator";
import useTheme from "@saleor/hooks/useTheme";
import useUser from "@saleor/hooks/useUser";
+import saleorDarkLogoSmall from "../../../images/logo-dark-small.svg";
import saleorDarkLogo from "../../../images/logo-dark.svg";
-import saleorLightLogo from "../../../images/logo-light.svg";
+import menuArrowIcon from "../../../images/menu-arrow-icon.svg";
import i18n from "../../i18n";
import ArrowDropdown from "../../icons/ArrowDropdown";
import Container from "../Container";
import AppActionContext from "./AppActionContext";
import AppHeaderContext from "./AppHeaderContext";
-import { appLoaderHeight, drawerWidth } from "./consts";
+import { appLoaderHeight, drawerWidth, drawerWidthSmall } from "./consts";
import MenuList from "./MenuList";
import menuStructure from "./menuStructure";
import ResponsiveDrawer from "./ResponsiveDrawer";
@@ -51,9 +52,13 @@ const styles = (theme: Theme) =>
transition: theme.transitions.duration.standard + "ms"
},
content: {
- display: "flex",
- flexDirection: "column",
- minHeight: `calc(100vh - ${appLoaderHeight}px)`
+ paddingLeft: drawerWidth,
+ position: "absolute",
+ transition: "padding-left 0.5s ease",
+ width: "100%"
+ },
+ contentToggle: {
+ paddingLeft: drawerWidthSmall
},
darkThemeSwitch: {
marginRight: theme.spacing.unit * 2
@@ -69,18 +74,23 @@ const styles = (theme: Theme) =>
},
logo: {
"& svg": {
- height: "100%"
+ height: "100%",
+ margin: "20px 50px"
},
+ background: "#21125E",
display: "block",
- height: 28
+ height: 80
+ },
+ logoSmall: {
+ "& svg": {
+ margin: "0px 25px"
+ }
},
menu: {
- marginTop: theme.spacing.unit * 4
+ background: "#fff",
+ padding: 25
},
menuIcon: {
- [theme.breakpoints.up("md")]: {
- display: "none"
- },
"& span": {
"&:nth-child(1)": {
top: 15
@@ -101,6 +111,9 @@ const styles = (theme: Theme) =>
transition: ".25s ease-in-out",
width: "60%"
},
+ [theme.breakpoints.up("md")]: {
+ display: "none"
+ },
background: theme.palette.background.paper,
borderRadius: "50%",
cursor: "pointer",
@@ -135,15 +148,38 @@ const styles = (theme: Theme) =>
position: "absolute",
zIndex: 1999
},
+ menuSmall: {
+ background: "#fff",
+ padding: "0 25px"
+ },
+ menuToggle: {
+ "& span": {
+ margin: "0 8px"
+ },
+ "& svg": {
+ marginTop: 12,
+ transform: "rotate(180deg)"
+ },
+ background: "#fff",
+ borderRadius: "50%",
+ cursor: "pointer",
+ height: 32,
+ position: "absolute",
+ right: -16,
+ top: 65,
+ width: 32,
+ zIndex: 99
+ },
+ menuToggleHide: {
+ "& svg": {
+ transform: "rotate(0deg)"
+ }
+ },
popover: {
zIndex: 1
},
root: {
- [theme.breakpoints.down("sm")]: {
- gridTemplateColumns: "1fr"
- },
- display: "grid",
- gridTemplateColumns: `${drawerWidth}px 1fr`
+ width: `100%`
},
rotate: {
transform: "rotate(180deg)"
@@ -153,7 +189,7 @@ const styles = (theme: Theme) =>
padding: 0
},
background: theme.palette.background.paper,
- padding: `${theme.spacing.unit * 2}px ${theme.spacing.unit * 4}px`
+ padding: `0 ${theme.spacing.unit * 4}px`
},
spacer: {
flex: 1
@@ -202,6 +238,7 @@ const AppLayout = withStyles(styles, {
const { isDark, toggleTheme } = useTheme();
const [isDrawerOpened, setDrawerState] = React.useState(false);
const [isMenuOpened, setMenuState] = React.useState(false);
+ const [menuToggle, setMenuToggle] = React.useState(false);
const appActionAnchor = React.useRef<HTMLDivElement>();
const appHeaderAnchor = React.useRef<HTMLDivElement>();
const anchor = React.useRef<HTMLDivElement>();
@@ -223,6 +260,10 @@ const AppLayout = withStyles(styles, {
navigate(url);
};
+ const handleMenuToggle = () => {
+ setMenuToggle(!menuToggle);
+ };
+
return (
<AppProgressProvider>
{({ isProgress }) => (
@@ -239,14 +280,33 @@ const AppLayout = withStyles(styles, {
<ResponsiveDrawer
onClose={() => setDrawerState(false)}
open={isDrawerOpened}
+ small={!menuToggle}
>
- <SVG
- className={classes.logo}
- src={isDark ? saleorDarkLogo : saleorLightLogo}
- />
+ <div
+ className={classNames(classes.logo, {
+ [classes.logoSmall]: menuToggle
+ })}
+ >
+ <SVG
+ src={
+ menuToggle ? saleorDarkLogoSmall : saleorDarkLogo
+ }
+ />
+ </div>
+ <div
+ className={classNames(classes.menuToggle, {
+ [classes.menuToggleHide]: menuToggle
+ })}
+ onClick={handleMenuToggle}
+ >
+ <SVG src={menuArrowIcon} />
+ </div>
<MenuList
- className={classes.menu}
+ className={
+ menuToggle ? classes.menuSmall : classes.menu
+ }
menuItems={menuStructure}
+ menuToggle={!menuToggle}
location={location.pathname}
user={user}
renderConfigure={true}
@@ -254,7 +314,11 @@ const AppLayout = withStyles(styles, {
/>
</ResponsiveDrawer>
</div>
- <div className={classes.content}>
+ <div
+ className={classNames(classes.content, {
+ [classes.contentToggle]: menuToggle
+ })}
+ >
<div>
<Container>
<div className={classes.header}>
diff --git a/saleor/static/dashboard-next/components/AppLayout/MenuList.tsx b/saleor/static/dashboard-next/components/AppLayout/MenuList.tsx
index 5183aa9155..2cc9a36715 100644
--- a/saleor/static/dashboard-next/components/AppLayout/MenuList.tsx
+++ b/saleor/static/dashboard-next/components/AppLayout/MenuList.tsx
@@ -7,14 +7,15 @@ import {
import Typography from "@material-ui/core/Typography";
import classNames from "classnames";
import React from "react";
-import { matchPath } from "react-router";
import SVG from "react-inlinesvg";
+import { matchPath } from "react-router";
import { User } from "../../auth/types/User";
import { configurationMenu, configurationMenuUrl } from "../../configuration";
import i18n from "../../i18n";
import { createHref } from "../../misc";
import { orderDraftListUrl, orderListUrl } from "../../orders/urls";
+import { drawerWidth, drawerWidthSmall } from "./consts";
import MenuNested from "./MenuNested";
import { IMenuItem } from "./menuStructure";
@@ -23,13 +24,13 @@ import configureIcon from "../../../images/menu-configure-icon.svg";
const styles = (theme: Theme) =>
createStyles({
menuIcon: {
+ "& svg": {
+ height: 32,
+ width: 32
+ },
display: "inline-block",
position: "relative",
- top: 8,
- "& svg": {
- width: 32,
- height: 32
- }
+ top: 8
},
menuList: {
display: "flex",
@@ -40,10 +41,17 @@ const styles = (theme: Theme) =>
paddingBottom: theme.spacing.unit * 3
},
menuListItem: {
+ "& path": {
+ transition: "fill 0.5s ease"
+ },
"&:hover": {
+ "& path": {
+ fill: theme.palette.primary.main
+ },
color: theme.palette.primary.main
},
alignItems: "center",
+ cursor: "pointer",
display: "block",
marginTop: theme.spacing.unit * 2,
paddingLeft: 0,
@@ -51,6 +59,13 @@ const styles = (theme: Theme) =>
transition: theme.transitions.duration.standard + "ms"
},
menuListItemActive: {
+ "& $menuListItemText": {
+ color: theme.palette.primary.main
+ },
+ "& path": {
+ color: theme.palette.primary.main,
+ fill: theme.palette.primary.main
+ },
"&:before": {
background: theme.palette.primary.main,
content: "''",
@@ -58,8 +73,10 @@ const styles = (theme: Theme) =>
left: -32,
position: "absolute",
width: 5
- },
- position: "relative"
+ }
+ },
+ menuListItemSmall: {
+ marginTop: theme.spacing.unit * 3.5
},
menuListItemText: {
"&:hover": {
@@ -77,116 +94,235 @@ const styles = (theme: Theme) =>
"& $menuListItemActive": {
"& $menuListItemText": {
color: theme.palette.primary.main
- },
- "&:before": {
- borderRadius: "100%",
- height: 8,
- marginLeft: 9,
- marginTop: 7,
- width: 8
}
},
"& $menuListItemText": {
textTransform: "none"
},
- marginLeft: theme.spacing.unit * 3
+ background: "#fff",
+ height: "100vh",
+ position: "absolute",
+ right: 0,
+ top: 0,
+ transition: "right 1s ease",
+ width: 300,
+ zIndex: -1
+ },
+ menuListNestedHide: {
+ opacity: 0
+ },
+ menuListNestedItem: {
+ "&:hover": {
+ "& p": {
+ color: theme.palette.primary.main
+ }
+ },
+ display: "block",
+ padding: "0px 30px",
+ textDecoration: "none"
+ },
+ menuListNestedOpen: {
+ right: -300,
+ zIndex: -1
+ },
+ subMenu: {
+ padding: "0 15px"
+ },
+ subMenuDrawer: {
+ background: "#000",
+ cursor: "pointer",
+ height: "100vh",
+ left: drawerWidth,
+ opacity: 0.2,
+ position: "absolute",
+ top: 0,
+ width: 0,
+ zIndex: -2
+ },
+ subMenuDrawerOpen: {
+ "&$subMenuDrawerSmall": {
+ left: drawerWidthSmall,
+ width: `calc(100vw - ${drawerWidthSmall})px`
+ },
+ width: `calc(100vw - ${drawerWidth}px)`
+ },
+ subMenuDrawerSmall: {
+ left: drawerWidthSmall,
+ width: `calc(100vw - ${drawerWidthSmall})px`
+ },
+ subheader: {
+ borderBottom: "solid 1px #EAEAEA",
+ margin: "30px",
+ paddingBottom: 20
}
});
interface MenuListProps {
className?: string;
menuItems: IMenuItem[];
+ menuToggle: boolean;
location: string;
user: User;
renderConfigure: boolean;
onMenuItemClick: (url: string, event: React.MouseEvent<any>) => void;
}
+
+export interface IActiveSubMenu {
+ isActive: boolean;
+ label: string;
+}
+
const MenuList = withStyles(styles, { name: "MenuList" })(
({
classes,
className,
menuItems,
+ menuToggle,
location,
user,
renderConfigure,
onMenuItemClick
- }: MenuListProps & WithStyles<typeof styles>) => (
- <div className={className}>
- {/* FIXME: this .split("?")[0] looks gross */}
- {menuItems.map(menuItem => {
- const isActive = (menuItem: IMenuItem) =>
- location.split("?")[0] === orderDraftListUrl().split("?")[0] &&
- menuItem.url.split("?")[0] === orderListUrl().split("?")[0]
- ? false
- : !!matchPath(location.split("?")[0], {
- exact: menuItem.url.split("?")[0] === "/",
- path: menuItem.url.split("?")[0]
- });
+ }: MenuListProps & WithStyles<typeof styles>) => {
+ const [activeSubMenu, setActiveSubMenu] = React.useState<IActiveSubMenu>({
+ isActive: false,
+ label: ""
+ });
- if (
- menuItem.permission &&
- !user.permissions.map(perm => perm.code).includes(menuItem.permission)
- ) {
- return null;
- }
+ const handleSubMenu = itemLabel => {
+ setActiveSubMenu({
+ isActive:
+ itemLabel === activeSubMenu.label ? !activeSubMenu.isActive : true,
+ label: itemLabel
+ });
+ };
- if (!menuItem.url) {
- const isAnyChildActive = menuItem.children.reduce(
- (acc, child) => acc || isActive(child),
- false
- );
+ const closeSubMenu = (menuItemUrl, event) => {
+ setActiveSubMenu({
+ isActive: false,
+ label: ""
+ });
+ if (menuItemUrl && event) {
+ onMenuItemClick(menuItemUrl, event);
+ event.stopPropagation();
+ event.preventDefault();
+ }
+ };
+
+ return (
+ <div className={className}>
+ {/* FIXME: this .split("?")[0] looks gross */}
+ {menuItems.map(menuItem => {
+ const isActive = (menuItem: IMenuItem) =>
+ location.split("?")[0] === orderDraftListUrl().split("?")[0] &&
+ menuItem.url.split("?")[0] === orderListUrl().split("?")[0]
+ ? false
+ : !!matchPath(location.split("?")[0], {
+ exact: menuItem.url.split("?")[0] === "/",
+ path: menuItem.url.split("?")[0]
+ });
+
+ if (
+ menuItem.permission &&
+ !user.permissions
+ .map(perm => perm.code)
+ .includes(menuItem.permission)
+ ) {
+ return null;
+ }
+
+ if (!menuItem.url) {
+ const isAnyChildActive = menuItem.children.reduce(
+ (acc, child) => acc || isActive(child),
+ false
+ );
+
+ return (
+ <div
+ className={classNames(classes.menuListItem, {
+ [classes.menuListItemSmall]: !menuToggle,
+ [classes.menuListItemActive]: isAnyChildActive
+ })}
+ >
+ <div onClick={() => handleSubMenu(menuItem.ariaLabel)}>
+ <SVG className={classes.menuIcon} src={menuItem.icon} />
+ {menuToggle && (
+ <Typography
+ aria-label={menuItem.ariaLabel}
+ className={classes.menuListItemText}
+ >
+ {menuItem.label}
+ </Typography>
+ )}
+ </div>
+ <MenuNested
+ activeItem={activeSubMenu}
+ classes={classes}
+ closeSubMenu={setActiveSubMenu}
+ menuItem={menuItem}
+ onMenuItemClick={onMenuItemClick}
+ handleSubMenu={handleSubMenu}
+ title={menuItem.label}
+ ariaLabel={menuItem.ariaLabel}
+ />
+ <div
+ onClick={event => closeSubMenu(null, event)}
+ className={classNames(classes.subMenuDrawer, {
+ [classes.subMenuDrawerOpen]: activeSubMenu.isActive,
+ [classes.subMenuDrawerSmall]: !menuToggle
+ })}
+ />
+ </div>
+ );
+ }
return (
- <MenuNested
- classes={classes}
- isAnyChildActive={isAnyChildActive}
- location={location}
- menuItem={menuItem}
- onMenuItemClick={onMenuItemClick}
- user={user}
+ <a
+ className={classNames(classes.menuListItem, {
+ [classes.menuListItemSmall]: !menuToggle,
+ [classes.menuListItemActive]: isActive(menuItem)
+ })}
+ href={createHref(menuItem.url)}
+ onClick={event => closeSubMenu(menuItem.url, event)}
key={menuItem.label}
- />
- );
- }
-
- return (
- <a
- className={classNames(classes.menuListItem, {
- [classes.menuListItemActive]: isActive(menuItem)
- })}
- href={createHref(menuItem.url)}
- onClick={event => onMenuItemClick(menuItem.url, event)}
- key={menuItem.label}
- >
- <SVG className={classes.menuIcon} src={menuItem.icon} />
- <Typography
- aria-label={menuItem.ariaLabel}
- className={classes.menuListItemText}
>
- {menuItem.label}
- </Typography>
- </a>
- );
- })}
- {renderConfigure &&
- configurationMenu.filter(menuItem =>
- user.permissions.map(perm => perm.code).includes(menuItem.permission)
- ).length > 0 && (
- <a
- className={classes.menuListItem}
- href={createHref(configurationMenuUrl)}
- onClick={event => onMenuItemClick(configurationMenuUrl, event)}
- >
- <SVG className={classes.menuIcon} src={configureIcon} />
- <Typography
- aria-label="configure"
- className={classes.menuListItemText}
+ <SVG className={classes.menuIcon} src={menuItem.icon} />
+ {menuToggle && (
+ <Typography
+ aria-label={menuItem.ariaLabel}
+ className={classes.menuListItemText}
+ >
+ {menuItem.label}
+ </Typography>
+ )}
+ </a>
+ );
+ })}
+ {renderConfigure &&
+ configurationMenu.filter(menuItem =>
+ user.permissions
+ .map(perm => perm.code)
+ .includes(menuItem.permission)
+ ).length > 0 && (
+ <a
+ className={classNames(classes.menuListItem, {
+ [classes.menuListItemSmall]: !menuToggle
+ })}
+ href={createHref(configurationMenuUrl)}
+ onClick={event => onMenuItemClick(configurationMenuUrl, event)}
>
- {i18n.t("Configure")}
- </Typography>
- </a>
- )}
- </div>
- )
+ <SVG className={classes.menuIcon} src={configureIcon} />
+ {menuToggle && (
+ <Typography
+ aria-label="configure"
+ className={classes.menuListItemText}
+ >
+ {i18n.t("Configure")}
+ </Typography>
+ )}
+ </a>
+ )}
+ </div>
+ );
+ }
);
export default MenuList;
diff --git a/saleor/static/dashboard-next/components/AppLayout/MenuNested.tsx b/saleor/static/dashboard-next/components/AppLayout/MenuNested.tsx
index cfdbbeda0d..b666dbe51e 100644
--- a/saleor/static/dashboard-next/components/AppLayout/MenuNested.tsx
+++ b/saleor/static/dashboard-next/components/AppLayout/MenuNested.tsx
@@ -3,62 +3,76 @@ import classNames from "classnames";
import React from "react";
import SVG from "react-inlinesvg";
-import { User } from "../../auth/types/User";
-import MenuList from "./MenuList";
+import { createHref } from "../../misc";
+import { IActiveSubMenu } from "./MenuList";
import { IMenuItem } from "./menuStructure";
export interface MenuNestedProps {
+ activeItem: IActiveSubMenu;
+ ariaLabel: string;
classes: Record<
| "menuIcon"
| "menuListItem"
| "menuListItemActive"
| "menuListItemText"
- | "menuListNested",
+ | "menuListNested"
+ | "menuListNestedItem"
+ | "menuListNestedOpen"
+ | "subheader",
string
>;
- isAnyChildActive: boolean;
+ closeSubMenu: ({}) => void;
menuItem: IMenuItem;
- location: string;
- user: User;
+ title: string;
+ handleSubMenu: (itemLabel: string) => void;
onMenuItemClick: (url: string, event: React.MouseEvent<any>) => void;
}
const MenuNested: React.FC<MenuNestedProps> = ({
+ activeItem,
+ ariaLabel,
classes,
- isAnyChildActive,
- location,
+ closeSubMenu,
menuItem,
onMenuItemClick,
- user
+ title
}) => {
- const [isOpened, setOpenStatus] = React.useState(false);
-
+ const menuItems = menuItem.children;
+ const closeMenu = (menuItemUrl, event) => {
+ onMenuItemClick(menuItemUrl, event);
+ closeSubMenu({
+ isActive: false,
+ label: ""
+ });
+ event.stopPropagation();
+ event.preventDefault();
+ };
return (
- <div
- onClick={() => setOpenStatus(!isOpened)}
- className={classNames(classes.menuListItem, {
- [classes.menuListItemActive]: isAnyChildActive
- })}
- >
- <SVG className={classes.menuIcon} src={menuItem.icon} />
- <Typography
- aria-label={menuItem.ariaLabel}
- className={classes.menuListItemText}
+ <>
+ <div
+ className={classNames(classes.menuListNested, {
+ [classes.menuListNestedOpen]:
+ activeItem.label === ariaLabel && activeItem.isActive
+ })}
>
- {menuItem.label}
- </Typography>
- {isOpened && (
- <div className={classes.menuListNested}>
- <MenuList
- menuItems={menuItem.children}
- location={location}
- user={user}
- renderConfigure={false}
- onMenuItemClick={onMenuItemClick}
- />
- </div>
- )}
- </div>
+ <Typography className={classes.subheader} variant="h5">
+ {title}
+ </Typography>
+ {menuItems.map(item => {
+ return (
+ <a
+ className={classNames(classes.menuListNestedItem)}
+ href={createHref(item.url)}
+ onClick={event => closeMenu(item.url, event)}
+ key={item.label}
+ >
+ <SVG className={classes.menuIcon} src={item.icon} />
+ <Typography aria-label={item.ariaLabel}>{item.label}</Typography>
+ </a>
+ );
+ })}
+ </div>
+ </>
);
};
export default MenuNested;
diff --git a/saleor/static/dashboard-next/components/AppLayout/ResponsiveDrawer.tsx b/saleor/static/dashboard-next/components/AppLayout/ResponsiveDrawer.tsx
index 49fac57c12..bc55029397 100644
--- a/saleor/static/dashboard-next/components/AppLayout/ResponsiveDrawer.tsx
+++ b/saleor/static/dashboard-next/components/AppLayout/ResponsiveDrawer.tsx
@@ -7,7 +7,7 @@ import {
WithStyles
} from "@material-ui/core/styles";
import React from "react";
-import { drawerWidth } from "./consts";
+import { drawerWidth, drawerWidthSmall } from "./consts";
const styles = (theme: Theme) =>
createStyles({
@@ -15,31 +15,38 @@ const styles = (theme: Theme) =>
backgroundColor: theme.palette.background.paper,
border: "none",
height: "100vh",
- padding: `${theme.spacing.unit * 2}px ${theme.spacing.unit * 4}px`,
+ overflow: "visible",
+ padding: 0,
position: "fixed" as "fixed",
+ transition: "width 0.5s ease",
width: drawerWidth
},
+ drawerDesktopSmall: {
+ overflow: "visible",
+ width: drawerWidthSmall
+ },
drawerMobile: {
padding: `${theme.spacing.unit * 2}px ${theme.spacing.unit * 4}px`,
- width: drawerWidth,
+ width: drawerWidth
}
});
interface ResponsiveDrawerProps extends WithStyles<typeof styles> {
children?: React.ReactNode;
open: boolean;
+ small: boolean;
onClose?();
}
const ResponsiveDrawer = withStyles(styles, { name: "ResponsiveDrawer" })(
- ({ children, classes, onClose, open }: ResponsiveDrawerProps) => (
+ ({ children, classes, onClose, open, small }: ResponsiveDrawerProps) => (
<>
<Hidden smDown>
<Drawer
variant="persistent"
open
classes={{
- paper: classes.drawerDesktop
+ paper: small ? classes.drawerDesktop : classes.drawerDesktopSmall
}}
>
{children}
diff --git a/saleor/static/dashboard-next/components/AppLayout/consts.ts b/saleor/static/dashboard-next/components/AppLayout/consts.ts
index eb1ecfeef7..5052c7b568 100644
--- a/saleor/static/dashboard-next/components/AppLayout/consts.ts
+++ b/saleor/static/dashboard-next/components/AppLayout/consts.ts
@@ -1,3 +1,4 @@
export const drawerWidth = 256;
+export const drawerWidthSmall = 80;
export const navigationBarHeight = 64;
export const appLoaderHeight = 4;
diff --git a/saleor/static/dashboard-next/components/AppLayout/menuStructure.ts b/saleor/static/dashboard-next/components/AppLayout/menuStructure.ts
index 9f4d946564..64c14cd740 100644
--- a/saleor/static/dashboard-next/components/AppLayout/menuStructure.ts
+++ b/saleor/static/dashboard-next/components/AppLayout/menuStructure.ts
@@ -1,4 +1,3 @@
-import { configure } from "enzyme";
import { categoryListUrl } from "../../categories/urls";
import { collectionListUrl } from "../../collections/urls";
import { customerListUrl } from "../../customers/urls";
@@ -9,11 +8,11 @@ import { productListUrl } from "../../products/urls";
import { languageListUrl } from "../../translations/urls";
import { PermissionEnum } from "../../types/globalTypes";
-import homeIcon from "../../../images/menu-home-icon.svg";
import catalogIcon from "../../../images/menu-catalog-icon.svg";
-import ordersIcon from "../../../images/menu-orders-icon.svg";
import customerIcon from "../../../images/menu-customers-icon.svg";
import discountsIcon from "../../../images/menu-discounts-icon.svg";
+import homeIcon from "../../../images/menu-home-icon.svg";
+import ordersIcon from "../../../images/menu-orders-icon.svg";
import translationIcon from "../../../images/menu-translation-icon.svg";
export interface IMenuItem {
@@ -34,7 +33,6 @@ const menuStructure: IMenuItem[] = [
},
{
ariaLabel: "catalogue",
- icon: catalogIcon,
children: [
{
ariaLabel: "products",
@@ -52,12 +50,12 @@ const menuStructure: IMenuItem[] = [
url: collectionListUrl()
}
],
+ icon: catalogIcon,
label: i18n.t("Catalog", { context: "Menu label" }),
permission: PermissionEnum.MANAGE_PRODUCTS
},
{
ariaLabel: "orders",
- icon: ordersIcon,
children: [
{
ariaLabel: "orders",
@@ -72,6 +70,7 @@ const menuStructure: IMenuItem[] = [
url: orderDraftListUrl()
}
],
+ icon: ordersIcon,
label: i18n.t("Orders", { context: "Menu label" }),
permission: PermissionEnum.MANAGE_ORDERS
},
@@ -85,7 +84,6 @@ const menuStructure: IMenuItem[] = [
{
ariaLabel: "discounts",
- icon: discountsIcon,
children: [
{
ariaLabel: "sales",
@@ -98,6 +96,7 @@ const menuStructure: IMenuItem[] = [
url: voucherListUrl()
}
],
+ icon: discountsIcon,
label: i18n.t("Discounts", { context: "Menu label" }),
permission: PermissionEnum.MANAGE_DISCOUNTS
},
diff --git a/saleor/static/images/logo-dark-small.svg b/saleor/static/images/logo-dark-small.svg
new file mode 100644
index 0000000000..0b49298616
--- /dev/null
+++ b/saleor/static/images/logo-dark-small.svg
@@ -0,0 +1,4 @@
+<svg width="32" height="33" viewBox="0 0 32 33" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M26.7216 5.23914L1.90735e-06 5.23914L5.27835 -4.00543e-05L32 -4.00543e-05L26.7216 5.23914Z" fill="#19C3BE"/>
+<path d="M15.3359 32.8964C21.9014 32.8964 23.5522 30.3032 23.5522 26.7507C23.5522 22.3812 19.5378 21.5641 16.1988 21.0313C13.6476 20.605 12.4846 20.3918 12.4846 18.8643C12.4846 17.7275 13.4975 17.3012 15.1483 17.3012C17.1742 17.3012 17.737 17.8696 17.9246 19.5392L23.2521 18.7577C22.8019 15.1697 20.7384 13.358 15.2984 13.358C9.33309 13.358 7.23211 15.7026 7.23211 19.4327C7.19459 24.264 11.8468 24.7613 15.2984 25.3297C17.4369 25.7205 18.2622 26.0757 18.2622 27.4612C18.2622 28.598 17.5494 29.0953 15.4109 29.0953C13.0473 29.0953 12.3345 28.7046 12.0343 26.8218L6.85693 27.5678C7.34466 31.3689 9.63322 32.8964 15.3359 32.8964Z" fill="white"/>
+</svg>
diff --git a/saleor/static/images/logo-dark.svg b/saleor/static/images/logo-dark.svg
index 309d7c8950..9ee80f315a 100644
--- a/saleor/static/images/logo-dark.svg
+++ b/saleor/static/images/logo-dark.svg
@@ -1,4 +1,4 @@
-<svg viewBox="0 0 119 40" fill="none" xmlns="http://www.w3.org/2000/svg">
+<svg fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6.29798 0L0 6.36371H31.8841L38.1818 0H6.29798Z" fill="#13BEBB"/>
<path d="M18.3033 39.9567C26.1372 39.9567 28.1071 36.8068 28.1071 32.4921C28.1071 27.1847 23.3171 26.1924 19.333 25.545C16.2888 25.0271 14.9011 24.7683 14.9011 22.913C14.9011 21.5323 16.1097 21.0144 18.0795 21.0144C20.4969 21.0144 21.1683 21.7049 21.3923 23.7328L27.749 22.7835C27.2115 18.4255 24.7495 16.2249 18.2585 16.2249C11.141 16.2249 8.63409 19.0727 8.63409 23.6033C8.58946 29.4717 14.1403 30.0756 18.2585 30.7658C20.81 31.2409 21.7952 31.6719 21.7952 33.3549C21.7952 34.7359 20.9447 35.34 18.3928 35.34C15.5726 35.34 14.7221 34.8653 14.364 32.5783L8.18652 33.4844C8.7684 38.1014 11.4991 39.9567 18.3033 39.9567Z" fill="white"/>
<path d="M38.794 35.2108C35.7944 35.2108 34.7204 34.5635 34.7204 32.4061C34.7204 30.4644 35.7944 29.6877 39.0177 29.6877H42.2408V31.9315C42.2408 34.0889 41.1665 35.2108 38.794 35.2108ZM36.0184 39.9571C39.5101 39.9571 41.0771 38.8351 42.1962 37.1954V39.655H48.5078V24.0352C48.5078 18.8141 46.4933 16.1821 39.5101 16.1821C32.7505 16.1821 30.3782 18.0805 29.438 22.7406L35.7052 23.69C36.1079 21.7052 36.69 21.1009 39.2864 21.1009C41.7932 21.1009 42.1962 22.1365 42.1962 23.8626V25.4592H39.2415C31.2287 25.4592 28.4978 27.8755 28.4978 32.7943C28.4978 37.6269 30.9601 39.9571 36.0184 39.9571Z" fill="white"/>
diff --git a/saleor/static/images/menu-arrow-icon.svg b/saleor/static/images/menu-arrow-icon.svg
new file mode 100644
index 0000000000..d71344f32d
--- /dev/null
+++ b/saleor/static/images/menu-arrow-icon.svg
@@ -0,0 +1,3 @@
+<svg width="17" height="8" viewBox="0 0 17 8" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M13.2626 4.96719L-1.32568e-07 4.96719L-2.17123e-07 3.03281L13.2626 3.03281L11.5821 1.36782L12.9627 -5.66617e-07L17 4L12.9627 8L11.5821 6.63218L13.2626 4.96719Z" />
+</svg>