@bigbinary/neeto-tags-frontend 1.5.12 → 1.5.14

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.js CHANGED
@@ -1835,9 +1835,6 @@ var Merge = function Merge(_ref) {
1835
1835
  }));
1836
1836
  };
1837
1837
 
1838
- var renderComponent = function renderComponent(Component, props) {
1839
- return /*#__PURE__*/React__default["default"].createElement(Component, props);
1840
- };
1841
1838
  var getCurrentTagType = function getCurrentTagType() {
1842
1839
  var tagTypes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
1843
1840
  var searchParams = new URLSearchParams(window.location.search);
@@ -1848,19 +1845,15 @@ var getCurrentTagType = function getCurrentTagType() {
1848
1845
  });
1849
1846
  return requiredTagType || tagTypes[0];
1850
1847
  };
1851
- var createRoutes = function createRoutes(props) {
1848
+ var createRoutes = function createRoutes(path) {
1852
1849
  return [{
1853
- component: function component() {
1854
- return renderComponent(Merge, props);
1855
- },
1850
+ component: Merge,
1856
1851
  exact: true,
1857
- path: "".concat(props.tagsPath, "/merge")
1852
+ path: "".concat(path, "/merge")
1858
1853
  }, {
1859
- component: function component() {
1860
- return renderComponent(Dashboard, props);
1861
- },
1854
+ component: Dashboard,
1862
1855
  exact: true,
1863
- path: props.tagsPath || ""
1856
+ path: path || ""
1864
1857
  }];
1865
1858
  };
1866
1859
 
@@ -1888,21 +1881,20 @@ var Tags = function Tags(_ref) {
1888
1881
  _useState2 = _slicedToArray(_useState, 2),
1889
1882
  tagType = _useState2[0],
1890
1883
  setTagType = _useState2[1];
1891
- var routes = createRoutes(_objectSpread(_objectSpread({}, config), {}, {
1892
- displayMenu: displayMenu,
1893
- tagType: tagType,
1894
- setTagType: setTagType
1895
- }));
1884
+ var routes = createRoutes(config.tagsPath);
1896
1885
  return /*#__PURE__*/React__default["default"].createElement(reactRouterDom.Switch, null, routes.map(function (_ref2) {
1897
1886
  var exact = _ref2.exact,
1898
1887
  path = _ref2.path,
1899
- component = _ref2.component;
1888
+ Component = _ref2.component;
1900
1889
  return /*#__PURE__*/React__default["default"].createElement(reactRouterDom.Route, {
1901
- component: component,
1902
1890
  exact: exact,
1903
1891
  path: path,
1904
1892
  key: path
1905
- });
1893
+ }, /*#__PURE__*/React__default["default"].createElement(Component, _objectSpread(_objectSpread({}, config), {}, {
1894
+ displayMenu: displayMenu,
1895
+ setTagType: setTagType,
1896
+ tagType: tagType
1897
+ })));
1906
1898
  }));
1907
1899
  };
1908
1900
  var Tags$1 = withReactQuery(Tags);