-
listShortUrls({ ...shortUrlsListParams, searchTerm })
- }
- />
+ return (
+
+ listShortUrls({ ...shortUrlsListParams, searchTerm })
+ }
+ />
- {!isEmpty(selectedTags) && (
-
-
-
- {selectedTags.map((tag) => (
- listShortUrls(
- {
- ...shortUrlsListParams,
- tags: selectedTags.filter((selectedTag) => selectedTag !== tag),
- }
- )}
- />
- ))}
-
- )}
-
- );
-}
+ {!isEmpty(selectedTags) && (
+
+
+
+ {selectedTags.map((tag) => (
+ listShortUrls(
+ {
+ ...shortUrlsListParams,
+ tags: selectedTags.filter((selectedTag) => selectedTag !== tag),
+ }
+ )}
+ />
+ ))}
+
+ )}
+
+ );
+ };
-SearchBarComponent.propTypes = propTypes;
+ SearchBar.propTypes = propTypes;
-const SearchBar = connect(pick([ 'shortUrlsListParams' ]), { listShortUrls })(SearchBarComponent);
+ return SearchBar;
+};
export default SearchBar;
diff --git a/src/short-urls/ShortUrls.js b/src/short-urls/ShortUrls.js
index eadfc38f..22b2ed15 100644
--- a/src/short-urls/ShortUrls.js
+++ b/src/short-urls/ShortUrls.js
@@ -1,27 +1,21 @@
import React from 'react';
-import { connect } from 'react-redux';
-import { assoc } from 'ramda';
import Paginator from './Paginator';
-import SearchBar from './SearchBar';
-import ShortUrlsList from './ShortUrlsList';
-export function ShortUrlsComponent(props) {
- const { match: { params } } = props;
+const ShortUrls = (SearchBar, ShortUrlsList) => (props) => {
+ const { match: { params }, shortUrlsList } = props;
+ const { page, serverId } = params;
+ const { data = [], pagination } = shortUrlsList;
// Using a key on a component makes react to create a new instance every time the key changes
- const urlsListKey = `${params.serverId}_${params.page}`;
+ const urlsListKey = `${serverId}_${page}`;
return (