From 8feb86d57fb54013f26a2bf2d5e367393fe857ee Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Thu, 22 Feb 2018 17:40:41 -0500 Subject: [PATCH] Update part2 --- part2/Main.elm | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/part2/Main.elm b/part2/Main.elm index 6893bde..c149c1a 100644 --- a/part2/Main.elm +++ b/part2/Main.elm @@ -4,13 +4,13 @@ import Html exposing (..) import Html.Attributes exposing (..) -model = - { result = - { id = 1 - , name = "TheSeamau5/elm-checkerboardgrid-tutorial" - , stars = 66 - } - } +searchResults = + [ "TheSeamau5/elm-checkerboardgrid-tutorial" + , "grzegorzbalcerek/elm-by-example" + , "sporto/elm-tutorial-app" + , "jvoigtlaender/Elm-Tutorium" + , "sporto/elm-tutorial-assets" + ] main = @@ -24,16 +24,21 @@ main = div [ class "content" ] [ text "TODO put the contents of elmHubHeader here instead of this text!" , ul [ class "results" ] - [ li [] - [ span [ class "star-count" ] - [-- TODO display the number of stars here. - -- - -- HINT: You'll need some parentheses to do this! - ] - - -- TODO use the model to put a link here that points to - -- https://github.com/TheSeamau5/elm-checkerboardgrid-tutorial - -- by prepending the "https://github.com/" part. - ] - ] + -- TODO replace this [] with a `List.map` to turn `searchResults` into some Html! + -- + -- HINT: You'll need some parentheses to do this! + [] + ] + + +viewSearchResult searchResult = + li [] + [-- TODO use `searchResult` to put a link here that points to + -- something like this: + -- + -- https://github.com/TheSeamau5/elm-checkerboardgrid-tutorial + -- + -- by prepending "https://github.com/" to the searchResult string + -- + -- HINT: This will also involve using parentheses! ]