From bb316286b0859b5648c61f44c88399f4c1aad9cd Mon Sep 17 00:00:00 2001 From: Joris Date: Sat, 2 Jan 2016 19:07:19 +0100 Subject: Use start-app for elm --- src/client/elm/View.elm | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/client/elm/View.elm (limited to 'src/client/elm/View.elm') diff --git a/src/client/elm/View.elm b/src/client/elm/View.elm new file mode 100644 index 0000000..473caae --- /dev/null +++ b/src/client/elm/View.elm @@ -0,0 +1,33 @@ +module View + ( view + ) where + +import Html exposing (..) +import Signal exposing (Address) + +import Model exposing (Model) +import Model.Action exposing (Action) +import Model.View exposing (..) + +import View.Header exposing (renderHeader) +import View.Loading exposing (renderLoading) +import View.SignIn exposing (renderSignIn) +import View.LoggedIn exposing (renderLoggedIn) + +view : Address Action -> Model -> Html +view address model = + div + [] + [ renderHeader address model + , renderMain address model + ] + +renderMain : Address Action -> Model -> Html +renderMain address model = + case model.view of + LoadingView -> + renderLoading address + SignInView signInView -> + renderSignIn address model signInView + LoggedInView loggedInView -> + renderLoggedIn address model loggedInView -- cgit v1.2.3