|
|
@ -6,6 +6,7 @@ import { |
|
|
|
SafeAreaView, |
|
|
|
SafeAreaView, |
|
|
|
Platform, |
|
|
|
Platform, |
|
|
|
StatusBar, |
|
|
|
StatusBar, |
|
|
|
|
|
|
|
Text, |
|
|
|
} from "react-native"; |
|
|
|
} from "react-native"; |
|
|
|
import { connect } from "react-redux"; |
|
|
|
import { connect } from "react-redux"; |
|
|
|
import { faq } from "../../redux/actions"; |
|
|
|
import { faq } from "../../redux/actions"; |
|
|
@ -23,7 +24,7 @@ import Instance from "./components/Instance"; |
|
|
|
//assets
|
|
|
|
//assets
|
|
|
|
import bgFaq from "./assets/faq.png"; |
|
|
|
import bgFaq from "./assets/faq.png"; |
|
|
|
|
|
|
|
|
|
|
|
const {width, height} = Dimensions.get("window"); |
|
|
|
const { width, height } = Dimensions.get("window"); |
|
|
|
|
|
|
|
|
|
|
|
function Faq({ list, getFaq, searchResult, search, selectFaq, searchFaq }) { |
|
|
|
function Faq({ list, getFaq, searchResult, search, selectFaq, searchFaq }) { |
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
@ -47,7 +48,7 @@ function Faq({ list, getFaq, searchResult, search, selectFaq, searchFaq }) { |
|
|
|
bookmark: false, |
|
|
|
bookmark: false, |
|
|
|
qr: true, |
|
|
|
qr: true, |
|
|
|
back: true, |
|
|
|
back: true, |
|
|
|
backgroundColor: Colors.theme1['light'].greenCF + "0F", |
|
|
|
backgroundColor: Colors.theme1["light"].greenCF + "0F", |
|
|
|
}} |
|
|
|
}} |
|
|
|
/> |
|
|
|
/> |
|
|
|
<Header |
|
|
|
<Header |
|
|
@ -65,17 +66,27 @@ function Faq({ list, getFaq, searchResult, search, selectFaq, searchFaq }) { |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
<ScrollView |
|
|
|
<ScrollView |
|
|
|
style={[tw("bg-white flex px-4 mb-4")]} |
|
|
|
style={[tw("bg-white flex px-4 mb-4")]} |
|
|
|
contentContainerStyle={{paddingBottom: height / 2.4}} |
|
|
|
contentContainerStyle={{ paddingBottom: height / 2.4 }} |
|
|
|
> |
|
|
|
> |
|
|
|
{!search |
|
|
|
{!search ? ( |
|
|
|
? list.length > 0 && |
|
|
|
list.length && |
|
|
|
list.map((item, index) => ( |
|
|
|
list.map((item, index) => ( |
|
|
|
<Instance key={index} question={item} selectFaq={selectFaq} /> |
|
|
|
<Instance key={index} question={item} selectFaq={selectFaq} /> |
|
|
|
)) |
|
|
|
)) |
|
|
|
: list.length > 0 && |
|
|
|
) : list.length && searchResult.length ? ( |
|
|
|
searchResult.map((item, index) => ( |
|
|
|
searchResult.map((item, index) => ( |
|
|
|
<Instance key={index} question={item} selectFaq={selectFaq} /> |
|
|
|
<Instance key={index} question={item} selectFaq={selectFaq} /> |
|
|
|
))} |
|
|
|
)) |
|
|
|
|
|
|
|
) : ( |
|
|
|
|
|
|
|
<Text |
|
|
|
|
|
|
|
style={[ |
|
|
|
|
|
|
|
tw("w-full text-center mt-10"), |
|
|
|
|
|
|
|
{ fontFamily: "regular", fontSize: width / 24 }, |
|
|
|
|
|
|
|
]} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
سوالی یافت نشد. |
|
|
|
|
|
|
|
</Text> |
|
|
|
|
|
|
|
)} |
|
|
|
</ScrollView> |
|
|
|
</ScrollView> |
|
|
|
</SafeAreaView> |
|
|
|
</SafeAreaView> |
|
|
|
); |
|
|
|
); |
|
|
|