Skip to content

Commit

Permalink
feat: click on header image (fix #270)
Browse files Browse the repository at this point in the history
  • Loading branch information
vjousse committed Jun 22, 2024
1 parent 6149da2 commit a907f2a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
9 changes: 8 additions & 1 deletion public/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,10 @@ input.form-control[type="file"] {
position: relative;
}

.account-detail .account-header-image a {
cursor: pointer;
}

.account-detail .account-header-image img {
border-radius: 0;
margin: 0;
Expand All @@ -784,12 +788,15 @@ input.form-control[type="file"] {
}

.account-detail .account-header-bar {
margin-top: -40px;
padding: 0 20px;
position: relative;
display: flex;
}

.account-detail .account-header-bar > a {
margin-top: -40px;
}

.account-detail .account-header-actions {
display: flex;
flex-grow: 1;
Expand Down
26 changes: 25 additions & 1 deletion src/View/Account.elm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Mastodon.Helper exposing (extractStatusId)
import Mastodon.Model exposing (..)
import Types exposing (..)
import View.Common as Common
import View.Events exposing (onClickWithPreventAndStop)
import View.Formatter exposing (formatContentWithEmojis, getDisplayNameForAccount)
import View.Status exposing (statusEntryView)

Expand Down Expand Up @@ -272,7 +273,30 @@ accountView subView currentUser accountInfo =
)
)
]
[ img [ src account.header ] [] ]
[ a
[]
[ img
[ let
attachment =
{ id = "header"
, type_ = "image"
, url = account.header
, remote_url = Nothing
, preview_url = Nothing
, text_url = Nothing
, description = Nothing
}

attachments =
[ attachment ]
in
onClickWithPreventAndStop <|
ViewerEvent (OpenViewer attachments attachment)
, src account.header
]
[]
]
]
, div [ class "account-header-bar" ]
[ Common.accountAvatarLink True (Just [ "avatar-detailed" ]) account
, div [ class "account-header-actions" ]
Expand Down

0 comments on commit a907f2a

Please sign in to comment.