Skip to content

Commit 9aa44a1

Browse files
committed
fix(mobile): hide "Create Note" button in filtered views
Fixes #37 Only show "Create Note" button in: - All Notes view - Folder views Hide the button in filtered views where creating notes doesn't make contextual sense: - Public view - Starred view - Archived view - Trash view (shows "Empty Trash" instead)
1 parent 83112b3 commit 9aa44a1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

apps/mobile/v1/src/screens/FolderNotes/components/NotesList/NotesHeader.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export const NotesHeader: React.FC<NotesHeaderProps> = ({
5555

5656
{/* Create Note Button / Empty Trash Button - Full width to match note list */}
5757
{viewType === 'trash' ? (
58+
// Show "Empty Trash" button only in trash view
5859
filteredNotesCount > 0 && (
5960
<View style={styles.buttonWrapper}>
6061
<GlassView glassEffectStyle="regular" style={[styles.createNoteButtonGlass, { backgroundColor: theme.isDark ? 'rgba(255, 255, 255, 0.01)' : 'rgba(0, 0, 0, 0.01)' }]}>
@@ -70,7 +71,8 @@ export const NotesHeader: React.FC<NotesHeaderProps> = ({
7071
</GlassView>
7172
</View>
7273
)
73-
) : (
74+
) : (viewType === 'all' || !viewType) ? (
75+
// Show "Create Note" button only in "All Notes" view or folder views (no viewType)
7476
<View style={styles.buttonWrapper} ref={createNoteButtonRef} collapsable={false}>
7577
<GlassView glassEffectStyle="regular" style={[styles.createNoteButtonGlass, { backgroundColor: theme.isDark ? 'rgba(255, 255, 255, 0.01)' : 'rgba(0, 0, 0, 0.01)' }]}>
7678
<Pressable
@@ -84,7 +86,7 @@ export const NotesHeader: React.FC<NotesHeaderProps> = ({
8486
</Pressable>
8587
</GlassView>
8688
</View>
87-
)}
89+
) : null}
8890
</View>
8991
);
9092
};

0 commit comments

Comments
 (0)