@thairath/tr-design-system 0.2.17 → 0.2.19

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.cjs CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  var React$1 = require('react');
4
4
  var _styled = require('@emotion/styled/base');
5
- var navigation = require('next/navigation');
6
5
 
7
6
  function _defineProperty(e, r, t) {
8
7
  return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
@@ -6564,7 +6563,6 @@ var TROEN_SlidebarNavOther = /*#__PURE__*/_styled("div", process.env.NODE_ENV ==
6564
6563
  });
6565
6564
 
6566
6565
  // src/components/organisms/HeaderEN/headerEN.client.tsx
6567
-
6568
6566
  function TROENHeaderClient(_ref) {
6569
6567
  var {
6570
6568
  data,
@@ -6575,7 +6573,7 @@ function TROENHeaderClient(_ref) {
6575
6573
  var [isMobileView, setIsMobileView] = React$1.useState(false);
6576
6574
  var [showStickyLogo, setShowStickyLogo] = React$1.useState(false);
6577
6575
  var containerRef = React$1.useRef(null);
6578
- var pathname = navigation.usePathname();
6576
+ var [pathname, setPathname] = React$1.useState(window.location.pathname);
6579
6577
  // Detect mobile viewport
6580
6578
  React$1.useEffect(() => {
6581
6579
  var m = window.matchMedia("(max-width: 1023px)");
@@ -6591,6 +6589,11 @@ function TROENHeaderClient(_ref) {
6591
6589
  window.addEventListener("scroll", onScroll);
6592
6590
  return () => window.removeEventListener("scroll", onScroll);
6593
6591
  }, [isMobileView]);
6592
+ React$1.useEffect(() => {
6593
+ var handlePathChange = () => setPathname(window.location.pathname);
6594
+ window.addEventListener("popstate", handlePathChange);
6595
+ return () => window.removeEventListener("popstate", handlePathChange);
6596
+ }, []);
6594
6597
  // Scroll active menu into center
6595
6598
  React$1.useEffect(() => {
6596
6599
  var _a;
@@ -6732,7 +6735,7 @@ function TROENHeaderClient(_ref) {
6732
6735
  }, item.name))))))));
6733
6736
  }
6734
6737
 
6735
- var menu = {
6738
+ var data = {
6736
6739
  naviMenu: [{
6737
6740
  category: "Home",
6738
6741
  link: "/"
@@ -6835,14 +6838,14 @@ var menu = {
6835
6838
  }]
6836
6839
  };
6837
6840
 
6838
- // src/components/organisms/HeaderEN/headerEN.server.tsx
6841
+ // src/components/organisms/HeaderEN/headerEN.tsx
6839
6842
  var TROENHeader = _ref => {
6840
6843
  var {
6841
6844
  logoColor = 'Color',
6842
6845
  loading = "Loading..."
6843
6846
  } = _ref;
6844
6847
  return /*#__PURE__*/React.createElement(TROENHeaderClient, {
6845
- data: menu,
6848
+ data: data,
6846
6849
  logoColor: logoColor,
6847
6850
  loading: loading
6848
6851
  });