Skip to content

Commit c7ba206

Browse files
committed
Array JSX
1 parent 8ff9485 commit c7ba206

File tree

2 files changed

+16
-21
lines changed

2 files changed

+16
-21
lines changed

docs/Examples/Tooltip.example.purs

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import Lumi.Components.Column (column_)
99
import Lumi.Components.Link as Link
1010
import Lumi.Components.Row (row_)
1111
import Lumi.Components.Text (body_)
12-
import Lumi.Components.Text as T
1312
import Lumi.Components.Example (example)
1413
import Lumi.Components.Tooltip (tooltip)
1514
import React.Basic (JSX)
@@ -23,7 +22,7 @@ docs =
2322
$ tooltip
2423
{ variant: "basic"
2524
, style: R.css {}
26-
, text: R.text "Lorem ipsum"
25+
, text: [ R.text "Lorem ipsum" ]
2726
, content: body_ "Basic example"
2827
, size: toNullable Nothing
2928
}
@@ -32,7 +31,7 @@ docs =
3231
$ tooltip
3332
{ variant: "top"
3433
, style: R.css {}
35-
, text: R.text "Lorem ipsum"
34+
, text: [ R.text "Lorem ipsum" ]
3635
, content: body_ "Top example"
3736
, size: toNullable Nothing
3837
}
@@ -41,7 +40,7 @@ docs =
4140
$ tooltip
4241
{ variant: "bottom"
4342
, style: R.css {}
44-
, text: R.text "Lorem ipsum"
43+
, text: [ R.text "Lorem ipsum" ]
4544
, content: body_ "Bottom example"
4645
, size: toNullable Nothing
4746
}
@@ -50,7 +49,7 @@ docs =
5049
$ tooltip
5150
{ variant: "left"
5251
, style: R.css {}
53-
, text: R.text "Lorem ipsum"
52+
, text: [ R.text "Lorem ipsum" ]
5453
, content: body_ "Left example"
5554
, size: toNullable Nothing
5655
}
@@ -61,7 +60,7 @@ docs =
6160
, tooltip
6261
{ variant: "top"
6362
, style: R.css { padding: "0 2px", textDecoration: "underline" }
64-
, text: R.text "Lorem ipsum"
63+
, text: [ R.text "Lorem ipsum" ]
6564
, content: body_ "here"
6665
, size: toNullable Nothing
6766
}
@@ -74,7 +73,7 @@ docs =
7473
, tooltip
7574
{ variant: "top"
7675
, style: R.css { padding: "0 2px", textDecoration: "underline" }
77-
, text: R.text "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis auctor libero non libero consequat, at iaculis diam venenatis. Donec nec porttitor tellus."
76+
, text: [ R.text "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis auctor libero non libero consequat, at iaculis diam venenatis. Donec nec porttitor tellus." ]
7877
, content: body_ "here"
7978
, size: toNullable $ Just $ Large
8079
}
@@ -88,18 +87,14 @@ docs =
8887
{ variant: "top"
8988
, style: R.css { padding: "0 2px", textDecoration: "underline" }
9089
, text:
91-
T.text T.body
92-
{ style = R.css {}
93-
, children =
94-
[ R.text "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis auctor libero non libero consequat, at iaculis diam venenatis. Donec nec porttitor tellus "
95-
, Link.link Link.defaults
96-
{ href = URL "#/link"
97-
, text = R.text "click here"
98-
, target = Just "_blank"
99-
}
100-
, R.text "."
101-
]
102-
}
90+
[ R.text "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis auctor libero non libero consequat, at iaculis diam venenatis. Donec nec porttitor tellus "
91+
, Link.link Link.defaults
92+
{ href = URL "#/link"
93+
, text = R.text "click here"
94+
, target = Just "_blank"
95+
}
96+
, R.text "."
97+
]
10398
, content: body_ "here"
10499
, size: toNullable $ Just $ Large
105100
}

src/Lumi/Components/Tooltip.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import React.Basic.DOM (CSS, unsafeCreateDOMComponent)
1414
type TooltipProps =
1515
{ variant :: String
1616
, style :: CSS
17-
, text :: JSX
17+
, text :: Array JSX
1818
, content :: JSX
1919
, size :: Nullable Size
2020
}
@@ -35,7 +35,7 @@ tooltip = makeStateless component render
3535
, "data-variant": props.variant
3636
, children:
3737
[ lumiTooltipTextElement
38-
{ children: [ props.text ] }
38+
{ children: props.text }
3939
, props.content
4040
]
4141
}

0 commit comments

Comments
 (0)