Compare commits
No commits in common. "56b4c3b5c5157ecab9fbc04001f6b314b4959675" and "bed42920d8836f1fbf0d309739d453ee7aaef1bd" have entirely different histories.
56b4c3b5c5
...
bed42920d8
|
|
@ -1,51 +1,3 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { StyleSheet, TextInput, View } from "react-native";
|
import { TextInput, View } from "react-native";
|
||||||
import { Ionicons } from "@expo/vector-icons";
|
export function ContentSearchBar({value,onChangeText}:{value:string;onChangeText:(v:string)=>void}){return <View style={{padding:16}}><TextInput value={value} onChangeText={onChangeText} placeholder="Search..." autoCapitalize="none" autoCorrect={false} style={{borderWidth:1,borderRadius:10,padding:10}}/></View>}
|
||||||
import { Colors } from "@/theme";
|
|
||||||
|
|
||||||
export function ContentSearchBar({
|
|
||||||
value,
|
|
||||||
onChangeText,
|
|
||||||
}: {
|
|
||||||
value: string;
|
|
||||||
onChangeText: (v: string) => void;
|
|
||||||
}) {
|
|
||||||
return (
|
|
||||||
<View style={styles.container}>
|
|
||||||
<View style={styles.searchBox}>
|
|
||||||
<Ionicons name="search" size={18} color={Colors.primaryDark} />
|
|
||||||
<TextInput
|
|
||||||
value={value}
|
|
||||||
onChangeText={onChangeText}
|
|
||||||
placeholder="Search…"
|
|
||||||
placeholderTextColor={Colors.textSecondary}
|
|
||||||
autoCapitalize="none"
|
|
||||||
autoCorrect={false}
|
|
||||||
style={styles.input}
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
|
||||||
container: {
|
|
||||||
padding: 16,
|
|
||||||
},
|
|
||||||
searchBox: {
|
|
||||||
flexDirection: "row",
|
|
||||||
alignItems: "center",
|
|
||||||
gap: 8,
|
|
||||||
borderWidth: 1,
|
|
||||||
borderColor: Colors.border,
|
|
||||||
borderRadius: 10,
|
|
||||||
paddingHorizontal: 12,
|
|
||||||
backgroundColor: "#FAFAFA",
|
|
||||||
},
|
|
||||||
input: {
|
|
||||||
flex: 1,
|
|
||||||
paddingVertical: 10,
|
|
||||||
fontSize: 14,
|
|
||||||
color: Colors.textPrimary,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
|
||||||
|
|
@ -1,52 +1,3 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { StyleSheet, TextInput, View } from "react-native";
|
import { TextInput, View } from "react-native";
|
||||||
import { Ionicons } from "@expo/vector-icons";
|
export function SearchHeader({value,onChangeText,placeholder="Search…"}:{value:string;onChangeText:(v:string)=>void;placeholder?:string}){ return <View style={{padding:12}}><TextInput value={value} onChangeText={onChangeText} placeholder={placeholder} autoCorrect={false} style={{borderWidth:1,borderRadius:10,paddingHorizontal:12,paddingVertical:10,fontSize:16}}/></View>; }
|
||||||
import { Colors } from "@/theme";
|
|
||||||
|
|
||||||
export function SearchHeader({
|
|
||||||
value,
|
|
||||||
onChangeText,
|
|
||||||
placeholder = "Search…",
|
|
||||||
}: {
|
|
||||||
value: string;
|
|
||||||
onChangeText: (v: string) => void;
|
|
||||||
placeholder?: string;
|
|
||||||
}) {
|
|
||||||
return (
|
|
||||||
<View style={styles.container}>
|
|
||||||
<View style={styles.searchBox}>
|
|
||||||
<Ionicons name="search" size={18} color={Colors.primaryDark} />
|
|
||||||
<TextInput
|
|
||||||
value={value}
|
|
||||||
onChangeText={onChangeText}
|
|
||||||
placeholder={placeholder}
|
|
||||||
placeholderTextColor={Colors.textSecondary}
|
|
||||||
autoCorrect={false}
|
|
||||||
style={styles.input}
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
|
||||||
container: {
|
|
||||||
padding: 12,
|
|
||||||
},
|
|
||||||
searchBox: {
|
|
||||||
flexDirection: "row",
|
|
||||||
alignItems: "center",
|
|
||||||
gap: 8,
|
|
||||||
borderWidth: 1,
|
|
||||||
borderColor: Colors.border,
|
|
||||||
borderRadius: 10,
|
|
||||||
paddingHorizontal: 12,
|
|
||||||
backgroundColor: "#FAFAFA",
|
|
||||||
},
|
|
||||||
input: {
|
|
||||||
flex: 1,
|
|
||||||
paddingVertical: 10,
|
|
||||||
fontSize: 16,
|
|
||||||
color: Colors.textPrimary,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ export function CollectionTemplateScreen({
|
||||||
}
|
}
|
||||||
style={({ pressed }) => [styles.iconButton, pressed && styles.pressed]}
|
style={({ pressed }) => [styles.iconButton, pressed && styles.pressed]}
|
||||||
>
|
>
|
||||||
<Ionicons name="search" size={22} color={Colors.primaryDark} />
|
<Ionicons name="search" size={21} color={Colors.textPrimary} />
|
||||||
</Pressable>
|
</Pressable>
|
||||||
|
|
||||||
{hasSort ? (
|
{hasSort ? (
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ export function FacetValueTypeaheadModal({ visible, facet, scope, activeFilters,
|
||||||
const apply = () => { if(!selected.size) return; onApply({ facet_code: facet.code, values:[...selected.keys()], value_mode:"any", display_values:[...selected.values()] }); close(); };
|
const apply = () => { if(!selected.size) return; onApply({ facet_code: facet.code, values:[...selected.keys()], value_mode:"any", display_values:[...selected.values()] }); close(); };
|
||||||
return <Modal visible={visible} animationType="slide" transparent onRequestClose={close}><View style={styles.overlay}><Pressable style={styles.scrim} onPress={close}/><View style={styles.sheet}>
|
return <Modal visible={visible} animationType="slide" transparent onRequestClose={close}><View style={styles.overlay}><Pressable style={styles.scrim} onPress={close}/><View style={styles.sheet}>
|
||||||
<View style={styles.header}><View><Text style={styles.title}>{facet.label}</Text><Text style={styles.subtitle}>Select {facet.allow_multiple_values ? "one or more values" : "a value"}</Text></View><Pressable onPress={close}><Ionicons name="close" size={22} color={Colors.textPrimary}/></Pressable></View>
|
<View style={styles.header}><View><Text style={styles.title}>{facet.label}</Text><Text style={styles.subtitle}>Select {facet.allow_multiple_values ? "one or more values" : "a value"}</Text></View><Pressable onPress={close}><Ionicons name="close" size={22} color={Colors.textPrimary}/></Pressable></View>
|
||||||
<View style={styles.search}><Ionicons name="search" size={18} color={Colors.primaryDark}/><TextInput value={query} onChangeText={setQuery} placeholder={`Search ${facet.label.toLowerCase()}…`} placeholderTextColor={Colors.textSecondary} style={styles.input}/></View>
|
<View style={styles.search}><Ionicons name="search" size={18} color={Colors.textSecondary}/><TextInput value={query} onChangeText={setQuery} placeholder={`Search ${facet.label.toLowerCase()}…`} placeholderTextColor={Colors.textSecondary} style={styles.input}/></View>
|
||||||
<ScrollView contentContainerStyle={styles.content}>{values.isLoading ? <ActivityIndicator color={Colors.primary}/> : values.data?.items.map((item) => { const active=selected.has(item.value_key); return <Pressable key={item.value_key} style={[styles.valueRow,active&&styles.valueRowActive]} onPress={() => toggle(item.value_key,item.label)}><View style={{flex:1}}><Text style={styles.valueLabel}>{item.label}</Text><Text style={styles.count}>{item.result_count} matching item{item.result_count===1?"":"s"}</Text></View><Ionicons name={active?"checkbox":"square-outline"} size={20} color={active?Colors.primary:Colors.textSecondary}/></Pressable>; })}</ScrollView>
|
<ScrollView contentContainerStyle={styles.content}>{values.isLoading ? <ActivityIndicator color={Colors.primary}/> : values.data?.items.map((item) => { const active=selected.has(item.value_key); return <Pressable key={item.value_key} style={[styles.valueRow,active&&styles.valueRowActive]} onPress={() => toggle(item.value_key,item.label)}><View style={{flex:1}}><Text style={styles.valueLabel}>{item.label}</Text><Text style={styles.count}>{item.result_count} matching item{item.result_count===1?"":"s"}</Text></View><Ionicons name={active?"checkbox":"square-outline"} size={20} color={active?Colors.primary:Colors.textSecondary}/></Pressable>; })}</ScrollView>
|
||||||
<View style={styles.footer}><Pressable onPress={close} style={styles.cancel}><Text style={styles.cancelText}>Cancel</Text></Pressable><Pressable onPress={apply} style={[styles.apply,!selected.size&&styles.disabled]} disabled={!selected.size}><Text style={styles.applyText}>Add {selected.size ? `(${selected.size})` : ""}</Text></Pressable></View>
|
<View style={styles.footer}><Pressable onPress={close} style={styles.cancel}><Text style={styles.cancelText}>Cancel</Text></Pressable><Pressable onPress={apply} style={[styles.apply,!selected.size&&styles.disabled]} disabled={!selected.size}><Text style={styles.applyText}>Add {selected.size ? `(${selected.size})` : ""}</Text></Pressable></View>
|
||||||
</View></View></Modal>;
|
</View></View></Modal>;
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,6 @@ export default function FacetedSearchScreen({
|
||||||
const [facetPickerVisible, setFacetPickerVisible] = useState(false);
|
const [facetPickerVisible, setFacetPickerVisible] = useState(false);
|
||||||
const [selectedFacet, setSelectedFacet] =
|
const [selectedFacet, setSelectedFacet] =
|
||||||
useState<SearchFacetDefinition | null>(null);
|
useState<SearchFacetDefinition | null>(null);
|
||||||
const [isSearchFocused, setIsSearchFocused] = useState(false);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isModuleMode || !normalizedModuleCode) return;
|
if (!isModuleMode || !normalizedModuleCode) return;
|
||||||
|
|
@ -177,22 +176,15 @@ export default function FacetedSearchScreen({
|
||||||
</Text>
|
</Text>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
<View
|
<View style={styles.searchBox}>
|
||||||
style={[
|
|
||||||
styles.searchBox,
|
|
||||||
isSearchFocused && styles.searchBoxFocused,
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<Ionicons
|
<Ionicons
|
||||||
name="search"
|
name="search"
|
||||||
size={19}
|
size={19}
|
||||||
color={Colors.primaryDark}
|
color={Colors.textSecondary}
|
||||||
/>
|
/>
|
||||||
<TextInput
|
<TextInput
|
||||||
value={query}
|
value={query}
|
||||||
onChangeText={setQuery}
|
onChangeText={setQuery}
|
||||||
onFocus={() => setIsSearchFocused(true)}
|
|
||||||
onBlur={() => setIsSearchFocused(false)}
|
|
||||||
placeholder={
|
placeholder={
|
||||||
isModuleMode
|
isModuleMode
|
||||||
? `Search within ${resolvedModuleName}…`
|
? `Search within ${resolvedModuleName}…`
|
||||||
|
|
@ -381,10 +373,6 @@ const styles = StyleSheet.create({
|
||||||
paddingHorizontal: 13,
|
paddingHorizontal: 13,
|
||||||
backgroundColor: "#FAFAFA",
|
backgroundColor: "#FAFAFA",
|
||||||
},
|
},
|
||||||
searchBoxFocused: {
|
|
||||||
borderColor: Colors.primary,
|
|
||||||
backgroundColor: "#FFFFFF",
|
|
||||||
},
|
|
||||||
input: {
|
input: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
minHeight: 46,
|
minHeight: 46,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue