homeflowjs 0.12.23 → 0.12.24

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": "0.12.23",
3
+ "version": "0.12.24",
4
4
  "sideEffects": [
5
5
  "modal/**/*",
6
6
  "user/default-profile/**/*",
@@ -18,6 +18,7 @@ const SavePropertyButton = (props) => {
18
18
  style,
19
19
  notificationMessage,
20
20
  notifyConfig,
21
+ asAnchorTag,
21
22
  } = props;
22
23
 
23
24
  const isSaved = !!savedProperties.find((p) => p.property_id === parseInt(propertyId, 10));
@@ -36,6 +37,19 @@ const SavePropertyButton = (props) => {
36
37
  }
37
38
  };
38
39
 
40
+ if (asAnchorTag) {
41
+ return (
42
+ // eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/anchor-is-valid
43
+ <a
44
+ style={style}
45
+ onClick={toggleProperty}
46
+ className={`${className} ${isSaved ? 'saved' : ''}`}
47
+ >
48
+ {isSaved ? SavedComponent : UnsavedComponent}
49
+ </a>
50
+ );
51
+ }
52
+
39
53
  return (
40
54
  // eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/anchor-is-valid
41
55
  <button
@@ -61,6 +75,7 @@ SavePropertyButton.propTypes = {
61
75
  addSavedProperty: PropTypes.func.isRequired,
62
76
  removeSavedProperty: PropTypes.func.isRequired,
63
77
  notifyConfig: PropTypes.object,
78
+ asAnchorTag: PropTypes.bool,
64
79
  };
65
80
 
66
81
  SavePropertyButton.defaultProps = {
@@ -69,6 +84,7 @@ SavePropertyButton.defaultProps = {
69
84
  className: '',
70
85
  style: {},
71
86
  notifyConfig: {},
87
+ asAnchorTag: false,
72
88
  };
73
89
 
74
90
  const mapStateToProps = (state) => ({