aboutsummaryrefslogtreecommitdiff
path: root/client/src/Component
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/Component')
-rw-r--r--client/src/Component/Input.hs2
-rw-r--r--client/src/Component/Table.hs9
2 files changed, 5 insertions, 6 deletions
diff --git a/client/src/Component/Input.hs b/client/src/Component/Input.hs
index 37020da..bcff377 100644
--- a/client/src/Component/Input.hs
+++ b/client/src/Component/Input.hs
@@ -57,7 +57,7 @@ view input reset validate = do
]
inputAttr = R.ffor value (\v ->
- if T.null v && _in_inputType input /= "date"
+ if T.null v && _in_inputType input /= "date" && _in_inputType input /= "color"
then M.empty
else M.singleton "class" "filled")
diff --git a/client/src/Component/Table.hs b/client/src/Component/Table.hs
index f82cfa6..1482f91 100644
--- a/client/src/Component/Table.hs
+++ b/client/src/Component/Table.hs
@@ -21,7 +21,8 @@ data In m t h r = In
, _in_cloneModal :: r -> Modal.Content t m
, _in_editModal :: r -> Modal.Content t m
, _in_deleteModal :: r -> Modal.Content t m
- , _in_isOwner :: r -> Bool
+ , _in_canEdit :: r -> Bool
+ , _in_canDelete :: r -> Bool
}
data Out t = Out
@@ -62,8 +63,6 @@ view input =
, Modal._in_content = _in_cloneModal input row
}
- let isOwner = _in_isOwner input row
-
let visibleIf cond =
R.elAttr
"div"
@@ -71,7 +70,7 @@ view input =
editButton <-
R.divClass "cell button" $
- visibleIf isOwner $
+ visibleIf (_in_canEdit input row) $
Button._out_clic <$> (Button.view $
Button.defaultIn Icon.edit)
@@ -83,7 +82,7 @@ view input =
deleteButton <-
R.divClass "cell button" $
- visibleIf isOwner $
+ visibleIf (_in_canDelete input row) $
Button._out_clic <$> (Button.view $
Button.defaultIn Icon.delete)