2023-03-02 09:22:01 +00:00
|
|
|
import { AppSections } from "@dashboard/new-apps/urls";
|
2022-06-30 09:05:09 +00:00
|
|
|
import { matchPath, useLocation } from "react-router";
|
|
|
|
|
|
|
|
const isAppPath = (pathname: string) =>
|
|
|
|
!!matchPath(pathname, {
|
2023-03-02 09:22:01 +00:00
|
|
|
path: `${AppSections.appsSection}:id`,
|
2022-06-30 09:05:09 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Use detailed information about the current location.
|
|
|
|
*/
|
|
|
|
export const useLocationState = () => {
|
|
|
|
const location = useLocation();
|
|
|
|
|
|
|
|
return {
|
|
|
|
isAppPath: isAppPath(location.pathname),
|
|
|
|
};
|
|
|
|
};
|