@gravity-ui/page-constructor 1.15.0-alpha.17 → 1.15.0-alpha.18
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.
|
@@ -10,6 +10,7 @@ const localeContext_1 = require("../../context/localeContext/localeContext");
|
|
|
10
10
|
const useMetrika_1 = require("../../hooks/useMetrika");
|
|
11
11
|
const hooks_1 = require("../../hooks");
|
|
12
12
|
const icons_1 = require("../../icons");
|
|
13
|
+
const blockPositionContext_1 = require("../../context/blockPositionContext");
|
|
13
14
|
const COMPONENT_NAME = 'button';
|
|
14
15
|
const b = (0, utils_1.block)('button-block');
|
|
15
16
|
const Button = (props) => {
|
|
@@ -24,6 +25,9 @@ const Button = (props) => {
|
|
|
24
25
|
target: url,
|
|
25
26
|
}), [blockName, url]);
|
|
26
27
|
const handleAnalytics = (0, hooks_1.useAnalytics)(defaultEvent);
|
|
28
|
+
const blockPosition = (0, react_1.useContext)(blockPositionContext_1.BlockPositionContext);
|
|
29
|
+
// eslint-disable-next-line no-console
|
|
30
|
+
console.log({ blockPosition }, props);
|
|
27
31
|
const onClick = (0, react_1.useCallback)(() => {
|
|
28
32
|
handleMetrika({ metrikaGoals, pixelEvents });
|
|
29
33
|
handleAnalytics(analyticsEvents);
|
|
@@ -8,6 +8,7 @@ import { LocaleContext } from '../../context/localeContext/localeContext';
|
|
|
8
8
|
import { useMetrika } from '../../hooks/useMetrika';
|
|
9
9
|
import { useAnalytics } from '../../hooks';
|
|
10
10
|
import { Github } from '../../icons';
|
|
11
|
+
import { BlockPositionContext } from '../../context/blockPositionContext';
|
|
11
12
|
import './Button.css';
|
|
12
13
|
const COMPONENT_NAME = 'button';
|
|
13
14
|
const b = block('button-block');
|
|
@@ -23,6 +24,9 @@ const Button = (props) => {
|
|
|
23
24
|
target: url,
|
|
24
25
|
}), [blockName, url]);
|
|
25
26
|
const handleAnalytics = useAnalytics(defaultEvent);
|
|
27
|
+
const blockPosition = useContext(BlockPositionContext);
|
|
28
|
+
// eslint-disable-next-line no-console
|
|
29
|
+
console.log({ blockPosition }, props);
|
|
26
30
|
const onClick = useCallback(() => {
|
|
27
31
|
handleMetrika({ metrikaGoals, pixelEvents });
|
|
28
32
|
handleAnalytics(analyticsEvents);
|