TP-72287 | action check fix (#11645)

This commit is contained in:
Shaurya Rehan
2024-07-02 23:52:38 +05:30
committed by GitHub
parent 1a67eebd64
commit 2e9aad86af
2 changed files with 41 additions and 24 deletions

View File

@@ -20,6 +20,7 @@ import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
@@ -57,7 +58,14 @@ fun FetchedAccountsListBottomSheet(
eventDispatcher: (AccountAdditionScreenContract.Event) -> Unit,
enableAddAccountCtaLoaderState: Boolean
) {
Column(modifier = Modifier.navigationBarsPadding().fillMaxWidth()) {
var selectedItemPosition by remember { mutableIntStateOf(0) }
Column(
modifier =
Modifier.fillMaxWidth()
.wrapContentHeight() // Wrap content height to adjust dynamically
.navigationBarsPadding()
) {
Column(modifier = Modifier.fillMaxWidth().padding(all = 16.dp)) {
Image(
painter = painterResource(id = R.drawable.ic_np_arrow_left_black),
@@ -90,44 +98,50 @@ fun FetchedAccountsListBottomSheet(
color = NaviPayColor.textTertiary
)
}
Divider(
modifier = Modifier.fillMaxWidth(),
color = NaviPayColor.borderAlt,
thickness = 1.dp
)
var selectedItemPosition by remember { mutableIntStateOf(0) }
Column(
modifier = Modifier.fillMaxWidth().weight(1f).verticalScroll(rememberScrollState()),
verticalArrangement = Arrangement.spacedBy(16.dp)
modifier =
Modifier.fillMaxWidth()
.wrapContentHeight()
.verticalScroll(state = rememberScrollState())
) {
repeat(times = accountEntities.size) { position ->
val accountEntity = accountEntities[position]
BankAccountEntityItem(
bankAccountEntity = accountEntity,
onSelected = { selectedItemPosition = position },
isSelected = selectedItemPosition == position
)
}
Divider(
modifier = Modifier.fillMaxWidth(),
color = NaviPayColor.borderAlt,
thickness = 1.dp
)
}
LoaderRoundedButton(
modifier = Modifier.fillMaxWidth().padding(16.dp),
text = stringResource(id = R.string.continue_text),
showLoader = enableAddAccountCtaLoaderState,
lottieFileName = NAVI_PAY_PRIMARY_CTA_LOADER_LOTTIE,
onClick = {
eventDispatcher(
AccountAdditionScreenContract.Event.OnFetchedAccountSelected(
accountEntities[selectedItemPosition]
)
Divider(
modifier = Modifier.fillMaxWidth(),
color = NaviPayColor.borderAlt,
thickness = 1.dp
)
}
)
LoaderRoundedButton(
modifier =
Modifier.fillMaxWidth()
.padding(start = 16.dp, end = 16.dp, top = 32.dp, bottom = 16.dp)
.height(48.dp),
text = stringResource(id = R.string.continue_text),
showLoader = enableAddAccountCtaLoaderState,
lottieFileName = NAVI_PAY_PRIMARY_CTA_LOADER_LOTTIE,
onClick = {
eventDispatcher(
AccountAdditionScreenContract.Event.OnFetchedAccountSelected(
accountEntities[selectedItemPosition]
)
)
}
)
}
}
}

View File

@@ -812,7 +812,10 @@ constructor(
it.accountType == AccountType.UPICREDIT.name
}
if (isOnboardingActionFlowSpecific() && noOfSavingsAccounts != MAX_BANK_ACCOUNTS) {
if (
onboardingActionFromIntent.value == NaviPayOnboardingActionsV2Type.SELF_TRANSFER &&
noOfSavingsAccounts < MAX_BANK_ACCOUNTS
) {
linkedAccounts =
linkedAccounts.filter {
it.accountType == AccountType.CREDIT.name ||