diff options
author | Joris | 2019-10-20 12:02:21 +0200 |
---|---|---|
committer | Joris | 2019-10-20 12:02:21 +0200 |
commit | 7aadcc97f9df0e2daccbe8a8726d8bc6c63d67f4 (patch) | |
tree | 3637cc06f6378fc3ea04844f15fe43bc04155007 /client/src/View/Income/Table.hs | |
parent | 6e9e34e92a244ab6c38d135d46f9f5bb01391906 (diff) |
Add income
Diffstat (limited to 'client/src/View/Income/Table.hs')
-rw-r--r-- | client/src/View/Income/Table.hs | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/client/src/View/Income/Table.hs b/client/src/View/Income/Table.hs index 2e8f4e6..5363ca5 100644 --- a/client/src/View/Income/Table.hs +++ b/client/src/View/Income/Table.hs @@ -6,7 +6,7 @@ module View.Income.Table import qualified Data.List as L import qualified Data.Maybe as Maybe import Data.Text (Text) -import Reflex.Dom (MonadWidget) +import Reflex.Dom (Dynamic, MonadWidget) import qualified Reflex.Dom as R import Common.Model (Income (..), Init (..), User (..)) @@ -16,22 +16,17 @@ import qualified Common.View.Format as Format import Component (TableIn (..)) import qualified Component -data IncomeTableIn = IncomeTableIn - { _tableIn_init :: Init +data IncomeTableIn t = IncomeTableIn + { _tableIn_init :: Init + , _tableIn_incomes :: Dynamic t [Income] } -view :: forall t m. MonadWidget t m => IncomeTableIn -> m () +view :: forall t m. MonadWidget t m => IncomeTableIn t -> m () view tableIn = do Component.table $ TableIn { _tableIn_headerLabel = headerLabel - , _tableIn_rows = - R.constDyn - . reverse - . L.sortOn _income_date - . _init_incomes - . _tableIn_init - $ tableIn + , _tableIn_rows = R.ffor (_tableIn_incomes tableIn) $ reverse . L.sortOn _income_date , _tableIn_cell = cell (_tableIn_init tableIn) , _tableIn_perPage = 7 , _tableIn_resetPage = R.never |