2025-11-07 22:30:51 +00:00
|
|
|
import url_prefix from "router/url_prefix";
|
|
|
|
|
|
|
|
|
|
const deviceSelfServiceRegex = new RegExp(
|
|
|
|
|
`^${url_prefix}/device/[^/]+/self-service/?$`
|
|
|
|
|
);
|
|
|
|
|
|
2025-11-14 20:54:30 +00:00
|
|
|
// iOS/iPadOS base device route should support low-width screens
|
|
|
|
|
const deviceIOSIPadOSRegex = new RegExp(`^${url_prefix}/device/[^/]+/?$`);
|
|
|
|
|
|
2025-11-07 22:30:51 +00:00
|
|
|
// Define paths that will not show the unsupported screen overlay
|
2025-11-14 20:54:30 +00:00
|
|
|
const lowWidthSupportedPathsRegex = [
|
|
|
|
|
deviceSelfServiceRegex,
|
|
|
|
|
deviceIOSIPadOSRegex,
|
|
|
|
|
];
|
2025-11-07 22:30:51 +00:00
|
|
|
|
|
|
|
|
const shouldShowUnsupportedScreen = (locationPathname: string) =>
|
|
|
|
|
!lowWidthSupportedPathsRegex.some((regex) => regex.test(locationPathname));
|
|
|
|
|
|
|
|
|
|
export default shouldShowUnsupportedScreen;
|