2023-03-23 11:41:58 +00:00
|
|
|
import { NAVIGATION_SETTINGS, SIDEBAR_WIDTH } from "constants/AppConstants";
|
|
|
|
|
import type { NavigationSetting } from "constants/AppConstants";
|
|
|
|
|
import styled from "styled-components";
|
|
|
|
|
import {
|
|
|
|
|
getMenuContainerBackgroundColor,
|
|
|
|
|
getMenuItemBackgroundColorOnHover,
|
|
|
|
|
getMenuItemBackgroundColorWhenActive,
|
|
|
|
|
} from "../utils";
|
|
|
|
|
import { StyledMenuItem } from "./components/MenuItem.styled";
|
|
|
|
|
|
|
|
|
|
export const StyledSidebar = styled.div<{
|
|
|
|
|
primaryColor: string;
|
|
|
|
|
navColorStyle: NavigationSetting["colorStyle"];
|
|
|
|
|
isMinimal: boolean;
|
|
|
|
|
sidebarHeight: string;
|
|
|
|
|
}>`
|
|
|
|
|
height: ${({ sidebarHeight }) => sidebarHeight};
|
|
|
|
|
background-color: ${({ navColorStyle, primaryColor }) =>
|
|
|
|
|
getMenuContainerBackgroundColor(primaryColor, navColorStyle)};
|
|
|
|
|
position: fixed;
|
|
|
|
|
top: 0;
|
|
|
|
|
transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
2023-05-19 18:37:06 +00:00
|
|
|
border-right: 1px solid var(--ads-v2-color-border);
|
2023-03-23 11:41:58 +00:00
|
|
|
|
|
|
|
|
${({ isMinimal }) => {
|
|
|
|
|
const width = isMinimal ? SIDEBAR_WIDTH.MINIMAL : SIDEBAR_WIDTH.REGULAR;
|
|
|
|
|
|
|
|
|
|
return `
|
|
|
|
|
width: ${width}px;
|
|
|
|
|
left: -${width}px;
|
|
|
|
|
`;
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
|
|
&.is-open {
|
|
|
|
|
left: 0;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
export const StyledMenuContainer = styled.div<{
|
|
|
|
|
primaryColor: string;
|
|
|
|
|
navColorStyle: NavigationSetting["colorStyle"];
|
|
|
|
|
}>`
|
2023-05-05 06:49:20 +00:00
|
|
|
margin: 20px 0 0 0;
|
2023-03-23 11:41:58 +00:00
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 4px;
|
|
|
|
|
overflow-y: auto;
|
2023-05-05 06:49:20 +00:00
|
|
|
padding: 0 16px 12px;
|
2023-03-23 11:41:58 +00:00
|
|
|
flex-grow: 1;
|
|
|
|
|
padding-bottom: 12px;
|
|
|
|
|
|
|
|
|
|
${({ navColorStyle, primaryColor }) => {
|
|
|
|
|
const isThemeColorStyle: boolean =
|
|
|
|
|
navColorStyle === NAVIGATION_SETTINGS.COLOR_STYLE.THEME;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
isThemeColorStyle &&
|
|
|
|
|
`
|
|
|
|
|
&::-webkit-scrollbar {
|
|
|
|
|
width: 6px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&::-webkit-scrollbar-track {
|
|
|
|
|
background: ${getMenuContainerBackgroundColor(
|
|
|
|
|
primaryColor,
|
|
|
|
|
navColorStyle,
|
|
|
|
|
)};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&::-webkit-scrollbar-thumb {
|
|
|
|
|
background: ${primaryColor};
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
background: ${getMenuItemBackgroundColorOnHover(
|
|
|
|
|
primaryColor,
|
|
|
|
|
navColorStyle,
|
|
|
|
|
)};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&:hover::-webkit-scrollbar-thumb {
|
|
|
|
|
background: ${getMenuItemBackgroundColorWhenActive(
|
|
|
|
|
primaryColor,
|
|
|
|
|
navColorStyle,
|
|
|
|
|
)};
|
|
|
|
|
}
|
|
|
|
|
`
|
|
|
|
|
);
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
|
|
${StyledMenuItem} {
|
|
|
|
|
align-self: flex-start;
|
|
|
|
|
width: 100%;
|
|
|
|
|
max-width: initial;
|
|
|
|
|
padding: 8px 10px;
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
export const StyledCtaContainer = styled.div`
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 4px;
|
|
|
|
|
padding: 0px 8px;
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
export const StyledHeader = styled.div`
|
2023-05-05 06:49:20 +00:00
|
|
|
padding: 20px 20px 0px;
|
2023-03-23 11:41:58 +00:00
|
|
|
display: flex;
|
|
|
|
|
align-items: flex-start;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
export const StyledFooter = styled.div<{
|
|
|
|
|
primaryColor: string;
|
|
|
|
|
navColorStyle: NavigationSetting["colorStyle"];
|
|
|
|
|
}>`
|
|
|
|
|
margin-top: auto;
|
|
|
|
|
padding-bottom: 16px;
|
|
|
|
|
padding-top: 12px;
|
|
|
|
|
|
|
|
|
|
${({ navColorStyle, primaryColor, theme }) => {
|
|
|
|
|
const isThemeColorStyle =
|
|
|
|
|
navColorStyle === NAVIGATION_SETTINGS.COLOR_STYLE.THEME;
|
|
|
|
|
|
|
|
|
|
return isThemeColorStyle
|
|
|
|
|
? `
|
|
|
|
|
border-top: 1px solid ${getMenuItemBackgroundColorWhenActive(
|
|
|
|
|
primaryColor,
|
|
|
|
|
navColorStyle,
|
|
|
|
|
)};
|
|
|
|
|
`
|
|
|
|
|
: `
|
|
|
|
|
border-top: 1px solid ${theme.colors.header.tabsHorizontalSeparator};
|
|
|
|
|
`;
|
|
|
|
|
}}
|
|
|
|
|
`;
|