1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

Mobile: Implement new note menu redesign (#11780)

This commit is contained in:
Henry Heino
2025-04-07 12:12:10 -07:00
committed by GitHub
parent fe88703488
commit a29e30e442
23 changed files with 582 additions and 240 deletions

View File

@@ -0,0 +1,24 @@
import { useMemo } from 'react';
import { useWindowDimensions } from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
const useSafeAreaPadding = () => {
const { width: windowWidth, height: windowHeight } = useWindowDimensions();
const safeAreaInsets = useSafeAreaInsets();
const isLandscape = windowWidth > windowHeight;
return useMemo(() => {
return isLandscape ? {
paddingRight: safeAreaInsets.right,
paddingLeft: safeAreaInsets.left,
paddingTop: 15,
paddingBottom: 15,
} : {
paddingTop: safeAreaInsets.top,
paddingBottom: safeAreaInsets.bottom,
paddingLeft: 0,
paddingRight: 0,
};
}, [isLandscape, safeAreaInsets]);
};
export default useSafeAreaPadding;