Rename container to wrapper for consistency.

This commit is contained in:
Danila Fedorin 2018-12-10 12:47:40 -08:00
parent 16b83511d6
commit cee113b0dd

View File

@ -34,8 +34,12 @@ baseView : Model -> Html Msg
baseView m = baseView m =
let let
rooms = Maybe.withDefault (Dict.empty) <| Maybe.andThen .join <| m.sync.rooms rooms = Maybe.withDefault (Dict.empty) <| Maybe.andThen .join <| m.sync.rooms
roomList = div [ class "rooms-list" ] <| Dict.values <| Dict.map roomListView rooms
in in
div [] <| Dict.values <| Dict.map roomListView rooms div [ class "rooms-wrapper" ]
[ h2 [] [ text "Rooms" ]
, roomList
]
roomListView : String -> JoinedRoom -> Html Msg roomListView : String -> JoinedRoom -> Html Msg
roomListView s jr = roomListView s jr =
@ -58,7 +62,7 @@ joinedRoomView m roomId jr =
let let
events = Maybe.withDefault [] <| Maybe.andThen .events jr.timeline events = Maybe.withDefault [] <| Maybe.andThen .events jr.timeline
renderedEvents = List.filterMap (eventView m) events renderedEvents = List.filterMap (eventView m) events
eventContainer = eventContainerView m renderedEvents eventWrapper = eventWrapperView m renderedEvents
messageInput = div [] messageInput = div []
[ input [ input
[ type_ "text" [ type_ "text"
@ -68,10 +72,10 @@ joinedRoomView m roomId jr =
, button [ onClick <| SendRoomText roomId ] [ text "Send" ] , button [ onClick <| SendRoomText roomId ] [ text "Send" ]
] ]
in in
div [] [ eventContainer, messageInput ] div [] [ eventWrapper, messageInput ]
eventContainerView : Model -> List (Html Msg) -> Html Msg eventWrapperView : Model -> List (Html Msg) -> Html Msg
eventContainerView m = div [] eventWrapperView m = div []
eventView : Model -> RoomEvent -> Maybe (Html Msg) eventView : Model -> RoomEvent -> Maybe (Html Msg)
eventView m re = case re.type_ of eventView m re = case re.type_ of