-
Notifications
You must be signed in to change notification settings - Fork 659
Feature Terms Steps for Recurring Deposit account Flow. 551 #2544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
b776b40
65c30ac
2b1d86f
76e90eb
cc0d0cf
934483f
1ba1622
ba5794f
ca7accb
95f4838
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,26 +10,124 @@ | |
| package com.mifos.feature.recurringDeposit.newRecurringDepositAccount.pages | ||
|
|
||
| import androidclient.feature.recurringdeposit.generated.resources.Res | ||
| import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_next_button | ||
| import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_terms_page | ||
| import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_back | ||
| import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_calculation_days_in_year | ||
| import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_interest_calculation | ||
| import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_interest_compounding_period | ||
| import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_interest_posting_period | ||
| import androidclient.feature.recurringdeposit.generated.resources.feature_recurring_deposit_next | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.Spacer | ||
| import androidx.compose.foundation.layout.height | ||
| import androidx.compose.material3.Button | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.unit.dp | ||
| import com.mifos.core.designsystem.component.MifosTextFieldDropdown | ||
| import com.mifos.core.designsystem.theme.DesignToken | ||
| import com.mifos.core.ui.components.MifosTwoButtonRow | ||
| import com.mifos.feature.recurringDeposit.newRecurringDepositAccount.RecurringAccountAction | ||
| import com.mifos.feature.recurringDeposit.newRecurringDepositAccount.RecurringAccountState | ||
| import org.jetbrains.compose.resources.stringResource | ||
|
|
||
| @Composable | ||
| fun TermsPage(onNext: () -> Unit) { | ||
| fun TermsPage( | ||
| state: RecurringAccountState, | ||
| onAction: (RecurringAccountAction) -> Unit, | ||
| ) { | ||
|
|
||
| Column(horizontalAlignment = Alignment.CenterHorizontally) { | ||
| Text(stringResource(Res.string.feature_recurring_deposit_terms_page)) | ||
| Spacer(Modifier.height(8.dp)) | ||
| Button(onClick = onNext) { | ||
| Text(stringResource(Res.string.feature_recurring_deposit_next_button)) | ||
| } | ||
| MifosTextFieldDropdown( | ||
| value = if (state.recurringDepositAccountInterestChart.interestCompoundingPeriodType == null) { | ||
| " " | ||
| } else { | ||
| state.template.interestCompoundingPeriodTypeOptions?.getOrNull(state.recurringDepositAccountInterestChart.interestCompoundingPeriodType)?.value | ||
| ?: "" | ||
| }, | ||
| onValueChanged = { }, | ||
| onOptionSelected = { index, value -> | ||
| onAction( | ||
| RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestCompoundingPeriodType( | ||
| index, | ||
| ), | ||
| ) | ||
| }, | ||
| options = state.template.interestCompoundingPeriodTypeOptions?.map { | ||
| it.value ?: "" | ||
| } ?: emptyList(), | ||
| label = stringResource(Res.string.feature_recurring_deposit_interest_compounding_period), | ||
| ) | ||
| Spacer(modifier = Modifier.height(DesignToken.padding.large)) | ||
| MifosTextFieldDropdown( | ||
| value = if (state.recurringDepositAccountInterestChart.interestPostingPeriodType == null) { | ||
| " " | ||
| } else { | ||
| state.template.interestPostingPeriodTypeOptions?.getOrNull(state.recurringDepositAccountInterestChart.interestPostingPeriodType)?.value | ||
| ?: "" | ||
| }, | ||
| onValueChanged = { }, | ||
| onOptionSelected = { index, value -> | ||
| onAction( | ||
| RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestPostingPeriodType( | ||
| index, | ||
| ), | ||
| ) | ||
| }, | ||
| options = state.template.interestPostingPeriodTypeOptions?.map { | ||
| it.value ?: "" | ||
| } ?: emptyList(), | ||
| label = stringResource(Res.string.feature_recurring_deposit_interest_posting_period), | ||
| ) | ||
| Spacer(modifier = Modifier.height(DesignToken.padding.large)) | ||
| MifosTextFieldDropdown( | ||
| value = if (state.recurringDepositAccountInterestChart.interestCalculationType == null) { | ||
| " " | ||
| } else { | ||
| state.template.interestCalculationTypeOptions?.getOrNull(state.recurringDepositAccountInterestChart.interestCalculationType)?.value | ||
| ?: "" | ||
| }, | ||
| onValueChanged = { }, | ||
| onOptionSelected = { index, value -> | ||
| onAction( | ||
| RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestCalculationType( | ||
| index, | ||
| ), | ||
| ) | ||
| }, | ||
| options = state.template.interestCalculationTypeOptions?.map { | ||
| it.value ?: "" | ||
| } ?: emptyList(), | ||
| label = stringResource(Res.string.feature_recurring_deposit_interest_calculation), | ||
| ) | ||
| Spacer(modifier = Modifier.height(DesignToken.padding.large)) | ||
| MifosTextFieldDropdown( | ||
| value = if (state.recurringDepositAccountInterestChart.interestCalculationDaysInYearType == null) { | ||
| " " | ||
| } else { | ||
| state.template.interestCalculationDaysInYearTypeOptions?.getOrNull(state.recurringDepositAccountInterestChart.interestCalculationDaysInYearType)?.value | ||
| ?: "" | ||
| }, | ||
| onValueChanged = { }, | ||
| onOptionSelected = { index, value -> | ||
| onAction( | ||
| RecurringAccountAction.RecurringAccountInterestChartAction.OnInterestCalculationDaysInYearType( | ||
| index, | ||
| ), | ||
| ) | ||
| }, | ||
| options = state.template.interestCalculationDaysInYearTypeOptions?.map { | ||
| it.value ?: "" | ||
| } ?: emptyList(), | ||
| label = stringResource(Res.string.feature_recurring_deposit_calculation_days_in_year), | ||
| ) | ||
|
|
||
| MifosTwoButtonRow( | ||
| firstBtnText = stringResource(Res.string.feature_recurring_deposit_back), | ||
| secondBtnText = stringResource(Res.string.feature_recurring_deposit_next), | ||
| onFirstBtnClick = { onAction(RecurringAccountAction.OnBackPress) }, | ||
| onSecondBtnClick = { onAction(RecurringAccountAction.OnNextPress) }, | ||
| isButtonIconVisible = true, | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think you can use isButtonEnabled some thing like that in MifosTwoButtonRow to make sure next button is enabled only after everything is filled
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. enabled next button |
||
| ) | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.