Skip to content

Commit b0e1730

Browse files
committed
[tree-select] Add custom parts-table title
For day8/rf8.day8.com.au#132
1 parent a468873 commit b0e1730

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/re_demo/tree_select.cljs

+2-2
Original file line numberDiff line numberDiff line change
@@ -335,5 +335,5 @@
335335
"includes an anchor label. By default, it lists all the selected choices, except if an entire group is selected, then that group appears in place of its descendants."]
336336
[args-table tree-select-dropdown-args-desc]]]
337337
[demo]]]
338-
[parts-table "tree-select" tree-select-parts-desc]
339-
[parts-table "tree-select-dropdown" tree-select-dropdown-parts-desc]]])
338+
[parts-table "tree-select" tree-select-parts-desc :title [:span "Parts: " [:code "[:tree-select]"]]]
339+
[parts-table "tree-select-dropdown" tree-select-dropdown-parts-desc :title [:span "Parts: " [:code "[:tree-select]"]]]]])

src/re_demo/utils.cljs

+2-2
Original file line numberDiff line numberDiff line change
@@ -191,14 +191,14 @@
191191
:child [:span notes]]]])
192192

193193
(defn parts-table
194-
[component-name parts]
194+
[component-name parts & {:keys [title]}]
195195
(let [name-of-first-part (str (first (remove nil? (map :name parts))))
196196
code-example-spaces (reduce #(str % " ") "" (range (+ (count name-of-first-part) 13)))]
197197
[v-box
198198
:src (at)
199199
:margin "0px 20px 20px 0px"
200200
:children (concat
201-
[[title2 "Parts"]
201+
[[title2 (or title "Parts")]
202202
[p "This component is constructed from a hierarchy of HTML elements which we refer to as \"parts\"."]
203203
[p "re-com gives each of these parts a unique CSS class, so that you can individually target them.
204204
Also, each part is identified by a keyword for use in " [:code ":parts"] " like this:" [:br]]

0 commit comments

Comments
 (0)