mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-05 05:25:24 +02:00
Use favorable_direction for trend_styles helper
This commit is contained in:
parent
7714c4f89d
commit
7a119199b3
1 changed files with 2 additions and 2 deletions
|
@ -57,9 +57,9 @@ module ApplicationHelper
|
||||||
|
|
||||||
bg_class, text_class, symbol, icon = case trend.direction
|
bg_class, text_class, symbol, icon = case trend.direction
|
||||||
when "up"
|
when "up"
|
||||||
trend.type == "liability" ? [ "bg-red-500/5", "text-red-500", "+", "arrow-up" ] : [ "bg-green-500/5", "text-green-500", "+", "arrow-up" ]
|
trend.favorable_direction.down? ? [ "bg-red-500/5", "text-red-500", "+", "arrow-up" ] : [ "bg-green-500/5", "text-green-500", "+", "arrow-up" ]
|
||||||
when "down"
|
when "down"
|
||||||
trend.type == "liability" ? [ "bg-green-500/5", "text-green-500", "-", "arrow-down" ] : [ "bg-red-500/5", "text-red-500", "-", "arrow-down" ]
|
trend.favorable_direction.down? ? [ "bg-green-500/5", "text-green-500", "-", "arrow-down" ] : [ "bg-red-500/5", "text-red-500", "-", "arrow-down" ]
|
||||||
when "flat"
|
when "flat"
|
||||||
[ "bg-gray-500/5", "text-gray-500", "", "minus" ]
|
[ "bg-gray-500/5", "text-gray-500", "", "minus" ]
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue