Skip to content

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

mobile: minor cleanup

Ammar Ahmed952a48499441
diff --git a/apps/mobile/app/components/side-menu/index.tsx b/apps/mobile/app/components/side-menu/index.tsx
index 5c8e93df7..80866405f 100644
--- a/apps/mobile/app/components/side-menu/index.tsx
+++ b/apps/mobile/app/components/side-menu/index.tsx
@@ -95,7 +95,6 @@ export const SideMenu = React.memo(
onIndexChange={setIndex}
swipeEnabled={false}
animationEnabled={false}
- lazy={true}
/>
</SafeAreaView>
);
@@ -255,6 +254,7 @@ const TabBar = (
return (
<Pressable
key={route.key}
+ testID={`tab-${route.key}`}
onPress={() => {
props.jumpTo(route.key);
switch (route.key) {
@@ -306,6 +306,7 @@ const TabBar = (
<>
<IconButton
name="plus"
+ testID="sidebar-add-button"
size={AppFontSize.lg - 2}
onPress={() => {
if (props.navigationState.index === 1) {
@@ -346,6 +347,7 @@ const TabBar = (
? "sort-ascending"
: "sort-descending"
}
+ testID="sidebar-sort-button"
color={colors.secondary.icon}
onPress={() => {
presentSheet({
@@ -367,17 +369,6 @@ const TabBar = (
}}
size={AppFontSize.lg - 2}
/>
-
- {/* <IconButton
- name="magnify"
- color={colors.secondary.icon}
- onPress={() => {}}
- style={{
- width: 35,
- height: 35
- }}
- size={SIZE.lg - 2}
- /> */}
</>
) : null}
@@ -390,6 +381,7 @@ const TabBar = (
width: 28,
height: 28
}}
+ testID="sidebar-theme-button"
color={colors.primary.icon}
name={isDark ? "weather-night" : "weather-sunny"}
size={AppFontSize.lg - 2}
diff --git a/apps/mobile/app/components/side-menu/side-menu-notebooks.tsx b/apps/mobile/app/components/side-menu/side-menu-notebooks.tsx
index d33926d22..889c35f29 100644
--- a/apps/mobile/app/components/side-menu/side-menu-notebooks.tsx
+++ b/apps/mobile/app/components/side-menu/side-menu-notebooks.tsx
@@ -202,10 +202,8 @@ const NotebookItem = ({
>
<Pressable
type={isFocused ? "selected" : "transparent"}
- onLongPress={() => {
- onLongPress?.();
- }}
- testID={`notebook-sheet-item-${item.depth}-${index}`}
+ onLongPress={onLongPress}
+ testID={`notebook-item-${item.depth}-${index}`}
onPress={async () => {
if (selectionEnabled) {
if (selected && !nestedNotebooksSelected) {
@@ -243,6 +241,9 @@ const NotebookItem = ({
<IconButton
size={AppFontSize.md}
color={selected ? colors.selected.icon : colors.primary.icon}
+ testID={
+ item.hasChildren ? `expand-notebook-${item.notebook.id}` : ""
+ }
onPress={() => {
if (item.hasChildren) {
onToggleExpanded?.();
@@ -279,8 +280,8 @@ const NotebookItem = ({
{selectionEnabled ? (
<View
style={{
- width: 22,
- height: 22,
+ width: 25,
+ height: 25,
justifyContent: "center",
alignItems: "center"
}}
@@ -293,6 +294,7 @@ const NotebookItem = ({
: "checkbox-outline"
: "checkbox-blank-outline"
}
+ size={AppFontSize.md}
color={selected ? colors.selected.icon : colors.primary.icon}
/>
</View>
@@ -458,7 +460,6 @@ const NotebookItemWrapper = ({
item: TreeItem;
index: number;
}) => {
- const { colors } = useThemeColors();
const expanded = useSideMenuNotebookExpandedStore(
(state) => state.expanded[item.notebook.id]
);
diff --git a/apps/mobile/app/utils/menu-items.ts b/apps/mobile/app/utils/menu-items.ts
index 793d44be4..75c77a6ed 100644
--- a/apps/mobile/app/utils/menu-items.ts
+++ b/apps/mobile/app/utils/menu-items.ts
@@ -70,12 +70,12 @@ export const MenuItemsList: SideMenuItem[] = [
Monographs.navigate();
}
},
- {
- dataType: "note",
- id: "Archive",
- title: "Archive",
- icon: "archive"
- },
+ // {
+ // dataType: "note",
+ // id: "Archive",
+ // title: "Archive",
+ // icon: "archive"
+ // },
{
dataType: "note",
id: "Trash",