Skip to content

Commit

Permalink
Layout cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejkorsan committed Mar 21, 2024
1 parent ede2d9b commit fbd40b1
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions ruby_event_store-browser/elm/src/Layout.elm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import WrappedModel exposing (..)
type Msg
= TimeZoneSelected String
| SearchMsg Search.Msg
| KeyPress String Bool Bool
| ToggleBookmarksMenu
| ToggleDialog
| SearchedStreamsFetched (Result Http.Error (List SearchStream))
Expand Down Expand Up @@ -140,17 +139,6 @@ update msg model =
ToggleBookmarksMenu ->
( { model | internal = Model model.internal.search (not model.internal.displayBookmarksMenu) model.internal.bookmarks }, Cmd.none )

KeyPress key isMetaDown isCtrlDown ->
case ( key, isMetaDown, isCtrlDown ) of
( "k", True, False ) ->
( model, toggleDialog searchModalId )

( "k", False, True ) ->
( model, toggleDialog searchModalId )

_ ->
( model, Cmd.none )

ToggleDialog ->
( model, toggleDialog searchModalId )

Expand Down Expand Up @@ -297,7 +285,10 @@ visibleBookmarksMenu displayBookmarksMenu =
bookmarkToHtml : Bookmark -> Html Msg
bookmarkToHtml bookmark =
li []
[ a [ href bookmark.link, class "whitespace-nowrap p-4 hover:bg-gray-100" ] [ text bookmark.label ]
[ a [ href bookmark.link, class "whitespace-nowrap px-4 py-2 block hover:bg-gray-100" ]
[ text bookmark.label
, button [ onClick (ToggleBookmark bookmark.link) ] []
]
]


Expand All @@ -312,10 +303,10 @@ bookmarksMenu model =
|> FeatherIcons.withClass "size-4"
|> FeatherIcons.toHtml []
]
, div [ class ("absolute translate-y-4 right-0 top-full bg-white shadow rounded-lg " ++ visibleBookmarksMenu model.internal.displayBookmarksMenu) ]
, div [ class ("absolute translate-y-4 right-0 top-full bg-white overflow-clip shadow rounded-lg " ++ visibleBookmarksMenu model.internal.displayBookmarksMenu) ]
[ model.internal.bookmarks
|> List.map bookmarkToHtml
|> ul [ class "text-gray-800 text-sm space-y-4" ]
|> ul [ class "text-gray-800 text-sm " ]
]
]

Expand Down

0 comments on commit fbd40b1

Please sign in to comment.