@@ -11,22 +11,18 @@ import Lumi.Components.Size (Size(..))
11
11
import React.Basic (Component , JSX , createComponent , element , makeStateless )
12
12
import React.Basic.DOM as R
13
13
14
- type CommonListProps rest =
14
+ type ListProps =
15
15
{ size :: Maybe Size
16
16
, rightAligned :: Boolean
17
17
, rows :: Array (Array JSX )
18
- | rest
18
+ , borders :: Boolean
19
19
}
20
20
21
- type ListProps = CommonListProps
22
- ( borders :: Boolean
23
- )
24
-
25
21
component :: Component ListProps
26
22
component = createComponent " List"
27
23
28
- listComponent :: ListProps -> JSX
29
- listComponent = makeStateless component $ lumiList <<< mapProps
24
+ list :: ListProps -> JSX
25
+ list = makeStateless component $ lumiList <<< mapProps
30
26
where
31
27
mapProps props =
32
28
{ className: " lumi"
@@ -49,35 +45,20 @@ listComponent = makeStateless component $ lumiList <<< mapProps
49
45
lumiListRow = element (R .unsafeCreateDOMComponent " lumi-list-row" )
50
46
lumiListRowCell = element (R .unsafeCreateDOMComponent " lumi-list-row-cell" )
51
47
52
- list :: CommonListProps () -> JSX
53
- list props =
54
- listComponent
55
- { size: props.size
56
- , rightAligned: props.rightAligned
57
- , rows: props.rows
58
- , borders: true
59
- }
60
-
61
- defaultList :: CommonListProps ()
48
+ defaultList :: ListProps
62
49
defaultList =
63
50
{ size: Just $ Medium
64
51
, rightAligned: false
65
52
, rows: []
53
+ , borders: true
66
54
}
67
55
68
- compactList :: CommonListProps ()
56
+ compactList :: ListProps
69
57
compactList =
70
58
{ size: Just $ Small
71
59
, rightAligned: false
72
60
, rows: []
73
- }
74
-
75
- borderlessList :: ListProps
76
- borderlessList =
77
- { size: Just $ Medium
78
- , rightAligned: false
79
- , rows: []
80
- , borders: false
61
+ , borders: true
81
62
}
82
63
83
64
type StructuredColumnListProps row =
@@ -99,6 +80,7 @@ structuredColumnList = makeStateless structuredColumnListComponent render
99
80
{ size: Just $ Large
100
81
, rightAligned: props.rightAligned
101
82
, rows: map renderRow props.rows
83
+ , borders: true
102
84
}
103
85
where
104
86
renderRow row =
0 commit comments