Simplify part3
This commit is contained in:
@@ -64,25 +64,12 @@ viewBanner =
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
{-| TODO Give this function a new first argument called `selectedTag`, like so:
|
viewTag selectedTagName tagName =
|
||||||
|
|
||||||
BEFORE:
|
|
||||||
|
|
||||||
viewTag tagName =
|
|
||||||
|
|
||||||
AFTER:
|
|
||||||
|
|
||||||
viewTag selectedTag tagName =
|
|
||||||
|
|
||||||
HINT: This will cause a compiler error. See where the error message takes you!
|
|
||||||
|
|
||||||
-}
|
|
||||||
viewTag tagName =
|
|
||||||
let
|
let
|
||||||
classname =
|
{- TODO Set the classname to "tag-pill tag-selected" only when the
|
||||||
{- TODO Set the classname to "tag-pill tag-selected" only
|
current tagName is equal to the selected one.
|
||||||
when tagName == selectedTag
|
|
||||||
-}
|
-}
|
||||||
|
classname =
|
||||||
if False then
|
if False then
|
||||||
"tag-pill tag-selected"
|
"tag-pill tag-selected"
|
||||||
else
|
else
|
||||||
@@ -105,11 +92,8 @@ viewTag tagName =
|
|||||||
[ text tagName ]
|
[ text tagName ]
|
||||||
|
|
||||||
|
|
||||||
{-| HINT: Take a look at how initialModel is defined at the top of this file.
|
|
||||||
-}
|
|
||||||
viewTags model =
|
viewTags model =
|
||||||
div [ class "tag-list" ]
|
div [ class "tag-list" ] (List.map (viewTag model.selectedTag) model.tags)
|
||||||
(List.map (\tag -> viewTag tag) model.tags)
|
|
||||||
|
|
||||||
|
|
||||||
viewFeed feed =
|
viewFeed feed =
|
||||||
|
|||||||
Reference in New Issue
Block a user