1
0
Fork 0

Display emoji in account display names

This commit is contained in:
Ryan Fox 2022-03-29 22:18:18 -07:00
parent abfaaa5570
commit e308c32bdd
Signed by: flewkey
GPG Key ID: 94F56ADFD848851E
3 changed files with 13 additions and 6 deletions

View File

@ -354,7 +354,7 @@ accountView subView currentUser accountInfo =
, muteButton currentUser accountInfo.relationship account
, blockButton currentUser accountInfo.relationship account
, Common.accountAvatarLink True account
, span [ class "account-display-name" ] [ text (if account.display_name=="" then account.username else account.display_name) ]
, span [ class "account-display-name" ] <| Common.accountDisplayNameRich account
, span [ class "account-username" ]
[ Common.accountLink True account
, if account.locked then

View File

@ -4,6 +4,7 @@ module View.Common
, accountAvatar
, accountAvatarLink
, accountDisplayName
, accountDisplayNameRich
, accountLink
, accountLinkSmall
, accountLinkLarge
@ -27,6 +28,7 @@ import Mastodon.Http exposing (Links)
import Mastodon.Model exposing (..)
import Types exposing (..)
import View.Events exposing (..)
import View.Formatter exposing (formatContent)
accountAvatar : String -> Account -> Html Msg
@ -42,6 +44,11 @@ accountDisplayName account =
account.display_name
accountDisplayNameRich : Account -> List (Html Msg)
accountDisplayNameRich account =
formatContent (accountDisplayName account) [] account.emojis
accountLink : Bool -> Account -> Html Msg
accountLink external account =
if external then
@ -57,7 +64,7 @@ accountLink external account =
[ href account.url
, href <| "#account/" ++ account.id
]
[ span [ class "display-name" ] [ text <| accountDisplayName <| account ]
[ span [ class "display-name" ] <| accountDisplayNameRich account
, accountAcctView False account
]
@ -75,7 +82,7 @@ accountLinkSmall external account =
[ href account.url
, accountHref
]
[ text <| accountDisplayName <| account
[ span [ class "display-name" ] <| accountDisplayNameRich account
]
@ -91,7 +98,7 @@ accountLinkLarge external account =
a
[ href <| "#account/" ++ account.id
]
[ text <| accountDisplayName <| account
[ span [ class "display-name" ] <| accountDisplayNameRich account
, br [] []
, accountAcctView True account
]

View File

@ -329,7 +329,7 @@ statusView context ({ account, content, media_attachments, reblog, mentions, pin
[ p [ class "status-info" ]
[ Common.icon "fire"
, a (accountLinkAttributes ++ [ class "reblogger" ])
[ text <| " "++(Common.accountDisplayName <| account) ]
[ span [ class "display-name" ] <| Common.accountDisplayNameRich account ]
, text " boosted"
]
, Lazy.lazy3 statusView context reblog clickOpen
@ -341,7 +341,7 @@ statusView context ({ account, content, media_attachments, reblog, mentions, pin
, Common.accountAvatarLink False account
, div [ class "username" ]
[ a accountLinkAttributes
[ span [ class "display-name" ] [ text <| Common.accountDisplayName <| account ]
[ span [ class "display-name" ] <| Common.accountDisplayNameRich account
, Common.accountAcctView True account
]
]