mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-24 04:00:59 +01:00
mobile: minor cleanup
This commit is contained in:
committed by
Abdullah Atta
parent
74b5e42492
commit
952a484994
@@ -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}
|
||||
|
||||
@@ -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]
|
||||
);
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user