@availity/hooks 5.0.3 → 5.1.1
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 +13 -0
- package/README.md +1 -1
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +8 -4
- package/src/useUpdateNav.js +17 -0
- package/types/useUpdateNav.d.ts +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [5.1.1](https://github.com/Availity/availity-react/compare/@availity/hooks@5.1.0...@availity/hooks@5.1.1) (2024-10-02)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
# [5.1.0](https://github.com/Availity/availity-react/compare/@availity/hooks@5.0.3...@availity/hooks@5.1.0) (2024-10-01)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* **hooks:** add useUpdateNav ([68d0f21](https://github.com/Availity/availity-react/commit/68d0f21d1eb034065d7528ebf6033f2e8f20057e))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
5
18
|
## [5.0.3](https://github.com/Availity/availity-react/compare/@availity/hooks@5.0.2...@availity/hooks@5.0.3) (2024-08-22)
|
|
6
19
|
|
|
7
20
|
|
package/README.md
CHANGED
|
@@ -22,4 +22,4 @@ yarn add @availity/hooks
|
|
|
22
22
|
|
|
23
23
|
## Documentation
|
|
24
24
|
|
|
25
|
-
Check out more documentation at [availity.github.io](https://availity.github.io/availity-react/components/hooks/
|
|
25
|
+
Check out more documentation at [availity.github.io](https://availity.github.io/availity-react/components/hooks/)
|
package/index.d.ts
CHANGED
|
@@ -7,4 +7,5 @@ export { default as useCurrentUser } from './types/useCurrentUser';
|
|
|
7
7
|
export { default as useProviders } from './types/useProviders';
|
|
8
8
|
export { default as usePermissions } from './types/usePermissions';
|
|
9
9
|
export { default as useOrganizations } from './types/useOrganizations';
|
|
10
|
+
export { default as useUpdateNav } from './types/useUpdateNav';
|
|
10
11
|
export { default as useWindowDimensions } from './types/useWindowDimensions';
|
package/index.js
CHANGED
|
@@ -7,4 +7,5 @@ export { default as useCurrentUser } from './src/useCurrentUser';
|
|
|
7
7
|
export { default as useProviders } from './src/useProviders';
|
|
8
8
|
export { default as usePermissions } from './src/usePermissions';
|
|
9
9
|
export { default as useOrganizations } from './src/useOrganizations';
|
|
10
|
+
export { default as useUpdateNav } from './src/useUpdateNav';
|
|
10
11
|
export { default as useWindowDimensions } from './src/useWindowDimensions';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@availity/hooks",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.1.1",
|
|
4
4
|
"description": "A group of pre-built hooks that are common in most apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -30,14 +30,18 @@
|
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@availity/api-axios": "^9.0.0",
|
|
33
|
+
"@availity/message-core": "^7.0.1",
|
|
33
34
|
"axios": "^1.7.4",
|
|
34
35
|
"react": "^18.3.1",
|
|
35
|
-
"react-dom": "^18.3.1"
|
|
36
|
+
"react-dom": "^18.3.1",
|
|
37
|
+
"react-router-dom": "^6.26.0"
|
|
36
38
|
},
|
|
37
39
|
"peerDependencies": {
|
|
38
|
-
"@availity/api-axios": "^
|
|
40
|
+
"@availity/api-axios": "^9.0.0",
|
|
41
|
+
"@availity/message-core": "^7.0.1",
|
|
39
42
|
"axios": "^1.7.4",
|
|
40
|
-
"react": ">=16.8.0"
|
|
43
|
+
"react": ">=16.8.0",
|
|
44
|
+
"react-router-dom": "^6.0.0"
|
|
41
45
|
},
|
|
42
46
|
"publishConfig": {
|
|
43
47
|
"access": "public"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { useLocation } from 'react-router-dom';
|
|
3
|
+
import avMessage from '@availity/message-core';
|
|
4
|
+
|
|
5
|
+
const useUpdateNav = () => {
|
|
6
|
+
const location = useLocation();
|
|
7
|
+
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
try {
|
|
10
|
+
avMessage.send({ event: 'navChange', url: window.location.href });
|
|
11
|
+
} catch {
|
|
12
|
+
// noop
|
|
13
|
+
}
|
|
14
|
+
}, [location]);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default useUpdateNav;
|