@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.
- package/build/cjs/models/navigation.d.ts +1 -0
- package/build/cjs/navigation/components/Navigation/Navigation.js +3 -1
- package/build/esm/models/navigation.d.ts +1 -0
- package/build/esm/navigation/components/Navigation/Navigation.js +3 -1
- package/package.json +1 -1
- package/server/models/navigation.d.ts +1 -0
- package/widget/index.js +1 -1
|
@@ -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);
|
|
@@ -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