|
|
|
@ -67,31 +67,30 @@ function Faq({ list, getFaq, searchResult, search, selectFaq, searchFaq }) { |
|
|
|
|
placeholder={"بخشی از پرسش خود را اینجا بنویسید"} |
|
|
|
|
/> |
|
|
|
|
</View> |
|
|
|
|
{/* {search && searchResult.length !== 0 && ( |
|
|
|
|
<FlatList |
|
|
|
|
style={[tw("bg-white flex px-4 mb-4")]} |
|
|
|
|
data={searchResult} |
|
|
|
|
keyExtractor={(item, index) => { |
|
|
|
|
return index; |
|
|
|
|
}} |
|
|
|
|
renderItem={({ item }) => ( |
|
|
|
|
<Instance question={item} selectFaq={selectFaq} /> |
|
|
|
|
)} |
|
|
|
|
/> |
|
|
|
|
)} */} |
|
|
|
|
{search ? ( |
|
|
|
|
<FlatList |
|
|
|
|
contentContainerStyle={{ paddingBottom: height / 2 }} |
|
|
|
|
style={[tw("bg-white flex px-4 mb-4")]} |
|
|
|
|
data={searchResult} |
|
|
|
|
keyExtractor={(item, index) => { |
|
|
|
|
return index; |
|
|
|
|
}} |
|
|
|
|
renderItem={({ item }) => ( |
|
|
|
|
<Instance question={item} selectFaq={selectFaq} /> |
|
|
|
|
)} |
|
|
|
|
initialNumToRender={10} |
|
|
|
|
/> |
|
|
|
|
{search.length ? ( |
|
|
|
|
searchResult?.length ? ( |
|
|
|
|
<FlatList |
|
|
|
|
contentContainerStyle={{ paddingBottom: height / 2 }} |
|
|
|
|
style={[tw("bg-white flex px-4 mb-4")]} |
|
|
|
|
data={searchResult} |
|
|
|
|
keyExtractor={(item, index) => { |
|
|
|
|
return index; |
|
|
|
|
}} |
|
|
|
|
renderItem={({ item }) => ( |
|
|
|
|
<Instance question={item} selectFaq={selectFaq} /> |
|
|
|
|
)} |
|
|
|
|
initialNumToRender={10} |
|
|
|
|
/> |
|
|
|
|
) : ( |
|
|
|
|
<Text |
|
|
|
|
style={[ |
|
|
|
|
tw("w-full px-4 mt-10 text-center"), |
|
|
|
|
{ fontFamily: "bold" }, |
|
|
|
|
]} |
|
|
|
|
> |
|
|
|
|
موردی یافت نشد. |
|
|
|
|
</Text> |
|
|
|
|
) |
|
|
|
|
) : ( |
|
|
|
|
<FlatList |
|
|
|
|
contentContainerStyle={{ paddingBottom: height / 2 }} |
|
|
|
@ -106,13 +105,6 @@ function Faq({ list, getFaq, searchResult, search, selectFaq, searchFaq }) { |
|
|
|
|
initialNumToRender={10} |
|
|
|
|
/> |
|
|
|
|
)} |
|
|
|
|
{/* {search && searchResult.length === 0 && ( |
|
|
|
|
<Text |
|
|
|
|
style={[tw("w-full px-4 mt-10 text-center"), { fontFamily: "bold" }]} |
|
|
|
|
> |
|
|
|
|
موردی یافت نشد. |
|
|
|
|
</Text> |
|
|
|
|
)} */} |
|
|
|
|
</SafeAreaView> |
|
|
|
|
) : null; |
|
|
|
|
} |
|
|
|
|