From e41ccb986acc48c7a5fba80e7226460f6dc55904 Mon Sep 17 00:00:00 2001 From: m Date: Fri, 28 Aug 2026 23:37:53 +0200 Subject: [PATCH] search bar --- mobile/components/SearchBar.tsx | 56 ++------------------------------- 1 file changed, 2 insertions(+), 54 deletions(-) diff --git a/mobile/components/SearchBar.tsx b/mobile/components/SearchBar.tsx index 0a7bd5a..aca41ce 100644 --- a/mobile/components/SearchBar.tsx +++ b/mobile/components/SearchBar.tsx @@ -34,19 +34,7 @@ const FILTER_OPTIONS: { key: keyof SearchFilters; label: string; icon: IconName { key: 'ocrText', label: 'Texte OCR', icon: 'document-scanner' }, ]; -const SORT_OPTIONS: { key: SortKey; label: string; icon: IconName }[] = [ - { key: 'date', label: 'Date', icon: 'schedule' }, - { key: 'name', label: 'Nom', icon: 'sort-by-alpha' }, - { key: 'size', label: 'Taille', icon: 'data-usage' }, -]; - -const SORT_LABELS: Record = { - date: 'Date', - name: 'Nom', - size: 'Taille', -}; - -export function SearchBar({ query, onQueryChange, onClear, filters, onFiltersChange, sort, onSortChange, bottomPadding = 0 }: SearchBarProps) { +export function SearchBar({ query, onQueryChange, onClear, filters, onFiltersChange, sort, bottomPadding = 0 }: SearchBarProps) { const animatedHeight = useRef(new Animated.Value(0)).current; const [panelOpen, setPanelOpen] = React.useState(false); @@ -61,21 +49,13 @@ export function SearchBar({ query, onQueryChange, onClear, filters, onFiltersCha const panelMaxHeight = animatedHeight.interpolate({ inputRange: [0, 1], - outputRange: [0, 260], + outputRange: [0, 150], }); const toggleFilter = (key: keyof SearchFilters) => { onFiltersChange({ ...filters, [key]: !filters[key] }); }; - const selectSort = (key: SortKey) => { - if (sort.key === key) { - onSortChange({ key, direction: sort.direction === 'asc' ? 'desc' : 'asc' }); - } else { - onSortChange({ key, direction: 'desc' }); - } - }; - const hasActiveFilter = filters.name || filters.ocrText || sort.key !== 'date'; return ( @@ -129,33 +109,6 @@ export function SearchBar({ query, onQueryChange, onClear, filters, onFiltersCha ))} - - Trier par - {SORT_OPTIONS.map((opt) => { - const active = sort.key === opt.key; - return ( - selectSort(opt.key)} - > - - - {opt.label} - - - ); - })} - - {sort.key !== 'date' && ( - - Tri : {SORT_LABELS[sort.key]} ({sort.direction === 'asc' ? 'A → Z' : 'Z → A'}) - - )} ); @@ -245,9 +198,4 @@ const styles = StyleSheet.create({ filterChipTextActive: { color: '#fff', }, - sortHint: { - width: '100%', - fontSize: 12, - color: '#999', - }, });