about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2017-12-20T20·04+0100
committerVincent Ambo <tazjin@gmail.com>2017-12-20T20·04+0100
commit7dbeb83f854de51e7997378fe1df840805fb73ee (patch)
treec64c95116fc61ccc427130514784420136ace5a9
parentac623e4a7d61b91ac1bb2763f020ab909a547bd1 (diff)
feat(elm): Add real button to task cards
-rw-r--r--frontend/Main.elm22
1 files changed, 14 insertions, 8 deletions
diff --git a/frontend/Main.elm b/frontend/Main.elm
index 8c5a8e1a5e0e..c7dcc9dd898e 100644
--- a/frontend/Main.elm
+++ b/frontend/Main.elm
@@ -15,6 +15,8 @@ import Material.Grid exposing (grid, cell, size, Device(..))
 import Material.Layout as Layout
 import Material.Scheme as Scheme
 import Material.Options as Options
+import Material.Elevation as Elevation
+import Material.Button as Button
 
 
 -- API interface to Gemma
@@ -144,10 +146,12 @@ within task =
             ]
 
 
-renderTask : Task -> Html Msg
-renderTask task =
+renderTask : Model -> Task -> Html Msg
+renderTask model task =
     Card.view
-        [ Color.background (Color.color (taskColor task) Color.S800) ]
+        [ Color.background (Color.color (taskColor task) Color.S800)
+        , Elevation.e3
+        ]
         [ Card.title [] [ Card.head [ white ] [ text task.name ] ]
         , Card.text [ white ]
             [ text (Maybe.withDefault "" task.description)
@@ -155,18 +159,20 @@ renderTask task =
             , text (within task)
             ]
         , Card.actions
-            [ Card.border
-            , white
-            , Options.onClick (Complete task)
+            [ Card.border ]
+            [ Button.render Mdl
+                [ 0 ]
+                model.mdl
+                [ white, Button.ripple, Button.accent, Options.onClick (Complete task) ]
+                [ text "Completed" ]
             ]
-            [ text "Done!" ]
         ]
 
 
 gemmaView : Model -> Html Msg
 gemmaView model =
     grid []
-        (List.map (\t -> cell [ size All 3 ] [ renderTask t ])
+        (List.map (\t -> cell [ size All 4 ] [ renderTask model t ])
             model.tasks
         )