Skip to content

Instantly share code, notes, and snippets.

@enyciaa
Last active December 5, 2021 16:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enyciaa/e9720ff5d76ee5494b2731fe170a709f to your computer and use it in GitHub Desktop.
Save enyciaa/e9720ff5d76ee5494b2731fe170a709f to your computer and use it in GitHub Desktop.
// Jetpack Compose
@Composable
fun CallToAction(
modifier: Modifier = Modifier,
screenCallToActionViewState: ScreenCallToActionViewState,
onClicked: () -> Unit,
) {
Button(
modifier = modifier,
shape = MaterialTheme.shapes.small,
onClick = onClicked,
) {
Text(
text = screenCallToActionViewState.buttonText,
style = MaterialTheme.typography.button,
)
}
}
// SwiftUI
struct CallToAction: View {
let screenCallToActionViewState: ScreenCallToActionViewState
let onCallToActionTapped: () -> Void
var body: some View {
Button(
screenCallToActionViewState.buttonText,
action: onCallToActionTapped
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment