@@ -14,30 +14,13 @@ import org.mifos.mobilewallet.mifospay.R
14
14
import org.mifos.mobilewallet.mifospay.designsystem.component.FaqItemScreen
15
15
import org.mifos.mobilewallet.mifospay.designsystem.component.MifosTopBar
16
16
import org.mifos.mobilewallet.mifospay.faq.presenter.FAQViewModel
17
- import org.mifos.mobilewallet.mifospay.utils.FAQUtils.getFAQPreviewList
18
17
19
18
@Composable
20
19
fun FaqScreen (
21
20
navigateBack : () -> Unit ,
22
21
faqViewModel : FAQViewModel = hiltViewModel()
23
22
) {
24
- Column (modifier = Modifier .fillMaxSize()) {
25
- MifosTopBar (
26
- topBarTitle = R .string.frequently_asked_questions,
27
- backPress = { navigateBack.invoke() })
28
- LazyColumn (
29
- modifier = Modifier
30
- .weight(1f )
31
- .fillMaxWidth()
32
- ) {
33
- itemsIndexed(items = faqViewModel.getFAQ()) { _, faqItem ->
34
- FaqItemScreen (
35
- question = stringResource(id = faqItem.question),
36
- answer = faqItem.answer?.let { stringResource(id = it) }
37
- )
38
- }
39
- }
40
- }
23
+ FaqScreen (navigateBack = { navigateBack.invoke() }, faqViewModel.getFAQ())
41
24
}
42
25
43
26
@Composable
@@ -67,5 +50,12 @@ fun FaqScreen(
67
50
@Preview(showSystemUi = true )
68
51
@Composable
69
52
fun FaqScreenPreview () {
70
- FaqScreen ({}, getFAQPreviewList())
53
+ FaqScreen (
54
+ {}, listOf (
55
+ FAQ (R .string.question1, R .string.answer1),
56
+ FAQ (R .string.question2, R .string.answer2),
57
+ FAQ (R .string.question3, R .string.answer3),
58
+ FAQ (R .string.question4, R .string.answer4)
59
+ )
60
+ )
71
61
}
0 commit comments