From 8610d9f42f9c84eaa19c0f50a97f0cb84d2a36b6 Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Fri, 27 Oct 2017 12:44:18 +0200 Subject: [PATCH] Don't make elmHubHeader top-level --- part3/Main.elm | 14 +++++++------- part4/Main.elm | 17 ++++++++--------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/part3/Main.elm b/part3/Main.elm index 21417dd..00a921d 100644 --- a/part3/Main.elm +++ b/part3/Main.elm @@ -32,14 +32,14 @@ initialModel = } -elmHubHeader = - header [] - [ h1 [] [ text "ElmHub" ] - , span [ class "tagline" ] [ text "Like GitHub, but for Elm things." ] - ] - - view model = + let + elmHubHeader = + header [] + [ h1 [] [ text "ElmHub" ] + , span [ class "tagline" ] [ text "Like GitHub, but for Elm things." ] + ] + in div [ class "content" ] [ elmHubHeader , ul [ class "results" ] (List.map viewSearchResult model.results) diff --git a/part4/Main.elm b/part4/Main.elm index caea4ac..a5273f2 100644 --- a/part4/Main.elm +++ b/part4/Main.elm @@ -27,6 +27,7 @@ type alias Msg = {-| TODO add a type annotation to this value HINT: The type aliases above may come in handy for these exercises! + -} initialModel = { query = "tutorial" @@ -55,18 +56,16 @@ initialModel = } -{-| TODO add a type annotation to this value --} -elmHubHeader = - header [] - [ h1 [] [ text "ElmHub" ] - , span [ class "tagline" ] [ text "Like GitHub, but for Elm things." ] - ] - - {-| TODO add a type annotation to this function -} view model = + let + elmHubHeader = + header [] + [ h1 [] [ text "ElmHub" ] + , span [ class "tagline" ] [ text "Like GitHub, but for Elm things." ] + ] + in div [ class "content" ] [ elmHubHeader , ul [ class "results" ] (List.map viewSearchResult model.results)