Last active
December 5, 2021 16:57
-
-
Save enyciaa/e9720ff5d76ee5494b2731fe170a709f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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