Skip to content

Commit

Permalink
make card sorting simpler
Browse files Browse the repository at this point in the history
  • Loading branch information
lsocrate committed Nov 7, 2021
1 parent d1a8a1d commit 569ddbb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
7 changes: 1 addition & 6 deletions client/src/Pages/Deck/Edit/Id_.elm
Original file line number Diff line number Diff line change
Expand Up @@ -468,12 +468,7 @@ cardSort a b =
in
case compare (stack a) (stack b) of
EQ ->
case compare (Cards.bloodPotency a) (Cards.bloodPotency b) of
EQ ->
compare (Cards.name a) (Cards.name b)

ord ->
ord
compare (Cards.name a) (Cards.name b)

ord ->
ord
7 changes: 1 addition & 6 deletions client/src/Pages/Deck/New.elm
Original file line number Diff line number Diff line change
Expand Up @@ -445,12 +445,7 @@ cardSort a b =
in
case compare (stack a) (stack b) of
EQ ->
case compare (Cards.bloodPotency a) (Cards.bloodPotency b) of
EQ ->
compare (Cards.name a) (Cards.name b)

ord ->
ord
compare (Cards.name a) (Cards.name b)

ord ->
ord
6 changes: 4 additions & 2 deletions client/src/UI/Decklist.elm
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,14 @@ viewLibraryGroup name group =
]
, ul []
(group
|> List.sortBy (Tuple.first >> .name)
|> List.map
(\( c, n ) ->
(\( card, n ) ->
li [ class "deck-library__entry" ]
[ span [] [ text (String.fromInt n) ]
, span [] [ text "× " ]
, UI.CardName.withOverlay (Cards.LibraryCard c)
, UI.CardName.withOverlay (Cards.LibraryCard card)
, span [] [ Maybe.map Icon.clan card.clan |> Maybe.withDefault (text "") ]
]
)
)
Expand Down

0 comments on commit 569ddbb

Please sign in to comment.