homeflowjs 1.0.75 → 1.0.76

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homeflowjs",
3
- "version": "1.0.75",
3
+ "version": "1.0.76",
4
4
  "sideEffects": [
5
5
  "modal/**/*",
6
6
  "user/default-profile/**/*",
@@ -18,6 +18,7 @@ const SaveSearchButton = (props) => {
18
18
  removeSavedSearchAsync,
19
19
  style,
20
20
  notificationMessage,
21
+ renderAsButton,
21
22
  showNotification,
22
23
  } = props;
23
24
 
@@ -42,6 +43,19 @@ const SaveSearchButton = (props) => {
42
43
  }
43
44
  };
44
45
 
46
+ if (renderAsButton) return (
47
+ <button
48
+ role="button"
49
+ onClick={toggleSearch}
50
+ className={`${className} ${savedSearch ? 'saved' : ''}`}
51
+ {...(style && {
52
+ style,
53
+ })}
54
+ >
55
+ {savedSearch ? SavedComponent : UnsavedComponent}
56
+ </button>
57
+ )
58
+
45
59
  return (
46
60
  // eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/anchor-is-valid
47
61
  <a
@@ -56,6 +70,7 @@ const SaveSearchButton = (props) => {
56
70
 
57
71
  SaveSearchButton.propTypes = {
58
72
  search: PropTypes.object.isRequired,
73
+ renderAsButton: PropTypes.bool,
59
74
  className: PropTypes.string,
60
75
  savedSearches: PropTypes.array,
61
76
  UnsavedComponent: PropTypes.element.isRequired,
@@ -79,6 +94,7 @@ SaveSearchButton.defaultProps = {
79
94
  className: '',
80
95
  style: {},
81
96
  showNotification: false,
97
+ renderAsButton: false,
82
98
  };
83
99
 
84
100
  const mapStateToProps = (state) => ({