Update intro/part4

This commit is contained in:
Richard Feldman
2018-08-14 01:59:19 -04:00
parent 8abd06f233
commit c5027f6ce0

View File

@@ -7,6 +7,7 @@ import Html.Attributes exposing (..)
import Html.Events exposing (onClick) import Html.Events exposing (onClick)
-- MODEL -- MODEL
@@ -56,6 +57,7 @@ type alias Msg =
update msg model = update msg model =
if msg.description == "ClickedTag" then if msg.description == "ClickedTag" then
{ model | selectedTag = msg.data } { model | selectedTag = msg.data }
else else
model model
@@ -101,9 +103,8 @@ viewArticle article =
] ]
{-| 👉 TODO: Replace this comment with a type annotation for `view` {-| 👉 TODO: Replace this comment with a type annotation for `viewBanner`
-} -}
viewBanner : Html Msg
viewBanner = viewBanner =
div [ class "banner" ] div [ class "banner" ]
[ div [ class "container" ] [ div [ class "container" ]
@@ -113,13 +114,14 @@ viewBanner =
] ]
{-| 👉 TODO: Replace this comment with a type annotation for `view` {-| 👉 TODO: Replace this comment with a type annotation for `viewTag`
-} -}
viewTag selectedTagName tagName = viewTag selectedTagName tagName =
let let
otherClass = otherClass =
if tagName == selectedTagName then if tagName == selectedTagName then
"tag-selected" "tag-selected"
else else
"tag-default" "tag-default"
in in