@gravity-ui/blog-constructor 6.3.0 → 6.3.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -20,7 +20,12 @@ const PaginatorItem = ({ dataKey, mods, content, queryParams, onClick, loading =
|
|
20
20
|
.join('&');
|
21
21
|
return queryString ? `${urlPath}?${queryString}` : urlPath;
|
22
22
|
}, [queryParams, index, urlPath]);
|
23
|
-
const
|
24
|
-
|
23
|
+
const handleClick = (0, react_1.useCallback)((event) => {
|
24
|
+
if (addNavigationLinkForPages && (event.metaKey || event.ctrlKey)) {
|
25
|
+
return;
|
26
|
+
}
|
27
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(itemKey);
|
28
|
+
}, [addNavigationLinkForPages, itemKey, onClick]);
|
29
|
+
return (react_1.default.createElement(uikit_1.Button, { view: "flat", size: "xl", className: b('item', mods), onClick: handleClick, href: addNavigationLinkForPages ? navigationLink : undefined, loading: loading && Boolean(mods.active) }, content));
|
25
30
|
};
|
26
31
|
exports.PaginatorItem = PaginatorItem;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React, {
|
1
|
+
import React, { useCallback, useContext, useMemo } from 'react';
|
2
2
|
import { Button } from '@gravity-ui/uikit';
|
3
3
|
import { LocaleContext } from '../../../contexts/LocaleContext';
|
4
4
|
import { SettingsContext } from '../../../contexts/SettingsContext';
|
@@ -17,6 +17,11 @@ export const PaginatorItem = ({ dataKey, mods, content, queryParams, onClick, lo
|
|
17
17
|
.join('&');
|
18
18
|
return queryString ? `${urlPath}?${queryString}` : urlPath;
|
19
19
|
}, [queryParams, index, urlPath]);
|
20
|
-
const
|
21
|
-
|
20
|
+
const handleClick = useCallback((event) => {
|
21
|
+
if (addNavigationLinkForPages && (event.metaKey || event.ctrlKey)) {
|
22
|
+
return;
|
23
|
+
}
|
24
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(itemKey);
|
25
|
+
}, [addNavigationLinkForPages, itemKey, onClick]);
|
26
|
+
return (React.createElement(Button, { view: "flat", size: "xl", className: b('item', mods), onClick: handleClick, href: addNavigationLinkForPages ? navigationLink : undefined, loading: loading && Boolean(mods.active) }, content));
|
22
27
|
};
|