feat: screen presentation and dismiss animations for mobile (#2073)
This commit is contained in:
@@ -205,9 +205,12 @@ export const disableIosTextFieldZoom = () => {
|
||||
}
|
||||
|
||||
export const isMobileScreen = () => !window.matchMedia(MediaQueryBreakpoints.md).matches
|
||||
|
||||
export const isTabletScreen = () =>
|
||||
!window.matchMedia(MediaQueryBreakpoints.sm).matches && !window.matchMedia(MediaQueryBreakpoints.lg).matches
|
||||
|
||||
export const isTabletOrMobileScreen = () => isMobileScreen() || isTabletScreen()
|
||||
|
||||
export const getBase64FromBlob = (blob: Blob) => {
|
||||
return new Promise<string>((resolve, reject) => {
|
||||
const reader = new FileReader()
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
import { focusModeAnimationDuration } from '../Components/QuickSettingsMenu/QuickSettingsMenu'
|
||||
|
||||
export const FOCUS_MODE_CLASS_NAME = 'focus-mode'
|
||||
export const DISABLING_FOCUS_MODE_CLASS_NAME = 'disable-focus-mode'
|
||||
|
||||
export const toggleFocusMode = (enabled: boolean) => {
|
||||
if (enabled) {
|
||||
document.body.classList.add(FOCUS_MODE_CLASS_NAME)
|
||||
return
|
||||
}
|
||||
|
||||
if (document.body.classList.contains(FOCUS_MODE_CLASS_NAME)) {
|
||||
document.body.classList.add(DISABLING_FOCUS_MODE_CLASS_NAME)
|
||||
document.body.classList.remove(FOCUS_MODE_CLASS_NAME)
|
||||
|
||||
setTimeout(() => {
|
||||
document.body.classList.remove(DISABLING_FOCUS_MODE_CLASS_NAME)
|
||||
}, focusModeAnimationDuration)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user