Skip to content

Commit

Permalink
Extract list item to view
Browse files Browse the repository at this point in the history
  • Loading branch information
fidel committed Mar 22, 2024
1 parent 372dc97 commit 8424087
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions ruby_event_store-browser/elm/src/Search.elm
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,20 @@ viewStreamList : Model a -> Html Msg
viewStreamList model =
div
[]
[ ul [ class "mt-4 h-80 overflow-auto space-y-2 w-full" ]
(List.map
(\stream ->
li []
[ a
[ class "p-3 block rounded hover:bg-red-200 w-full bg-gray-100 break-words text-xs font-bold font-mono"
, href ("/streams/" ++ stream)
]
[ text stream ]
]
)
model.streams
)
[ ul
[ class "mt-4 overflow-auto space-y-2 w-full" ]
(List.map (\stream -> viewStreamListItem stream) model.streams)
]


viewStreamListItem : Stream -> Html Msg
viewStreamListItem stream =
li []
[ a
[ class "p-3 block rounded hover:bg-red-200 w-full bg-gray-100 break-words text-xs font-bold font-mono"
, href ("/streams/" ++ stream)
]
[ text stream ]
]


Expand Down

0 comments on commit 8424087

Please sign in to comment.