aboutsummaryrefslogtreecommitdiff
path: root/client/src/View/Income/Table.hs
diff options
context:
space:
mode:
authorJoris2019-10-22 22:26:38 +0200
committerJoris2019-10-22 22:26:38 +0200
commit613ffccac4b3ab25c6d4c631fab757da0b35acf6 (patch)
tree13e448af89f4079bb62d7ce8b5a44b6a64515129 /client/src/View/Income/Table.hs
parent80f09e8b3a5c856e60922a73c9161a8c5392e4d4 (diff)
downloadbudget-613ffccac4b3ab25c6d4c631fab757da0b35acf6.tar.gz
budget-613ffccac4b3ab25c6d4c631fab757da0b35acf6.tar.bz2
budget-613ffccac4b3ab25c6d4c631fab757da0b35acf6.zip
Harmonize view component code style
Diffstat (limited to 'client/src/View/Income/Table.hs')
-rw-r--r--client/src/View/Income/Table.hs29
1 files changed, 14 insertions, 15 deletions
diff --git a/client/src/View/Income/Table.hs b/client/src/View/Income/Table.hs
index d42848b..9cb705f 100644
--- a/client/src/View/Income/Table.hs
+++ b/client/src/View/Income/Table.hs
@@ -1,6 +1,6 @@
module View.Income.Table
( view
- , IncomeTableIn(..)
+ , In(..)
) where
import qualified Data.List as L
@@ -14,25 +14,24 @@ import qualified Common.Model as CM
import qualified Common.Msg as Msg
import qualified Common.View.Format as Format
-import Component (TableIn (..))
-import qualified Component
+import qualified Component.Table as Table
import View.Income.Init (Init (..))
-data IncomeTableIn t = IncomeTableIn
- { _tableIn_init :: Init
- , _tableIn_currency :: Currency
- , _tableIn_incomes :: Dynamic t [Income]
+data In t = In
+ { _in_init :: Init
+ , _in_currency :: Currency
+ , _in_incomes :: Dynamic t [Income]
}
-view :: forall t m. MonadWidget t m => IncomeTableIn t -> m ()
-view tableIn = do
+view :: forall t m. MonadWidget t m => In t -> m ()
+view input = do
- Component.table $ TableIn
- { _tableIn_headerLabel = headerLabel
- , _tableIn_rows = R.ffor (_tableIn_incomes tableIn) $ reverse . L.sortOn _income_date
- , _tableIn_cell = cell (_tableIn_init tableIn) (_tableIn_currency tableIn)
- , _tableIn_perPage = 7
- , _tableIn_resetPage = R.never
+ Table.view $ Table.In
+ { Table._in_headerLabel = headerLabel
+ , Table._in_rows = R.ffor (_in_incomes input) $ reverse . L.sortOn _income_date
+ , Table._in_cell = cell (_in_init input) (_in_currency input)
+ , Table._in_perPage = 7
+ , Table._in_resetPage = R.never
}
return ()