kui-complex 0.0.35 → 0.0.37

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/dist/index.js CHANGED
@@ -20,6 +20,7 @@ var reactScroll = require('react-scroll');
20
20
  var ru = require('date-fns/locale/ru');
21
21
  var luxon = require('luxon');
22
22
  var Swiper = require('react-id-swiper');
23
+ var reactRouter = require('react-router');
23
24
  var ReactDOM = require('react-dom');
24
25
  var classNames = require('classnames');
25
26
 
@@ -144,11 +145,11 @@ var templateObject_1$s, templateObject_2$e;
144
145
  var ButtonsPanel = function (_a) {
145
146
  var tabs = _a.tabs, tabPanels = _a.tabPanels, paths = _a.paths, activeTab = _a.activeTab, isSticky = _a.isSticky, onChange = _a.onChange, otherProps = __rest(_a, ["tabs", "tabPanels", "paths", "activeTab", "isSticky", "onChange"]);
146
147
  var _b = React__namespace.useState(Number(activeTab)), value = _b[0], setValue = _b[1];
147
- var history = reactRouterDom.useHistory();
148
+ var navigate = reactRouterDom.useNavigate();
148
149
  var handleChange = function (newValue) {
149
150
  setValue(newValue);
150
151
  if (paths && paths.length > 0) {
151
- history.push(paths[newValue]);
152
+ navigate(paths[newValue]);
152
153
  }
153
154
  if (onChange) {
154
155
  onChange();
@@ -772,15 +773,16 @@ var MenuPanel = function (_a) {
772
773
  var width = useWindowWidth();
773
774
  var _b = React__namespace.useState(activeTab), value = _b[0], setValue = _b[1];
774
775
  var _c = React__namespace.useState(false), isScrolling = _c[0], setIsScrolling = _c[1];
775
- var history = reactRouterDom.useHistory();
776
+ var navigate = reactRouterDom.useNavigate();
777
+ var location = reactRouter.useLocation();
776
778
  var handleClick = function (index) {
777
779
  if (paths[index]) {
778
780
  setValue(index);
779
- var pathName = history.location.pathname;
780
- var currentLocation = "".concat(pathName).concat(history.location.search);
781
+ var pathName = location.pathname;
782
+ var currentLocation = "".concat(pathName).concat(location.search);
781
783
  var newLocation = "".concat(pathName).concat(paths[index]);
782
784
  if (currentLocation !== newLocation) {
783
- history.replace(newLocation);
785
+ navigate(newLocation, { replace: true });
784
786
  }
785
787
  }
786
788
  };