Skip to content

Commit b6ee96e

Browse files
committed
buttonGroup child
1 parent 0a71489 commit b6ee96e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/Lumi/Components/ButtonGroup.purs

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
module Lumi.Components.ButtonGroup where
22

3+
import Prelude
4+
35
import JSS (JSS, jss)
46
import Lumi.Components.ZIndex (ziButtonGroup)
57
import React.Basic (Component, JSX, createComponent, element, makeStateless)
@@ -21,10 +23,14 @@ buttonGroup = makeStateless component render
2123
buttonGroupElement
2224
{ "data-joined": props.joined
2325
, style: props.style
24-
, children: props.children
26+
, children: map renderChild props.children
2527
}
28+
where
29+
renderChild child =
30+
buttonGroupChildElement { children: [ child ] }
2631

2732
buttonGroupElement = element (unsafeCreateDOMComponent "lumi-button-group")
33+
buttonGroupChildElement = element (unsafeCreateDOMComponent "lumi-button-group-child")
2834

2935
styles :: JSS
3036
styles = jss
@@ -34,12 +40,12 @@ styles = jss
3440
, display: "flex"
3541
, flexFlow: "row"
3642

37-
, "&[data-joined=false] > *":
43+
, "&[data-joined=false] > lumi-button-group-child":
3844
{ marginRight: "10px"
3945
, "&:last-child": { marginRight: "0" }
4046
}
4147

42-
, "&[data-joined=true] > *":
48+
, "&[data-joined=true] > lumi-button-group-child":
4349
{ "&:not(:last-child)":
4450
{ marginRight: "-1px"
4551
, borderTopRightRadius: "0"

0 commit comments

Comments
 (0)