Add a button to close the account view.

This commit is contained in:
Nicolas Perriault 2017-04-22 17:03:35 +02:00
parent d8f5270128
commit 82ada5ede8
No known key found for this signature in database
GPG Key ID: DA5E4C83904F7A2A
3 changed files with 16 additions and 3 deletions

View File

@ -28,7 +28,8 @@ body {
.panel-heading {
font-weight: bold;
}
.panel-heading > .glyphicon {
.panel-heading > .glyphicon,
.panel-heading > .row > .heading > .glyphicon {
margin-right: 8px;
}

View File

@ -35,6 +35,7 @@ type Msg
| UrlChange Navigation.Location
| UseGlobalTimeline Bool
| UserAccount (Result Mastodon.Error Mastodon.Account)
| ClearOpenedAccount
| UserTimeline (Result Mastodon.Error (List Mastodon.Status))
@ -305,6 +306,9 @@ update msg model =
Err error ->
{ model | account = Nothing, errors = (errorText error) :: model.errors } ! []
ClearOpenedAccount ->
{ model | account = Nothing } ! []
StatusPosted _ ->
{ model | draft = defaultDraft } ! [ loadTimelines model.client ]

View File

@ -168,8 +168,16 @@ accountTimelineView account statuses label iconName =
div [ class "col-md-3" ]
[ div [ class "panel panel-default" ]
[ div [ class "panel-heading" ]
[ icon iconName
, text label
[ div [ class "row" ]
[ div [ class "col-xs-9 heading" ] [ icon iconName, text label ]
, div [ class "col-xs-3 text-right" ]
[ a
[ href ""
, ViewHelper.onClickWithPreventAndStop ClearOpenedAccount
]
[ icon "remove" ]
]
]
]
, div [ class "account-detail", style [ ( "background-image", "url('" ++ account.header ++ "')" ) ] ]
[ div [ class "opacity-layer" ]