Update intro/part3
This commit is contained in:
@@ -6,15 +6,13 @@
|
|||||||
"elm-version": "0.19.0",
|
"elm-version": "0.19.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"direct": {
|
"direct": {
|
||||||
"elm/browser": "1.0.0",
|
|
||||||
"elm/core": "1.0.0",
|
"elm/core": "1.0.0",
|
||||||
"elm/html": "1.0.0"
|
"elm/html": "1.0.0"
|
||||||
},
|
},
|
||||||
"indirect": {
|
"indirect": {
|
||||||
"elm/json": "1.0.0",
|
"elm/json": "1.0.0",
|
||||||
"elm/time": "1.0.0",
|
"elm/time": "1.0.0",
|
||||||
"elm/url": "1.0.0",
|
"elm/url": "1.0.0"
|
||||||
"elm/virtual-dom": "1.0.0"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"test-dependencies": {
|
"test-dependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
module Main exposing (main)
|
module Main exposing (main)
|
||||||
|
|
||||||
-- 👇 You can see our new `Article` module in `src/Article.elm`
|
-- FYI: 👇 You can see our new `Article` module in `src/Article.elm`
|
||||||
|
|
||||||
import Article
|
import Article
|
||||||
import Browser
|
import Browser
|
||||||
@@ -9,6 +9,7 @@ import Html.Attributes exposing (..)
|
|||||||
import Html.Events exposing (onClick)
|
import Html.Events exposing (onClick)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- MODEL
|
-- MODEL
|
||||||
|
|
||||||
|
|
||||||
@@ -27,12 +28,10 @@ update msg model =
|
|||||||
{- 👉 TODO: If `msg.description` is "ClickedTag", then
|
{- 👉 TODO: If `msg.description` is "ClickedTag", then
|
||||||
set the model's `selectedTag` field to be `msg.data`
|
set the model's `selectedTag` field to be `msg.data`
|
||||||
|
|
||||||
💡 HINT 1: record update syntax looks like this:
|
💡 HINT: record update syntax looks like this:
|
||||||
|
|
||||||
{ model | foo = bar }
|
{ model | foo = bar }
|
||||||
|
|
||||||
💡 HINT 2: Don't forget, every `if` must have an `else`!
|
|
||||||
|
|
||||||
-}
|
-}
|
||||||
model
|
model
|
||||||
|
|
||||||
@@ -43,7 +42,7 @@ update msg model =
|
|||||||
|
|
||||||
view model =
|
view model =
|
||||||
let
|
let
|
||||||
{- 👉 TODO: Filter the articles down to onl the ones
|
{- 👉 TODO: Filter the articles down to only the ones
|
||||||
that include the currently selected tag.
|
that include the currently selected tag.
|
||||||
|
|
||||||
💡 HINT: Replace `True` below with something involving
|
💡 HINT: Replace `True` below with something involving
|
||||||
@@ -96,6 +95,7 @@ viewTag selectedTagName tagName =
|
|||||||
otherClass =
|
otherClass =
|
||||||
if tagName == selectedTagName then
|
if tagName == selectedTagName then
|
||||||
"tag-selected"
|
"tag-selected"
|
||||||
|
|
||||||
else
|
else
|
||||||
"tag-default"
|
"tag-default"
|
||||||
in
|
in
|
||||||
|
|||||||
Reference in New Issue
Block a user