mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 21:47:20 +00:00
19 lines
628 B
TypeScript
19 lines
628 B
TypeScript
import url_prefix from "router/url_prefix";
|
|
|
|
const deviceSelfServiceRegex = new RegExp(
|
|
`^${url_prefix}/device/[^/]+/self-service/?$`
|
|
);
|
|
|
|
// iOS/iPadOS base device route should support low-width screens
|
|
const deviceIOSIPadOSRegex = new RegExp(`^${url_prefix}/device/[^/]+/?$`);
|
|
|
|
// Define paths that will not show the unsupported screen overlay
|
|
const lowWidthSupportedPathsRegex = [
|
|
deviceSelfServiceRegex,
|
|
deviceIOSIPadOSRegex,
|
|
];
|
|
|
|
const shouldShowUnsupportedScreen = (locationPathname: string) =>
|
|
!lowWidthSupportedPathsRegex.some((regex) => regex.test(locationPathname));
|
|
|
|
export default shouldShowUnsupportedScreen;
|