@acvl/frontend-components 0.0.5 → 0.0.6
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/dist/cjs/index.js +15 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/src/components/v1/lib/hooks/navigation.d.ts +4 -1
- package/dist/esm/index.js +15 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/src/components/v1/lib/hooks/navigation.d.ts +4 -1
- package/dist/index.d.ts +4 -1
- package/package.json +2 -2
package/dist/esm/index.js
CHANGED
|
@@ -22685,7 +22685,7 @@ const ControlledDate = (props) => {
|
|
|
22685
22685
|
|
|
22686
22686
|
const useHasPermission = (path) => {
|
|
22687
22687
|
const session = useSession();
|
|
22688
|
-
return !!get(session, `
|
|
22688
|
+
return !!get(session, `extraUserInfo.permissions.${path}`);
|
|
22689
22689
|
};
|
|
22690
22690
|
|
|
22691
22691
|
const APIContext = createContext(null);
|
|
@@ -22711,7 +22711,20 @@ const useNavigation = () => {
|
|
|
22711
22711
|
if (!context) {
|
|
22712
22712
|
throw new Error('useNavigation debe ser utilizado dentro de un NavigationContextProvider');
|
|
22713
22713
|
}
|
|
22714
|
-
|
|
22714
|
+
const navigate = context.hook();
|
|
22715
|
+
const response = {
|
|
22716
|
+
push: undefined,
|
|
22717
|
+
back: undefined,
|
|
22718
|
+
};
|
|
22719
|
+
if (typeof navigate === 'function') {
|
|
22720
|
+
response.push = navigate;
|
|
22721
|
+
response.back = navigate(-1);
|
|
22722
|
+
}
|
|
22723
|
+
else {
|
|
22724
|
+
response.push = navigate.push;
|
|
22725
|
+
response.back = navigate.back();
|
|
22726
|
+
}
|
|
22727
|
+
return response;
|
|
22715
22728
|
};
|
|
22716
22729
|
// // Inside your shared library
|
|
22717
22730
|
// export const MyCustomLink = ({ href, children, component: Component = 'a', ...props }) => {
|