@gravity-ui/page-constructor 5.4.0 → 5.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -70,6 +70,7 @@ export interface HeaderData {
70
70
  rightItems?: NavigationItemModel[];
71
71
  iconSize?: number;
72
72
  withBorder?: boolean;
73
+ withBorderOnScroll?: boolean;
73
74
  }
74
75
  export interface FooterColumn {
75
76
  title: string;
@@ -12,7 +12,7 @@ const DesktopNavigation_1 = tslib_1.__importDefault(require("../DesktopNavigatio
12
12
  const MobileNavigation_1 = tslib_1.__importDefault(require("../MobileNavigation/MobileNavigation"));
13
13
  const b = (0, utils_1.block)('navigation');
14
14
  const Navigation = ({ data, logo, className }) => {
15
- const { leftItems, rightItems, iconSize = 20, withBorder = false } = data;
15
+ const { leftItems, rightItems, iconSize = 20, withBorder = false, withBorderOnScroll = true, } = data;
16
16
  const [isSidebarOpened, setIsSidebarOpened] = (0, react_1.useState)(false);
17
17
  const [activeItemId, setActiveItemId] = (0, react_1.useState)(undefined);
18
18
  const [showBorder, setShowBorder] = (0, react_1.useState)(withBorder);
@@ -24,6 +24,8 @@ const Navigation = ({ data, logo, className }) => {
24
24
  };
25
25
  const onSidebarOpenedChange = (isOpen) => setIsSidebarOpened(isOpen);
26
26
  (0, react_1.useEffect)(() => {
27
+ if (!withBorderOnScroll)
28
+ return () => { };
27
29
  const showBorderOnScroll = () => {
28
30
  if (!showBorder) {
29
31
  setShowBorder(window.scrollY > 0);
@@ -70,6 +70,7 @@ export interface HeaderData {
70
70
  rightItems?: NavigationItemModel[];
71
71
  iconSize?: number;
72
72
  withBorder?: boolean;
73
+ withBorderOnScroll?: boolean;
73
74
  }
74
75
  export interface FooterColumn {
75
76
  title: string;
@@ -9,7 +9,7 @@ import MobileNavigation from '../MobileNavigation/MobileNavigation';
9
9
  import './Navigation.css';
10
10
  const b = block('navigation');
11
11
  export const Navigation = ({ data, logo, className }) => {
12
- const { leftItems, rightItems, iconSize = 20, withBorder = false } = data;
12
+ const { leftItems, rightItems, iconSize = 20, withBorder = false, withBorderOnScroll = true, } = data;
13
13
  const [isSidebarOpened, setIsSidebarOpened] = useState(false);
14
14
  const [activeItemId, setActiveItemId] = useState(undefined);
15
15
  const [showBorder, setShowBorder] = useState(withBorder);
@@ -21,6 +21,8 @@ export const Navigation = ({ data, logo, className }) => {
21
21
  };
22
22
  const onSidebarOpenedChange = (isOpen) => setIsSidebarOpened(isOpen);
23
23
  useEffect(() => {
24
+ if (!withBorderOnScroll)
25
+ return () => { };
24
26
  const showBorderOnScroll = () => {
25
27
  if (!showBorder) {
26
28
  setShowBorder(window.scrollY > 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "5.4.0",
3
+ "version": "5.5.0",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -70,6 +70,7 @@ export interface HeaderData {
70
70
  rightItems?: NavigationItemModel[];
71
71
  iconSize?: number;
72
72
  withBorder?: boolean;
73
+ withBorderOnScroll?: boolean;
73
74
  }
74
75
  export interface FooterColumn {
75
76
  title: string;