Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

optimize SideMenu for tablet

ammarahm-edd0eb452123da
diff --git a/apps/mobile/src/components/Menu/ColorSection.js b/apps/mobile/src/components/Menu/ColorSection.js
index 5ff76283e..6dc22eb9d 100644
--- a/apps/mobile/src/components/Menu/ColorSection.js
+++ b/apps/mobile/src/components/Menu/ColorSection.js
@@ -93,7 +93,7 @@ const ColorItem = ({item, index}) => {
}}>
<View
style={{
- width: 35,
+ width: 30,
justifyContent: 'center',
alignItems: 'flex-start',
}}>
diff --git a/apps/mobile/src/components/Menu/MenuListItem.js b/apps/mobile/src/components/Menu/MenuListItem.js
index 4585cb3d9..c1fa4d940 100644
--- a/apps/mobile/src/components/Menu/MenuListItem.js
+++ b/apps/mobile/src/components/Menu/MenuListItem.js
@@ -74,7 +74,7 @@ export const MenuListItem = ({item, index, noTextMode, testID, rightBtn}) => {
}}>
<Icon
style={{
- width: 35,
+ width: 30,
textAlignVertical: 'center',
textAlign: 'left',
}}
diff --git a/apps/mobile/src/components/Menu/TagsSection.js b/apps/mobile/src/components/Menu/TagsSection.js
index f824d7778..026440754 100644
--- a/apps/mobile/src/components/Menu/TagsSection.js
+++ b/apps/mobile/src/components/Menu/TagsSection.js
@@ -170,7 +170,7 @@ const PinItem = ({item, index, onPress}) => {
}}>
<View
style={{
- width: 35,
+ width: 30,
justifyContent: 'center',
}}>
<Icon color={color} size={SIZE.lg - 2} name={icons[item.type]} />
diff --git a/apps/mobile/src/components/Menu/UserSection.js b/apps/mobile/src/components/Menu/UserSection.js
index 39a4c376f..035546541 100644
--- a/apps/mobile/src/components/Menu/UserSection.js
+++ b/apps/mobile/src/components/Menu/UserSection.js
@@ -1,7 +1,7 @@
import React from 'react';
-import { Platform } from 'react-native';
+import {Platform} from 'react-native';
import {ActivityIndicator, TouchableOpacity, View} from 'react-native';
-import { useSafeAreaInsets } from 'react-native-safe-area-context';
+import {useSafeAreaInsets} from 'react-native-safe-area-context';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import {useTracked} from '../../provider';
import {DDS} from '../../services/DeviceDetection';
@@ -23,13 +23,13 @@ export const UserSection = ({noTextMode}) => {
width: '100%',
alignSelf: 'center',
backgroundColor: colors.nav,
- paddingBottom:Platform.OS === "ios" ? insets.bottom/2 : null
+ paddingBottom: Platform.OS === 'ios' ? insets.bottom / 2 : null,
}}>
<View
style={{
- flexDirection: 'row',
+ flexDirection: DDS.isLargeTablet() ? 'column' : 'row',
justifyContent: 'space-between',
- alignItems: 'center',
+ alignItems: DDS.isLargeTablet() ? 'flex-start' : 'center',
paddingRight: 8,
paddingLeft: 8,
}}>
@@ -38,9 +38,9 @@ export const UserSection = ({noTextMode}) => {
onPress={() => {
if (user) {
ToastEvent.show({
- title: 'Logged in as ' + user?.email,
+ heading: 'Logged in as ' + user?.email,
type: 'success',
- context: 'local',
+ context: 'global',
});
} else {
eSendEvent(eOpenLoginDialog);
@@ -49,7 +49,8 @@ export const UserSection = ({noTextMode}) => {
style={{
flexDirection: 'row',
alignItems: 'center',
- paddingVertical: 10,
+ paddingVertical: DDS.isLargeTablet() ? 5 : 10,
+ paddingTop: 10,
}}>
<Icon
style={{
@@ -80,11 +81,12 @@ export const UserSection = ({noTextMode}) => {
{user && (
<TouchableOpacity
activeOpacity={0.8}
- onPress={() => Sync.run()}
+ onPress={() => Sync.run()}
style={{
flexDirection: 'row',
alignItems: 'center',
- paddingVertical: 10,
+ paddingVertical: DDS.isLargeTablet() ? 0 : 10,
+ paddingBottom: 10,
}}>
<Paragraph
style={{
diff --git a/apps/mobile/src/components/Menu/index.js b/apps/mobile/src/components/Menu/index.js
index c6b0554ec..064d64022 100644
--- a/apps/mobile/src/components/Menu/index.js
+++ b/apps/mobile/src/components/Menu/index.js
@@ -5,6 +5,7 @@ import {useSafeAreaInsets} from 'react-native-safe-area-context';
import {notesnook} from '../../../e2e/test.ids';
import {useTracked} from '../../provider';
import {Actions} from '../../provider/Actions';
+import {DDS} from '../../services/DeviceDetection';
import {DrawerScale} from '../../utils/Animations';
import {
ACCENT,
@@ -72,7 +73,7 @@ export const Menu = React.memo(
borderRadius: 10,
transform: [
{
- scale:deviceMode !== 'mobile' ? 1 : DrawerScale,
+ scale: deviceMode !== 'mobile' ? 1 : DrawerScale,
},
],
}}>
@@ -104,20 +105,22 @@ export const Menu = React.memo(
)}
/>
- {BottomItemsList.slice(1, 2).map((item, index) => (
- <MenuListItem
- testID={
- item.name == 'Night mode'
- ? notesnook.ids.menu.nightmode
- : item.name
- }
- key={item.name}
- item={item}
- index={index}
- ignore={true}
- rightBtn={BottomItemsList[0]}
- />
- ))}
+ {BottomItemsList.slice(DDS.isLargeTablet() ? 0 : 1, 2).map(
+ (item, index) => (
+ <MenuListItem
+ testID={
+ item.name == 'Night mode'
+ ? notesnook.ids.menu.nightmode
+ : item.name
+ }
+ key={item.name}
+ item={item}
+ index={index}
+ ignore={true}
+ rightBtn={DDS.isLargeTablet() ? null : BottomItemsList[0]}
+ />
+ ),
+ )}
<View
style={{