Skip to content

Commit

Permalink
add disabled UI for links
Browse files Browse the repository at this point in the history
When links are disabled, we show something that looks like a link,
but it's not clickable and has no 👆 pointer icon.
  • Loading branch information
hamen committed Jul 8, 2024
1 parent ce44a85 commit efc4785
Showing 1 changed file with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,15 @@ public open class DefaultInlineMarkdownRenderer(

is InlineMarkdown.Link -> {
withStyles(styling.link.withEnabled(enabled), child) {
val destination = it.nativeNode.destination
val link =
LinkAnnotation.Clickable(
tag = destination,
linkInteractionListener = { _ ->
if (enabled) {
onUrlClicked?.invoke(destination)
}
},
)
pushLink(link)
if (enabled) {
val destination = it.nativeNode.destination
val link =
LinkAnnotation.Clickable(
tag = destination,
linkInteractionListener = { _ -> onUrlClicked?.invoke(destination) },
)
pushLink(link)
}
appendInlineMarkdownFrom(it.children, styling, enabled)
}
}
Expand Down

0 comments on commit efc4785

Please sign in to comment.