Skip to content

Commit 063f95f

Browse files
committed
Revert "refactor to prevent breaking change"
This reverts commit 8e95da2.
1 parent 8e95da2 commit 063f95f

File tree

2 files changed

+13
-30
lines changed

2 files changed

+13
-30
lines changed

docs/Examples/List.example.purs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Lumi.Components.Color (colorNames)
88
import Lumi.Components.Column (columnSelfStretch, column_)
99
import Lumi.Components.Images (avatar, avatar_)
1010
import Lumi.Components.Link (link, defaults)
11-
import Lumi.Components.List (list, listComponent, borderlessList, compactList, defaultList, structuredColumnList)
11+
import Lumi.Components.List (list, structuredColumnList, defaultList, compactList)
1212
import Lumi.Components.Lockup (lockup)
1313
import Lumi.Components.Row (row_)
1414
import Lumi.Components.Size (Size(..))
@@ -29,11 +29,12 @@ docs =
2929
}
3030
]
3131

32-
, h2_ "Borderless List"
32+
, h2_ "Basic List w/ no Borders"
3333
, example
3434
$ columnSelfStretch
35-
[ listComponent borderlessList
35+
[ list defaultList
3636
{ rows = simpleListData
37+
, borders = false
3738
}
3839
]
3940

src/Lumi/Components/List.purs

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,18 @@ import Lumi.Components.Size (Size(..))
1111
import React.Basic (Component, JSX, createComponent, element, makeStateless)
1212
import React.Basic.DOM as R
1313

14-
type CommonListProps rest =
14+
type ListProps =
1515
{ size :: Maybe Size
1616
, rightAligned :: Boolean
1717
, rows :: Array (Array JSX)
18-
| rest
18+
, borders :: Boolean
1919
}
2020

21-
type ListProps = CommonListProps
22-
( borders :: Boolean
23-
)
24-
2521
component :: Component ListProps
2622
component = createComponent "List"
2723

28-
listComponent :: ListProps -> JSX
29-
listComponent = makeStateless component $ lumiList <<< mapProps
24+
list :: ListProps -> JSX
25+
list = makeStateless component $ lumiList <<< mapProps
3026
where
3127
mapProps props =
3228
{ className: "lumi"
@@ -49,35 +45,20 @@ listComponent = makeStateless component $ lumiList <<< mapProps
4945
lumiListRow = element (R.unsafeCreateDOMComponent "lumi-list-row")
5046
lumiListRowCell = element (R.unsafeCreateDOMComponent "lumi-list-row-cell")
5147

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
6249
defaultList =
6350
{ size: Just $ Medium
6451
, rightAligned: false
6552
, rows: []
53+
, borders: true
6654
}
6755

68-
compactList :: CommonListProps ()
56+
compactList :: ListProps
6957
compactList =
7058
{ size: Just $ Small
7159
, rightAligned: false
7260
, rows: []
73-
}
74-
75-
borderlessList :: ListProps
76-
borderlessList =
77-
{ size: Just $ Medium
78-
, rightAligned: false
79-
, rows: []
80-
, borders: false
61+
, borders: true
8162
}
8263

8364
type StructuredColumnListProps row =
@@ -99,6 +80,7 @@ structuredColumnList = makeStateless structuredColumnListComponent render
9980
{ size: Just $ Large
10081
, rightAligned: props.rightAligned
10182
, rows: map renderRow props.rows
83+
, borders: true
10284
}
10385
where
10486
renderRow row =

0 commit comments

Comments
 (0)