Skip to content
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

Tweak design of bank account details form #9921

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ internal interface TransformToBankIcon {
StripeR.drawable.stripe_ic_bank_suntrust,
Regex("Silicon Valley Bank", RegexOption.IGNORE_CASE) to
StripeR.drawable.stripe_ic_bank_svb,
Regex("Stripe|TestInstitution", RegexOption.IGNORE_CASE) to
Regex("Stripe|Test Institution", RegexOption.IGNORE_CASE) to
StripeR.drawable.stripe_ic_bank_stripe,
Regex("TD Bank", RegexOption.IGNORE_CASE) to
StripeR.drawable.stripe_ic_bank_td,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import androidx.compose.ui.draw.alpha
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -56,6 +57,7 @@ import com.stripe.android.uicore.elements.TextFieldController
import com.stripe.android.uicore.elements.TextFieldSection
import com.stripe.android.uicore.strings.resolve
import com.stripe.android.uicore.stripeColors
import com.stripe.android.uicore.stripeTypography
import com.stripe.android.uicore.utils.collectAsState
import com.stripe.android.R as StripeR
import com.stripe.android.ui.core.R as PaymentsUiCoreR
Expand Down Expand Up @@ -405,14 +407,32 @@ private fun AccountDetailsForm(
modifier = Modifier.size(24.dp),
)

Text(
text = "$bankName •••• $last4",
color = MaterialTheme.stripeColors.onComponent,
overflow = TextOverflow.Ellipsis,
Column(
modifier = Modifier
.alpha(if (isProcessing) 0.5f else 1f)
.weight(1f, fill = false),
)
) {
if (bankName != null) {
Text(
text = bankName,
style = MaterialTheme.typography.body1.copy(
fontWeight = FontWeight(MaterialTheme.stripeTypography.fontWeightMedium),
),
color = MaterialTheme.stripeColors.onComponent,
overflow = TextOverflow.Ellipsis,
maxLines = 1,
)
}

Text(
text = "••••${last4.orEmpty()}",
style = MaterialTheme.typography.caption.copy(
fontWeight = FontWeight(MaterialTheme.stripeTypography.fontWeightNormal),
),
color = MaterialTheme.stripeColors.placeholderText,
maxLines = 1,
)
}

promoBadgeState?.let { badgeState ->
PromoBadge(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ internal class AccountPreviewScreenshotTest {
sessionId = "session_1234",
promoText = "$5",
eligibleForPromo = false,
bankName = "SuperDuperUltraLongBankName",
bankName = "SuperDuperUltraLongBankNameOMG",
),
instantDebits = true,
isPaymentFlow = true,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading