1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-24 15:49:39 +02:00

Add Local Development Demo Data (#502)

* Clean up seeds, add development demo data

* Handle liability account display and sync

* Fix tests
This commit is contained in:
Zach Gollwitzer 2024-02-29 16:35:54 -05:00 committed by GitHub
parent dbf575c02a
commit 14641d16de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 368 additions and 62 deletions

View file

@ -49,12 +49,13 @@ module ApplicationHelper
end
# Styles to use when displaying a change in value
def trend_styles(trend)
def trend_styles(trend, mode: :asset)
puts mode == :liability ? "it is a liability" : "it is an asset"
bg_class, text_class, symbol, icon = case trend.direction
when "up"
[ "bg-green-500/5", "text-green-500", "+", "arrow-up" ]
mode == :liability ? [ "bg-red-500/5", "text-red-500", "+", "arrow-up" ] : [ "bg-green-500/5", "text-green-500", "+", "arrow-up" ]
when "down"
[ "bg-red-500/5", "text-red-500", "-", "arrow-down" ]
mode == :liability ? [ "bg-green-500/5", "text-green-500", "-", "arrow-down" ] : [ "bg-red-500/5", "text-red-500", "-", "arrow-down" ]
when "flat"
[ "bg-gray-500/5", "text-gray-500", "", "minus" ]
else