blob: f70c8cdd13a4511e5bf4b00142b084b15ae51c6e (
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
|
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecursiveDo #-}
module View.Payment
( widget
, PaymentIn(..)
, PaymentOut(..)
) where
import Reflex.Dom (MonadWidget)
import qualified Reflex.Dom as R
import Common.Model (Init (..))
import View.Payment.Pages (PagesIn (..), PagesOut (..))
import qualified View.Payment.Pages as Pages
import View.Payment.Table (TableIn (..))
import qualified View.Payment.Table as Table
data PaymentIn = PaymentIn
{ _paymentIn_init :: Init
}
data PaymentOut = PaymentOut
{
}
widget :: forall t m. MonadWidget t m => PaymentIn -> m PaymentOut
widget paymentIn = do
R.divClass "payment" $ do
rec
_ <- Table.widget $ TableIn
{ _tableIn_init = _paymentIn_init paymentIn
, _tableIn_currentPage = _pagesOut_currentPage pagesOut
}
pagesOut <- Pages.widget $ PagesIn
{ _pagesIn_payments = _init_payments . _paymentIn_init $ paymentIn
}
return $ PaymentOut {}
|