diff --git a/desktop/flipper-ui-core/src/index.tsx b/desktop/flipper-ui-core/src/index.tsx index 83369ac66..9fcd909c3 100644 --- a/desktop/flipper-ui-core/src/index.tsx +++ b/desktop/flipper-ui-core/src/index.tsx @@ -12,3 +12,5 @@ export {RenderHost, getRenderHostInstance} from 'flipper-frontend-core'; export {startFlipperDesktop} from './startFlipperDesktop'; export {Icon} from './utils/icons'; + +export {isPWA} from './utils/pwa'; diff --git a/desktop/flipper-ui-core/src/utils/pwa.tsx b/desktop/flipper-ui-core/src/utils/pwa.tsx new file mode 100644 index 000000000..3a0142db7 --- /dev/null +++ b/desktop/flipper-ui-core/src/utils/pwa.tsx @@ -0,0 +1,12 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +export const isPWA = () => { + return window.matchMedia('(display-mode: standalone)').matches; +};