@thairath/tr-design-system 0.2.18 → 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, {
@@ -6574,7 +6573,7 @@ function TROENHeaderClient(_ref) {
6574
6573
  var [isMobileView, setIsMobileView] = React$1.useState(false);
6575
6574
  var [showStickyLogo, setShowStickyLogo] = React$1.useState(false);
6576
6575
  var containerRef = React$1.useRef(null);
6577
- var pathname = navigation.usePathname();
6576
+ var [pathname, setPathname] = React$1.useState(window.location.pathname);
6578
6577
  // Detect mobile viewport
6579
6578
  React$1.useEffect(() => {
6580
6579
  var m = window.matchMedia("(max-width: 1023px)");
@@ -6590,6 +6589,11 @@ function TROENHeaderClient(_ref) {
6590
6589
  window.addEventListener("scroll", onScroll);
6591
6590
  return () => window.removeEventListener("scroll", onScroll);
6592
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
+ }, []);
6593
6597
  // Scroll active menu into center
6594
6598
  React$1.useEffect(() => {
6595
6599
  var _a;
@@ -6731,7 +6735,7 @@ function TROENHeaderClient(_ref) {
6731
6735
  }, item.name))))))));
6732
6736
  }
6733
6737
 
6734
- var menu = {
6738
+ var data = {
6735
6739
  naviMenu: [{
6736
6740
  category: "Home",
6737
6741
  link: "/"
@@ -6834,14 +6838,14 @@ var menu = {
6834
6838
  }]
6835
6839
  };
6836
6840
 
6837
- // src/components/organisms/HeaderEN/headerEN.server.tsx
6841
+ // src/components/organisms/HeaderEN/headerEN.tsx
6838
6842
  var TROENHeader = _ref => {
6839
6843
  var {
6840
6844
  logoColor = 'Color',
6841
6845
  loading = "Loading..."
6842
6846
  } = _ref;
6843
6847
  return /*#__PURE__*/React.createElement(TROENHeaderClient, {
6844
- data: menu,
6848
+ data: data,
6845
6849
  logoColor: logoColor,
6846
6850
  loading: loading
6847
6851
  });