Skip to content

Commit

Permalink
Add support for upgradeURL
Browse files Browse the repository at this point in the history
  • Loading branch information
zwarm committed Jun 10, 2024
1 parent 4d1ed6a commit 8c92669
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,11 @@ fun InEligible(
.fillMaxWidth()
) {
Text(text = stringResource(id = model.message), style = errorMessageStyle)
if (model.urlLink.isBlank().not()) {
if (model.upgradeUrl?.isNotBlank() == true) {
ClickableTextViewWithLinkImage(
text = model.urlMessage,
drawableRight = Drawable(R.drawable.ic_external_white_24dp),
onClick = { model.onLinkTap?.invoke(model.urlLink) }
onClick = { model.onLinkTap?.invoke(model.upgradeUrl) }
)
}
Spacer(modifier = Modifier.height(8.dp))
Expand Down Expand Up @@ -370,7 +370,7 @@ fun PreviewNotEligibleToRecordView() {
isEnabled = false,
isEligibleForFeature = false,
urlMessage = "Upgrade to use this feature",
urlLink = "https://www.wordpress.com"
upgradeUrl = "https://www.wordpress.com"
)
)
VoiceToContentView(state = state, amplitudes = listOf())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ data class RecordingPanelUIModel(
val isEnabled: Boolean = false,
@StringRes val message: Int = R.string.voice_to_content_not_eligible_for_feature,
val urlMessage: String = "",
val urlLink: String = "",
val upgradeUrl: String? = null,
val onLinkTap: ((String) -> Unit)? = null,
@StringRes val actionLabel: Int
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ class VoiceToContentViewModel @Inject constructor(
isEligibleForFeature = isEligibleForFeature,
onMicTap = ::onMicTap,
onRequestPermission = ::onRequestPermission,
hasPermission = hasAllPermissionsForRecording()
hasPermission = hasAllPermissionsForRecording(),
upgradeUrl = model.upgradeUrl
)
)
}
Expand Down

0 comments on commit 8c92669

Please sign in to comment.