Skip to content

Commit

Permalink
ui: remove show documentation when no documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ghivert committed Jul 17, 2024
1 parent a98c725 commit 7e4db42
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions apps/frontend/src/frontend/view/body/search_result.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -102,25 +102,29 @@ fn view(model: Model) -> element.Element(Msg) {
),
h.div([a.class("external-icon-wrapper")], [icons.external_link()]),
]),
h.button(
[
a.class("search-details-arrow-expand"),
a.attribute("data-opened", bool.to_string(model.opened)),
e.on_click(ToggleOpen),
],
[
h.span([], [
element.text(
case model.opened {
True -> "Hide"
False -> "Show"
}
<> " documentation",
),
]),
icons.arrow(),
],
),
case item.documentation, item.metadata.implementations {
"", option.None -> element.none()
_, _ ->
h.button(
[
a.class("search-details-arrow-expand"),
a.attribute("data-opened", bool.to_string(model.opened)),
e.on_click(ToggleOpen),
],
[
h.span([], [
element.text(
case model.opened {
True -> "Hide"
False -> "Show"
}
<> " documentation",
),
]),
icons.arrow(),
],
)
},
]),
h.div([a.class("search-body")], [
h.code([a.class("signature")], signature.view_signature(item)),
Expand Down

0 comments on commit 7e4db42

Please sign in to comment.