-
Notifications
You must be signed in to change notification settings - Fork 0
/
SideBar.purs
77 lines (72 loc) · 2.07 KB
/
SideBar.purs
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
65
66
67
68
69
70
71
72
73
74
75
76
77
module InteractiveData.App.UI.SideBar
( ViewCfg
, view
) where
import InteractiveData.Core.Prelude
import Chameleon as C
import InteractiveData.App.UI.Assets as UI.Assets
type ViewCfg :: (Type -> Type) -> Type -> Type
type ViewCfg html msg = { menu :: html msg }
view :: forall html msg. IDHtml html => ViewCfg html msg -> html msg
view { menu } = withCtx \{ showLogo } ->
let
el =
{ root: styleNode C.div
"""
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
overflow: auto;
"""
, poweredBy: styleNode C.div
[ decl
"""
font-size: 0.8em;
color: #999;
padding: 0.5em;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
stroke:#dfdfdf;
margin-bottom: 15px;
"""
, declWith ":hover"
"""
stroke: #30ffc4;
color: #30ffc4;
"""
]
, logo: styleNode C.div
[ decl
"""
width: 50px;
height: 50px;
"""
]
, link: styleNode C.a
[ declWith ":link" [ "text-decoration : none" ]
, declWith ":visited" [ "text-decoration : none" ]
, declWith ":hover" [ "text-decoration : none" ]
, declWith ":active" [ "text-decoration : none" ]
]
}
in
el.root []
[ menu
, if showLogo then
el.link [ C.href "https://github.com/thought2/purescript-interactive-data" ]
[ el.poweredBy []
[ el.logo []
[ UI.Assets.viewLogo ]
, C.div []
[ C.span_ [ C.text "built with " ]
, C.span []
[ C.text "interactive-data" ]
]
]
]
else C.noHtml
]