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/Income.hs | |
parent | 6e9e34e92a244ab6c38d135d46f9f5bb01391906 (diff) |
Add income
Diffstat (limited to 'client/src/View/Income/Income.hs')
-rw-r--r-- | client/src/View/Income/Income.hs | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/client/src/View/Income/Income.hs b/client/src/View/Income/Income.hs index b0c6f0b..167aedf 100644 --- a/client/src/View/Income/Income.hs +++ b/client/src/View/Income/Income.hs @@ -3,11 +3,11 @@ module View.Income.Income , IncomeIn(..) ) where -import Reflex.Dom (MonadWidget) +import Reflex.Dom (Dynamic, MonadWidget) import qualified Reflex.Dom as R -import Common.Model (Init) -import View.Income.Header (HeaderIn (..)) +import Common.Model (Init (..)) +import View.Income.Header (HeaderIn (..), HeaderOut (..)) import qualified View.Income.Header as Header import View.Income.Table (IncomeTableIn (..)) import qualified View.Income.Table as Table @@ -20,12 +20,21 @@ view :: forall t m. MonadWidget t m => IncomeIn -> m () view incomeIn = R.elClass "main" "income" $ do - Header.view $ HeaderIn - { _headerIn_init = _incomeIn_init incomeIn - } + rec + + incomes <- R.foldDyn + (:) + (_init_incomes . _incomeIn_init $ incomeIn) + (_headerOut_addIncome header) + + header <- Header.view $ HeaderIn + { _headerIn_init = _incomeIn_init incomeIn + , _headerIn_incomes = incomes + } Table.view $ IncomeTableIn { _tableIn_init = _incomeIn_init incomeIn + , _tableIn_incomes = incomes } return () |