aboutsummaryrefslogtreecommitdiff
path: root/frontend/src
diff options
context:
space:
mode:
authorCadey Dodrill <me@christine.website>2016-12-14 06:20:25 -0800
committerCadey Dodrill <me@christine.website>2016-12-14 06:20:25 -0800
commit90f176019a1723aa0d4b7cbb97009944e60e963d (patch)
treea816f40b0c8c823aef2c8efe60ba4ef8891d876b /frontend/src
parent060a7c913a6eb1f30052504678e04fccc404b930 (diff)
downloadxesite-90f176019a1723aa0d4b7cbb97009944e60e963d.tar.xz
xesite-90f176019a1723aa0d4b7cbb97009944e60e963d.zip
add API backend
Diffstat (limited to 'frontend/src')
-rw-r--r--frontend/src/BlogIndex.purs12
-rw-r--r--frontend/src/Layout.purs2
2 files changed, 9 insertions, 5 deletions
diff --git a/frontend/src/BlogIndex.purs b/frontend/src/BlogIndex.purs
index bd6e303..8f2c919 100644
--- a/frontend/src/BlogIndex.purs
+++ b/frontend/src/BlogIndex.purs
@@ -8,8 +8,9 @@ import Network.HTTP.Affjax (AJAX, get)
import Prelude (($), bind, map, const, show, (<>), pure, (<<<))
import Pux (EffModel, noEffects)
import Pux.Html (Html, br, div, h1, ol, li, button, text, span, p)
-import Pux.Html.Attributes (key, className)
+import Pux.Html.Attributes (key, className, id_)
import Pux.Html.Events (onClick)
+import Pux.Router (link)
data Action = RequestPosts
| ReceivePosts (Either String Posts)
@@ -58,9 +59,9 @@ update RequestPosts state =
post :: Post -> Html Action
post (Post state) =
div
- [ className "col s4" ]
+ [ className "col s6" ]
[ div
- [ className "card pink lighten-1" ]
+ [ className "card pink lighten-4" ]
[ div
[ className "card-content black-text" ]
[ span [ className "card-title" ] [ text state.title ]
@@ -68,6 +69,9 @@ post (Post state) =
, p [] [ text ("Posted on: " <> state.date) ]
, span [] [ text state.summary ]
]
+ , div
+ [ className "card-action pink" ]
+ [ link state.link [] [ text "Read More" ] ]
]
]
@@ -76,5 +80,5 @@ view state =
div
[]
[ h1 [] [ text state.status ]
- , button [ onClick (const RequestPosts) ] [ text "Fetch posts" ]
+ , button [ onClick (const RequestPosts), id_ "requestbutton", className "hidden" ] [ text "Fetch posts" ]
, div [ className "row" ] $ map post state.posts ]
diff --git a/frontend/src/Layout.purs b/frontend/src/Layout.purs
index 0507aef..93ffa4a 100644
--- a/frontend/src/Layout.purs
+++ b/frontend/src/Layout.purs
@@ -47,7 +47,7 @@ view state =
navbar :: State -> Html Action
navbar state =
nav
- [ className "light-blue lighten-1", role "navigation" ]
+ [ className "pink lighten-1", role "navigation" ]
[ div
[ className "nav-wrapper container" ]
[ link "/" [ className "brand-logo", id_ "logo-container" ] [ text "Christine Dodrill" ] ]