Make whole status clickable

This makes it possible to open statuses without status text.
This commit is contained in:
Ryan Fox 2021-01-30 02:13:25 +00:00
parent a037cbe9ec
commit 21ccfe7e52
Signed by: flewkey
GPG Key ID: 94F56ADFD848851E

View File

@ -150,19 +150,12 @@ statusActionsView status currentUser showApp =
]
statusContentView : String -> Status -> Bool -> Html Msg
statusContentView context status clickOpen =
let
statusTextEvents =
if clickOpen then
[ onClickWithStop <| OpenThread status ]
else
[]
in
statusContentView : String -> Status -> Html Msg
statusContentView context status =
case status.spoiler_text of
"" ->
div [ class "status-text" ]
[ div statusTextEvents <| formatContent status.content status.mentions
[ div [] <| formatContent status.content status.mentions
, attachmentListView context status
]
@ -214,6 +207,14 @@ statusEntryView context className currentUser status =
statusView : String -> Status -> Bool -> Html Msg
statusView context ({ account, content, media_attachments, reblog, mentions, pinned } as status) clickOpen =
let
statusAttribs =
if clickOpen then
[ class "status"
, onClickWithStop <| OpenThread status
]
else
[ class "status" ]
accountLinkAttributes =
[ href <| "#account/" ++ account.id ]
@ -242,7 +243,7 @@ statusView context ({ account, content, media_attachments, reblog, mentions, pin
]
Nothing ->
div [ class "status" ]
div statusAttribs
[ pin
, Common.accountAvatarLink False account
, div [ class "username" ]
@ -251,5 +252,5 @@ statusView context ({ account, content, media_attachments, reblog, mentions, pin
, span [ class "acct" ] [ text <| " @" ++ account.acct ]
]
]
, Lazy.lazy3 statusContentView context status clickOpen
, Lazy.lazy2 statusContentView context status
]