@availity/page-header 11.1.27 → 11.1.30

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/CHANGELOG.md CHANGED
@@ -3,6 +3,33 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [11.1.30](https://github.com/Availity/availity-react/compare/@availity/page-header@11.1.29...@availity/page-header@11.1.30) (2022-04-14)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **page-header:** account for payerId with multiple associated spaces and no spaceId passed ([871caf0](https://github.com/Availity/availity-react/commit/871caf05ad4d94bcd51f3df8a899d7a36191a227))
12
+
13
+
14
+
15
+
16
+
17
+ ## [11.1.29](https://github.com/Availity/availity-react/compare/@availity/page-header@11.1.28...@availity/page-header@11.1.29) (2022-04-13)
18
+
19
+ **Note:** Version bump only for package @availity/page-header
20
+
21
+
22
+
23
+
24
+
25
+ ## [11.1.28](https://github.com/Availity/availity-react/compare/@availity/page-header@11.1.27...@availity/page-header@11.1.28) (2022-04-13)
26
+
27
+ **Note:** Version bump only for package @availity/page-header
28
+
29
+
30
+
31
+
32
+
6
33
  ## [11.1.27](https://github.com/Availity/availity-react/compare/@availity/page-header@11.1.25...@availity/page-header@11.1.27) (2022-03-09)
7
34
 
8
35
  **Note:** Version bump only for package @availity/page-header
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@availity/page-header",
3
- "version": "11.1.27",
3
+ "version": "11.1.30",
4
4
  "description": "The standard page header for Availity Portal Applications",
5
5
  "keywords": [
6
6
  "react",
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "devDependencies": {
33
33
  "@availity/api-axios": "^6.0.0",
34
- "@availity/spaces": "^5.1.3",
34
+ "@availity/spaces": "^6.0.0",
35
35
  "@availity/training-link": "^1.4.2",
36
36
  "axios": "^0.21.1",
37
37
  "formik": "^2.2.8",
@@ -51,5 +51,5 @@
51
51
  "publishConfig": {
52
52
  "access": "public"
53
53
  },
54
- "gitHead": "53e1e1922c1a7f28fc0fd9cfb8d91eeb92f1226b"
54
+ "gitHead": "1c1684571eb5cac868f984efa88916b93ca4dc1c"
55
55
  }
package/src/PageHeader.js CHANGED
@@ -33,10 +33,19 @@ const PageHeader = ({
33
33
  className,
34
34
  ...props
35
35
  }) => {
36
- const [spaceForSpaceID, spaceForPayerID] = useSpaces(spaceId, payerId);
36
+ const spaces = useSpaces(spaceId, payerId);
37
+
38
+ let firstSpaceForPayerID;
39
+ let firstSpaceForSpaceID;
40
+ if (!spaceId && payerId && spaces[0]) {
41
+ firstSpaceForPayerID = spaces[0];
42
+ } else {
43
+ firstSpaceForSpaceID = spaces[0];
44
+ firstSpaceForPayerID = spaces[1];
45
+ }
37
46
  const { loading: spacesIsLoading } = useSpacesContext() || {};
38
47
 
39
- const _space = spaceForSpaceID || spaceForPayerID;
48
+ const _space = firstSpaceForSpaceID || firstSpaceForPayerID;
40
49
 
41
50
  let payerLogo = null;
42
51
  if (payerId || logo) {
@@ -50,7 +59,7 @@ const PageHeader = ({
50
59
  },
51
60
  };
52
61
  payerLogo =
53
- spaceForPayerID || (logo && spaceForSpaceID) || spacesIsLoading ? (
62
+ firstSpaceForPayerID || (logo && firstSpaceForSpaceID) || spacesIsLoading ? (
54
63
  <SpacesLogo {...logoAttrs} />
55
64
  ) : (
56
65
  <Spaces
@@ -66,8 +75,8 @@ const PageHeader = ({
66
75
  const _spaceName = spaceName || (_space && _space.name);
67
76
  if ((spaceId || _spaceName) && !crumbs) {
68
77
  const url =
69
- spaceForSpaceID && spaceForSpaceID.link && spaceForSpaceID.link.url
70
- ? spaceForSpaceID.link.url
78
+ firstSpaceForSpaceID && firstSpaceForSpaceID.link && firstSpaceForSpaceID.link.url
79
+ ? firstSpaceForSpaceID.link.url
71
80
  : `/web/spc/spaces/#/${spaceId}`;
72
81
  crumbs = [{ name: _spaceName, url }];
73
82
  }