Skip to content

Commit

Permalink
[MOBILESDK-2480]update text style for bacs secondary button type (#9745)
Browse files Browse the repository at this point in the history
* update text style for bacs secondary button type

* screenshots for screenshot tests

* Apply suggestions from code review

Capitalize comment and add period

Co-authored-by: Bella Koch <160939932+amk-stripe@users.noreply.github.com>
  • Loading branch information
tianzhao-stripe and amk-stripe authored Dec 6, 2024
1 parent ff9c0f9 commit 947351b
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import com.stripe.android.common.ui.PrimaryButton
import com.stripe.android.uicore.StripeTheme
import com.stripe.android.uicore.getComposeTextStyle

@Composable
internal fun BacsMandateButton(type: BacsMandateButtonType, label: String, onClick: () -> Unit) {
Expand All @@ -18,16 +20,26 @@ internal fun BacsMandateButton(type: BacsMandateButtonType, label: String, onCli
isEnabled = true,
onButtonClick = onClick
)
BacsMandateButtonType.Secondary -> TextButton(
modifier = Modifier.fillMaxWidth(),
shape = MaterialTheme.shapes.small,
colors = ButtonDefaults.buttonColors(
backgroundColor = Color.Transparent,
contentColor = MaterialTheme.colors.primary
),
onClick = onClick
) {
Text(text = label)
BacsMandateButtonType.Secondary -> {
// Use the same text style as the primary button but a different color.
val textStyle = StripeTheme.primaryButtonStyle.getComposeTextStyle().copy(
color = MaterialTheme.colors.primary
)

TextButton(
modifier = Modifier.fillMaxWidth(),
shape = MaterialTheme.shapes.small,
colors = ButtonDefaults.buttonColors(
backgroundColor = Color.Transparent,
contentColor = MaterialTheme.colors.primary
),
onClick = onClick
) {
Text(
text = label,
style = textStyle
)
}
}
}
}
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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 947351b

Please sign in to comment.