blob: 167aedfcb6d36b0a4acb143cae015818ecedbb17 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
module View.Income.Income
( view
, IncomeIn(..)
) where
import Reflex.Dom (Dynamic, MonadWidget)
import qualified Reflex.Dom as R
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
data IncomeIn = IncomeIn
{ _incomeIn_init :: Init
}
view :: forall t m. MonadWidget t m => IncomeIn -> m ()
view incomeIn =
R.elClass "main" "income" $ do
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 ()
|