aboutsummaryrefslogtreecommitdiff
path: root/client/src/View
diff options
context:
space:
mode:
authorJoris2017-11-12 22:58:23 +0100
committerJoris2017-11-12 22:58:23 +0100
commit213cf7ede058b781fc957de2cd9f6a5988c08004 (patch)
treeedaa0aded649f6c63883637ee46bbb20b1851ddb /client/src/View
parent30f786e277b4ece6a09311de364082691f261ca3 (diff)
Add mocked pages
Diffstat (limited to 'client/src/View')
-rw-r--r--client/src/View/Payment.hs7
-rw-r--r--client/src/View/Payment/Pages.hs42
2 files changed, 48 insertions, 1 deletions
diff --git a/client/src/View/Payment.hs b/client/src/View/Payment.hs
index e80790b..d1430c9 100644
--- a/client/src/View/Payment.hs
+++ b/client/src/View/Payment.hs
@@ -11,8 +11,10 @@ module View.Payment
import Reflex.Dom (MonadWidget)
import qualified Reflex.Dom as R
-import Common.Model (Init)
+import Common.Model (Init(..))
+import View.Payment.Pages (PagesIn(..))
+import qualified View.Payment.Pages as Pages
import View.Payment.Table (TableIn(..))
import qualified View.Payment.Table as Table
@@ -30,4 +32,7 @@ widget paymentIn = do
_ <- Table.widget $ TableIn
{ _tableIn_init = _paymentIn_init paymentIn
}
+ _ <- Pages.widget $ PagesIn
+ { _pagesIn_payments = _init_payments . _paymentIn_init $ paymentIn
+ }
return $ PaymentOut {}
diff --git a/client/src/View/Payment/Pages.hs b/client/src/View/Payment/Pages.hs
new file mode 100644
index 0000000..f9a2b4e
--- /dev/null
+++ b/client/src/View/Payment/Pages.hs
@@ -0,0 +1,42 @@
+{-# LANGUAGE ExistentialQuantification #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE RecursiveDo #-}
+
+module View.Payment.Pages
+ ( widget
+ , PagesIn(..)
+ , PagesOut(..)
+ ) where
+
+import qualified Data.Text as T
+import Reflex.Dom (MonadWidget)
+import qualified Reflex.Dom as R
+
+import Common.Model (Payment(..))
+
+import qualified Icon
+
+data PagesIn = PagesIn
+ { _pagesIn_payments :: [Payment]
+ }
+
+data PagesOut = PagesOut
+ {
+ }
+
+widget :: forall t m. MonadWidget t m => PagesIn -> m PagesOut
+widget _ = do
+ R.divClass "pages" $ do
+ page Icon.doubleLeftBar
+ page Icon.doubleLeft
+ page (R.text . T.pack . show $ (1 :: Integer))
+ page (R.text . T.pack . show $ (2 :: Integer))
+ page (R.text . T.pack . show $ (3 :: Integer))
+ page (R.text . T.pack . show $ (4 :: Integer))
+ page (R.text . T.pack . show $ (5 :: Integer))
+ page Icon.doubleRight
+ page Icon.doubleRightBar
+ return $ PagesOut {}
+
+page :: forall t m. MonadWidget t m => m () -> m ()
+page content = R.elClass "button" "page" $ content