aboutsummaryrefslogtreecommitdiff
path: root/client/src/Component/Table.hs
diff options
context:
space:
mode:
authorJoris2019-11-06 19:44:15 +0100
committerJoris2019-11-06 19:44:15 +0100
commitf4f24158a46d8c0975f1b8813bbdbbeebad8c108 (patch)
treed0aeaa3a920caaff7408a1f6cd12b45f21cb2620 /client/src/Component/Table.hs
parent58f6c4e25f5f20f1b608242c83786e2f13947804 (diff)
downloadbudget-f4f24158a46d8c0975f1b8813bbdbbeebad8c108.tar.gz
budget-f4f24158a46d8c0975f1b8813bbdbbeebad8c108.tar.bz2
budget-f4f24158a46d8c0975f1b8813bbdbbeebad8c108.zip
Show the payment table with server side paging
Diffstat (limited to 'client/src/Component/Table.hs')
-rw-r--r--client/src/Component/Table.hs21
1 files changed, 10 insertions, 11 deletions
diff --git a/client/src/Component/Table.hs b/client/src/Component/Table.hs
index 3b9ec24..2869c2d 100644
--- a/client/src/Component/Table.hs
+++ b/client/src/Component/Table.hs
@@ -4,7 +4,7 @@ module Component.Table
, Out(..)
) where
-import qualified Data.Map as M
+import qualified Data.Map as M
import Data.Text (Text)
import Reflex.Dom (Event, MonadWidget)
import qualified Reflex.Dom as R
@@ -14,23 +14,23 @@ import qualified Component.Modal as Modal
import qualified Util.Reflex as ReflexUtil
import qualified View.Icon as Icon
-data In m t h r a = In
+data In m t h r a b c = In
{ _in_headerLabel :: h -> Text
, _in_rows :: [r]
- , _in_cell :: h -> r -> Text
+ , _in_cell :: h -> r -> m ()
, _in_cloneModal :: r -> Modal.Content t m a
- , _in_editModal :: r -> Modal.Content t m a
- , _in_deleteModal :: r -> Modal.Content t m a
+ , _in_editModal :: r -> Modal.Content t m b
+ , _in_deleteModal :: r -> Modal.Content t m c
, _in_isOwner :: r -> Bool
}
-data Out t a = Out
+data Out t a b c = Out
{ _out_add :: Event t a
- , _out_edit :: Event t a
- , _out_delete :: Event t a
+ , _out_edit :: Event t b
+ , _out_delete :: Event t c
}
-view :: forall t m h r a. (MonadWidget t m, Bounded h, Enum h) => In m t h r a -> m (Out t a)
+view :: forall t m h r a b c. (MonadWidget t m, Bounded h, Enum h) => In m t h r a b c-> m (Out t a b c)
view input =
R.divClass "table" $ do
rec
@@ -49,8 +49,7 @@ view input =
R.divClass "row" $ do
flip mapM_ [minBound..] $ \header ->
R.divClass "cell" $
- R.text $
- _in_cell input header row
+ _in_cell input header row
cloneButton <-
R.divClass "cell button" $