TP-38802 | amount restriction changes (#8214)

This commit is contained in:
Sidharth Bamba
2023-10-11 11:03:07 +05:30
committed by GitHub
parent 6485f2a4e3
commit 6bc713b132
2 changed files with 16 additions and 10 deletions

View File

@@ -40,7 +40,7 @@ fun RequestApprovalSection(
npciClService: NpciClService,
sendMoneyViewModel: SendMoneyViewModel,
naviPayAnalytics: NaviPayAnalytics.NaviPaySendMoney,
mainCtaState : SendMoneyMainCtaState,
mainCtaState: SendMoneyMainCtaState,
onSetPinButtonClick: (String) -> Unit
) {
val context = LocalContext.current
@@ -73,7 +73,6 @@ fun RequestApprovalSection(
horizontalAlignment = Alignment.CenterHorizontally
) {
NaviPaySponsorView(modifier = Modifier)
Spacer(modifier = Modifier.height(16.dp))
Row {
@@ -88,7 +87,7 @@ fun RequestApprovalSection(
text = mainCtaState.ctaText,
enabled = (bankAccountsState is BankAccountsState.AccountList) && mainCtaState !is SendMoneyMainCtaState.Disabled,
) {
when(mainCtaState) {
when (mainCtaState) {
is SendMoneyMainCtaState.Pay -> onApproveClicked()
is SendMoneyMainCtaState.SetPin -> onSetPinButtonClick("DefaultSetPinButton")
else -> {}

View File

@@ -117,7 +117,7 @@ fun SendMoneySection(
}
ConstraintLayout(modifier = modifier) {
val (selectBankAccount, payeeDetails, amountInput, noteInput, doneButton, approvalSection, errorSnackBar) = createRefs()
val (selectBankAccount, payeeDetails, amountInput, noteInput, doneButton, approvalSection, errorSnackBar, sponsorView) = createRefs()
PayeeDetailsView(
modifier = Modifier
@@ -223,11 +223,20 @@ fun SendMoneySection(
}
}
NaviPaySponsorView(modifier = Modifier
.constrainAs(sponsorView) {
start.linkTo(parent.start)
end.linkTo(parent.end)
bottom.linkTo(doneButton.top)
}
.layoutId(sponsorView)
)
ErrorSnackBar(modifier = Modifier
.constrainAs(errorSnackBar) {
start.linkTo(parent.start)
end.linkTo(parent.end)
bottom.linkTo(doneButton.top, 16.dp)
bottom.linkTo(doneButton.top)
}
.padding(horizontal = 16.dp),
show = snackbarState.isVisible,
@@ -254,7 +263,7 @@ fun SendMoneySection(
onSetPinButtonClick = onSetPinButtonClick
)
} else {
PayButtonWithSponsorView(
PayButton(
modifier = Modifier
.constrainAs(doneButton) {
start.linkTo(parent.start)
@@ -512,7 +521,7 @@ private fun NoAccountLinkedView(modifier: Modifier) {
}
@Composable
private fun PayButtonWithSponsorView(
private fun PayButton(
modifier: Modifier,
mainCtaState: SendMoneyMainCtaState,
onPayButtonClick: (String) -> Unit,
@@ -525,15 +534,13 @@ private fun PayButtonWithSponsorView(
.padding(horizontal = 16.dp, vertical = 16.dp),
horizontalAlignment = Alignment.CenterHorizontally
) {
NaviPaySponsorView(modifier = Modifier)
Spacer(modifier = Modifier.height(12.dp))
ThemeRoundedButton(
modifier = Modifier
.fillMaxWidth(),
enabled = mainCtaState !is SendMoneyMainCtaState.Disabled,
text = mainCtaState.ctaText
) {
when(mainCtaState){
when (mainCtaState) {
is SendMoneyMainCtaState.Pay -> onPayButtonClick("DefaultPayButton")
is SendMoneyMainCtaState.SetPin -> onSetPinButtonClick("DefaultSetPinButton")
else -> {}