Skip to content

Commit

Permalink
Disable "remove fight messages" if there are none
Browse files Browse the repository at this point in the history
  • Loading branch information
Janiczek committed Sep 30, 2024
1 parent ec8cb9e commit 71deecb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Frontend.elm
Original file line number Diff line number Diff line change
Expand Up @@ -3495,6 +3495,7 @@ messagesView currentTime zone _ player =
, H.div [ HA.class "flex flex-col gap-4 items-start" ]
[ UI.button
[ HE.onClick AskToRemoveFightMessages
, HA.disabled <| not (Dict.any (\_ { content } -> Message.isFightMessage content) player.messages)
, HA.class "normal-case"
]
[ H.text "[Remove fight messages]" ]
Expand Down
5 changes: 3 additions & 2 deletions src/UI.elm
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ button : List (Attribute msg) -> List (Html msg) -> Html msg
button attrs content =
H.button
(HA.class "uppercase whitespace-pre cursor-pointer text-green-200 select-none"
:: TW.mod "disabled" "text-green-300"
:: TW.mod "hover" "text-green-100 bg-green-800"
:: TW.mod "disabled" "text-green-300 cursor-not-allowed"
:: TW.mod "hover" "text-green-100"
:: TW.mod "[&:not([disabled]):hover]" "bg-green-800"
:: TW.mod "active" "text-orange"
:: attrs
)
Expand Down

0 comments on commit 71deecb

Please sign in to comment.