mirror of
https://github.com/laurent22/joplin.git
synced 2025-02-13 19:42:36 +02:00
This reverts commit 40e0037d500c63b2695e0f07abf26cbe5322678d. It doesn't build on Android: > Task :react-native-reanimated:buildCMakeRelWithDebInfo[arm64-v8a] FAILED C/C++: ninja: error: '../../../../build/third-party-ndk/hermes/jni/arm64-v8a/libhermes.so', needed by '../../../../build-main/intermediates/cxx/RelWithDebInfo/6w4f694p/obj/arm64-v8a/libreanimated.so', missing and no known rule to make it
23 lines
771 B
TypeScript
23 lines
771 B
TypeScript
const { connect } = require('react-redux');
|
|
const SideMenu_ = require('react-native-side-menu-updated').default;
|
|
import { Dimensions } from 'react-native';
|
|
import { State } from '@joplin/lib/reducer';
|
|
|
|
class SideMenuComponent extends SideMenu_ {
|
|
public onLayoutChange(e: any) {
|
|
const { width, height } = e.nativeEvent.layout;
|
|
const openMenuOffsetPercentage = this.props.openMenuOffset / Dimensions.get('window').width;
|
|
const openMenuOffset = width * openMenuOffsetPercentage;
|
|
const hiddenMenuOffset = width * this.state.hiddenMenuOffsetPercentage;
|
|
this.setState({ width, height, openMenuOffset, hiddenMenuOffset });
|
|
}
|
|
}
|
|
|
|
const SideMenu = connect((state: State) => {
|
|
return {
|
|
isOpen: state.showSideMenu,
|
|
};
|
|
})(SideMenuComponent);
|
|
|
|
export default SideMenu;
|