mobile: minor cleanup

This commit is contained in:
Ammar Ahmed
2025-02-13 10:59:32 +05:00
committed by Abdullah Atta
parent 74b5e42492
commit 952a484994
3 changed files with 18 additions and 25 deletions

View File

@@ -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}

View File

@@ -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]
);

View File

@@ -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",