@@ -8,11 +8,13 @@ import { useTheme } from '@/src/theme';
88
99export interface FilterConfig {
1010 showAttachmentsOnly : boolean ;
11- showStarredOnly : boolean ;
12- showHiddenOnly : boolean ;
1311 showCodeOnly : boolean ;
1412 showDiagramOnly : boolean ;
13+ showHiddenOnly : boolean ;
14+ showNoteOnly : boolean ;
1515 showPublicOnly : boolean ;
16+ showSheetOnly : boolean ;
17+ showStarredOnly : boolean ;
1618}
1719
1820export interface SortConfig {
@@ -75,85 +77,112 @@ export const FilterSortSheet = forwardRef<BottomSheetModal, FilterSortSheetProps
7577 < Text style = { [ styles . inputLabel , { color : theme . colors . mutedForeground } ] } > FILTER</ Text >
7678 < TouchableOpacity
7779 style = { [ styles . viewModeButton , { backgroundColor : theme . colors . muted , opacity : hasActiveFilters ? 1 : 0 } ] }
78- onPress = { ( ) => setFilterConfig ( { showAttachmentsOnly : false , showStarredOnly : false , showHiddenOnly : false , showCodeOnly : false , showDiagramOnly : false , showPublicOnly : false } ) }
80+ onPress = { ( ) => setFilterConfig ( { showAttachmentsOnly : false , showCodeOnly : false , showDiagramOnly : false , showHiddenOnly : false , showNoteOnly : false , showPublicOnly : false , showSheetOnly : false , showStarredOnly : false } ) }
7981 activeOpacity = { 0.7 }
8082 disabled = { ! hasActiveFilters }
8183 >
8284 < Ionicons name = "close" size = { 16 } color = { theme . colors . mutedForeground } />
8385 </ TouchableOpacity >
8486 </ View >
8587
86- < TouchableOpacity
87- style = { [ styles . filterOption , { backgroundColor : filterConfig . showAttachmentsOnly ? 'rgba(59, 130, 246, 0.1)' : 'transparent' } ] }
88- onPress = { ( ) => setFilterConfig ( prev => ( { ...prev , showAttachmentsOnly : ! prev . showAttachmentsOnly } ) ) }
89- >
90- < Ionicons
91- name = { filterConfig . showAttachmentsOnly ? "checkbox" : "square-outline" }
92- size = { 24 }
93- color = { filterConfig . showAttachmentsOnly ? theme . colors . primary : theme . colors . mutedForeground }
94- />
95- < Text style = { [ styles . filterOptionText , { color : theme . colors . foreground } ] } > Attachment</ Text >
96- </ TouchableOpacity >
88+ { /* 2x2 grid layout - Alphabetically ordered */ }
89+ < View style = { styles . filterGrid } >
90+ < TouchableOpacity
91+ style = { [ styles . filterOptionGrid , { backgroundColor : filterConfig . showAttachmentsOnly ? 'rgba(59, 130, 246, 0.1)' : 'transparent' , borderColor : theme . colors . border } ] }
92+ onPress = { ( ) => setFilterConfig ( prev => ( { ...prev , showAttachmentsOnly : ! prev . showAttachmentsOnly } ) ) }
93+ >
94+ < Ionicons
95+ name = { filterConfig . showAttachmentsOnly ? "checkbox" : "square-outline" }
96+ size = { 20 }
97+ color = { filterConfig . showAttachmentsOnly ? theme . colors . primary : theme . colors . mutedForeground }
98+ />
99+ < Text style = { [ styles . filterOptionTextGrid , { color : theme . colors . foreground } ] } > Attachment</ Text >
100+ </ TouchableOpacity >
97101
98- < TouchableOpacity
99- style = { [ styles . filterOption , { backgroundColor : filterConfig . showStarredOnly ? 'rgba(59, 130, 246, 0.1)' : 'transparent' } ] }
100- onPress = { ( ) => setFilterConfig ( prev => ( { ...prev , showStarredOnly : ! prev . showStarredOnly } ) ) }
101- >
102- < Ionicons
103- name = { filterConfig . showStarredOnly ? "checkbox" : "square-outline" }
104- size = { 24 }
105- color = { filterConfig . showStarredOnly ? theme . colors . primary : theme . colors . mutedForeground }
106- />
107- < Text style = { [ styles . filterOptionText , { color : theme . colors . foreground } ] } > Starred </ Text >
108- </ TouchableOpacity >
102+ < TouchableOpacity
103+ style = { [ styles . filterOptionGrid , { backgroundColor : filterConfig . showCodeOnly ? 'rgba(59, 130, 246, 0.1)' : 'transparent' , borderColor : theme . colors . border } ] }
104+ onPress = { ( ) => setFilterConfig ( prev => ( { ...prev , showCodeOnly : ! prev . showCodeOnly } ) ) }
105+ >
106+ < Ionicons
107+ name = { filterConfig . showCodeOnly ? "checkbox" : "square-outline" }
108+ size = { 20 }
109+ color = { filterConfig . showCodeOnly ? theme . colors . primary : theme . colors . mutedForeground }
110+ />
111+ < Text style = { [ styles . filterOptionTextGrid , { color : theme . colors . foreground } ] } > Code </ Text >
112+ </ TouchableOpacity >
109113
110- < TouchableOpacity
111- style = { [ styles . filterOption , { backgroundColor : filterConfig . showHiddenOnly ? 'rgba(59, 130, 246, 0.1)' : 'transparent' } ] }
112- onPress = { ( ) => setFilterConfig ( prev => ( { ...prev , showHiddenOnly : ! prev . showHiddenOnly } ) ) }
113- >
114- < Ionicons
115- name = { filterConfig . showHiddenOnly ? "checkbox" : "square-outline" }
116- size = { 24 }
117- color = { filterConfig . showHiddenOnly ? theme . colors . primary : theme . colors . mutedForeground }
118- />
119- < Text style = { [ styles . filterOptionText , { color : theme . colors . foreground } ] } > Hidden </ Text >
120- </ TouchableOpacity >
114+ < TouchableOpacity
115+ style = { [ styles . filterOptionGrid , { backgroundColor : filterConfig . showDiagramOnly ? 'rgba(59, 130, 246, 0.1)' : 'transparent' , borderColor : theme . colors . border } ] }
116+ onPress = { ( ) => setFilterConfig ( prev => ( { ...prev , showDiagramOnly : ! prev . showDiagramOnly } ) ) }
117+ >
118+ < Ionicons
119+ name = { filterConfig . showDiagramOnly ? "checkbox" : "square-outline" }
120+ size = { 20 }
121+ color = { filterConfig . showDiagramOnly ? theme . colors . primary : theme . colors . mutedForeground }
122+ />
123+ < Text style = { [ styles . filterOptionTextGrid , { color : theme . colors . foreground } ] } > Diagram </ Text >
124+ </ TouchableOpacity >
121125
122- < TouchableOpacity
123- style = { [ styles . filterOption , { backgroundColor : filterConfig . showCodeOnly ? 'rgba(59, 130, 246, 0.1)' : 'transparent' } ] }
124- onPress = { ( ) => setFilterConfig ( prev => ( { ...prev , showCodeOnly : ! prev . showCodeOnly } ) ) }
125- >
126- < Ionicons
127- name = { filterConfig . showCodeOnly ? "checkbox" : "square-outline" }
128- size = { 24 }
129- color = { filterConfig . showCodeOnly ? theme . colors . primary : theme . colors . mutedForeground }
130- />
131- < Text style = { [ styles . filterOptionText , { color : theme . colors . foreground } ] } > Code </ Text >
132- </ TouchableOpacity >
126+ < TouchableOpacity
127+ style = { [ styles . filterOptionGrid , { backgroundColor : filterConfig . showHiddenOnly ? 'rgba(59, 130, 246, 0.1)' : 'transparent' , borderColor : theme . colors . border } ] }
128+ onPress = { ( ) => setFilterConfig ( prev => ( { ...prev , showHiddenOnly : ! prev . showHiddenOnly } ) ) }
129+ >
130+ < Ionicons
131+ name = { filterConfig . showHiddenOnly ? "checkbox" : "square-outline" }
132+ size = { 20 }
133+ color = { filterConfig . showHiddenOnly ? theme . colors . primary : theme . colors . mutedForeground }
134+ />
135+ < Text style = { [ styles . filterOptionTextGrid , { color : theme . colors . foreground } ] } > Hidden </ Text >
136+ </ TouchableOpacity >
133137
134- < TouchableOpacity
135- style = { [ styles . filterOption , { backgroundColor : filterConfig . showDiagramOnly ? 'rgba(59, 130, 246, 0.1)' : 'transparent' } ] }
136- onPress = { ( ) => setFilterConfig ( prev => ( { ...prev , showDiagramOnly : ! prev . showDiagramOnly } ) ) }
137- >
138- < Ionicons
139- name = { filterConfig . showDiagramOnly ? "checkbox" : "square-outline" }
140- size = { 24 }
141- color = { filterConfig . showDiagramOnly ? theme . colors . primary : theme . colors . mutedForeground }
142- />
143- < Text style = { [ styles . filterOptionText , { color : theme . colors . foreground } ] } > Diagram </ Text >
144- </ TouchableOpacity >
138+ < TouchableOpacity
139+ style = { [ styles . filterOptionGrid , { backgroundColor : filterConfig . showNoteOnly ? 'rgba(59, 130, 246, 0.1)' : 'transparent' , borderColor : theme . colors . border } ] }
140+ onPress = { ( ) => setFilterConfig ( prev => ( { ...prev , showNoteOnly : ! prev . showNoteOnly } ) ) }
141+ >
142+ < Ionicons
143+ name = { filterConfig . showNoteOnly ? "checkbox" : "square-outline" }
144+ size = { 20 }
145+ color = { filterConfig . showNoteOnly ? theme . colors . primary : theme . colors . mutedForeground }
146+ />
147+ < Text style = { [ styles . filterOptionTextGrid , { color : theme . colors . foreground } ] } > Note </ Text >
148+ </ TouchableOpacity >
145149
146- < TouchableOpacity
147- style = { [ styles . filterOption , { backgroundColor : filterConfig . showPublicOnly ? 'rgba(59, 130, 246, 0.1)' : 'transparent' } ] }
148- onPress = { ( ) => setFilterConfig ( prev => ( { ...prev , showPublicOnly : ! prev . showPublicOnly } ) ) }
149- >
150- < Ionicons
151- name = { filterConfig . showPublicOnly ? "checkbox" : "square-outline" }
152- size = { 24 }
153- color = { filterConfig . showPublicOnly ? theme . colors . primary : theme . colors . mutedForeground }
154- />
155- < Text style = { [ styles . filterOptionText , { color : theme . colors . foreground } ] } > Public</ Text >
156- </ TouchableOpacity >
150+ < TouchableOpacity
151+ style = { [ styles . filterOptionGrid , { backgroundColor : filterConfig . showPublicOnly ? 'rgba(59, 130, 246, 0.1)' : 'transparent' , borderColor : theme . colors . border } ] }
152+ onPress = { ( ) => setFilterConfig ( prev => ( { ...prev , showPublicOnly : ! prev . showPublicOnly } ) ) }
153+ >
154+ < Ionicons
155+ name = { filterConfig . showPublicOnly ? "checkbox" : "square-outline" }
156+ size = { 20 }
157+ color = { filterConfig . showPublicOnly ? theme . colors . primary : theme . colors . mutedForeground }
158+ />
159+ < Text style = { [ styles . filterOptionTextGrid , { color : theme . colors . foreground } ] } > Public</ Text >
160+ </ TouchableOpacity >
161+
162+ < TouchableOpacity
163+ style = { [ styles . filterOptionGrid , { backgroundColor : filterConfig . showSheetOnly ? 'rgba(59, 130, 246, 0.1)' : 'transparent' , borderColor : theme . colors . border } ] }
164+ onPress = { ( ) => setFilterConfig ( prev => ( { ...prev , showSheetOnly : ! prev . showSheetOnly } ) ) }
165+ >
166+ < Ionicons
167+ name = { filterConfig . showSheetOnly ? "checkbox" : "square-outline" }
168+ size = { 20 }
169+ color = { filterConfig . showSheetOnly ? theme . colors . primary : theme . colors . mutedForeground }
170+ />
171+ < Text style = { [ styles . filterOptionTextGrid , { color : theme . colors . foreground } ] } > Sheet</ Text >
172+ </ TouchableOpacity >
173+
174+ < TouchableOpacity
175+ style = { [ styles . filterOptionGrid , { backgroundColor : filterConfig . showStarredOnly ? 'rgba(59, 130, 246, 0.1)' : 'transparent' , borderColor : theme . colors . border } ] }
176+ onPress = { ( ) => setFilterConfig ( prev => ( { ...prev , showStarredOnly : ! prev . showStarredOnly } ) ) }
177+ >
178+ < Ionicons
179+ name = { filterConfig . showStarredOnly ? "checkbox" : "square-outline" }
180+ size = { 20 }
181+ color = { filterConfig . showStarredOnly ? theme . colors . primary : theme . colors . mutedForeground }
182+ />
183+ < Text style = { [ styles . filterOptionTextGrid , { color : theme . colors . foreground } ] } > Starred</ Text >
184+ </ TouchableOpacity >
185+ </ View >
157186
158187 < Text style = { [ styles . inputLabel , { color : theme . colors . mutedForeground , marginTop : 24 } ] } > SORT BY</ Text >
159188
@@ -257,6 +286,25 @@ const styles = StyleSheet.create({
257286 alignItems : 'center' ,
258287 justifyContent : 'center' ,
259288 } ,
289+ filterGrid : {
290+ flexDirection : 'row' ,
291+ flexWrap : 'wrap' ,
292+ gap : 8 ,
293+ } ,
294+ filterOptionGrid : {
295+ flexDirection : 'row' ,
296+ alignItems : 'center' ,
297+ paddingVertical : 10 ,
298+ paddingHorizontal : 12 ,
299+ borderRadius : 8 ,
300+ borderWidth : 1 ,
301+ width : '48%' ,
302+ gap : 8 ,
303+ } ,
304+ filterOptionTextGrid : {
305+ fontSize : 14 ,
306+ flex : 1 ,
307+ } ,
260308 filterOption : {
261309 flexDirection : 'row' ,
262310 alignItems : 'center' ,
0 commit comments