/
View.elm
64 lines (57 loc) · 1.57 KB
/
View.elm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
module View exposing (global)
{-| The entry point for the views
-}
import Model exposing (Model, State(..))
import Message exposing (Message)
import Html
exposing
( Html
, text
, div
, header
, footer
, main_
)
import Html.Attributes as Attr
import Component.Breadcrumb as Breadcrumb
import Component.HistoryButtons as HistoryButtons
import Component.TreeView as TreeView
import Component.SearchBar as SearchBar
import Component.ToolBox as ToolBox
import Component.Configuration as Configuration
import File
{-| The global view of the Application.
-}
global : Model -> Html Message
global model =
let
currentPath =
Model.now model
in
div
[ Attr.class "inner-app" ]
[ div [ Attr.class "menu-app" ] []
, header []
[ Breadcrumb.render currentPath
, HistoryButtons.render model.history
]
, renderMain model currentPath
, footer
[]
[ SearchBar.render model.searchState
, ToolBox.render model
]
]
{-| Render the main block
-}
renderMain : Model -> File.Path -> Html Message
renderMain model currentPath =
case model.state of
Explore ->
main_
[ Attr.class "tree-view" ]
[ TreeView.render currentPath model.currentTree ]
Configure state ->
main_
[ Attr.class "configure-view" ]
[ Configuration.render state.inputState ]