-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMain.hs
More file actions
38 lines (36 loc) · 1.35 KB
/
Main.hs
File metadata and controls
38 lines (36 loc) · 1.35 KB
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
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Concur.React (el, el_, runWidgetInBody,
text, vstyleStr)
import Concur.React.Components.SortableTree (TreeData (..),
sortableTree)
main :: IO ()
main = runWidgetInBody $
showTree [ TreeDataNode "Fruits" False
[ TreeDataLeaf "Apple"
, TreeDataLeaf "Banana"
]
, TreeDataNode "Veggies" False
[ TreeDataLeaf "Tomato"
, TreeDataLeaf "Potato"
]
, TreeDataNode "Colors" False
[ TreeDataLeaf "Red"
, TreeDataLeaf "Green"
, TreeDataLeaf "Blue"
, TreeDataLeaf "White"
, TreeDataLeaf "Orange"
]
]
where
parentStyle =
[ vstyleStr "display" "flex"
, vstyleStr "height" "800px"
]
childStyle = [vstyleStr "width" "50%"]
showTree items = do
modifiedItems <- el "div" parentStyle
[ el_ "div" childStyle $ sortableTree items
, el_ "div" childStyle $ text $ show items
]
showTree modifiedItems