1
0
mirror of https://github.com/fluencelabs/dashboard synced 2025-04-09 16:36:04 +00:00

55 lines
1.4 KiB
Elm
Raw Normal View History

2020-11-23 11:07:07 +03:00
module View exposing (view)
{-| Copyright 2020 Fluence Labs Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-}
import Browser exposing (Document)
2020-11-23 13:22:35 +03:00
import Html exposing (Html, div, header, text)
import Html.Attributes exposing (class, classList)
2020-11-23 14:27:33 +03:00
import Html.Events exposing (onClick)
2020-11-23 11:07:07 +03:00
import Model exposing (Model)
import Msg exposing (..)
2020-11-23 13:22:35 +03:00
import Palette exposing (classes)
2020-11-23 11:07:07 +03:00
2020-11-23 16:31:31 +03:00
2020-11-23 11:07:07 +03:00
view : Model -> Document Msg
view model =
{ title = title model, body = [ body model ] }
title : Model -> String
2020-11-23 13:22:35 +03:00
title _ =
"Fluence Network Dashboard"
2020-11-23 11:07:07 +03:00
body : Model -> Html Msg
body model =
2020-11-23 16:31:31 +03:00
layout <|
2020-11-23 11:07:07 +03:00
List.concat
2020-11-23 16:31:31 +03:00
[-- TODO render the view according to model.page
2020-11-23 11:07:07 +03:00
]
2020-11-23 16:31:31 +03:00
2020-11-23 13:22:35 +03:00
layout : List (Html Msg) -> Html Msg
layout elms =
2020-11-23 16:31:31 +03:00
div [ classes "mw9 center" ]
[ div [ classes "fl w-100 pa2" ]
([ header [ classes "w-100 bt bb b--black-10", onClick Click ] [ text "Fluence Network Dashboard" ]
]
++ elms
)
]