File tree 2 files changed +12
-8
lines changed
2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change 11
11
(and (string? color)
12
12
(not (string/blank? color)))))
13
13
14
- (defn- append-to-keyword
15
- [k & xs]
16
- (keyword (apply str
17
- (subs (str k) 1 )
18
- xs)))
19
-
20
14
(defn memo-icon-fn
21
15
([icon-name] (memo-icon-fn icon-name nil ))
22
16
([icon-name
25
19
:or {accessibility-label :icon }}]
26
20
(let [size (or size 20 )]
27
21
^{:key icon-name}
28
- (if-let [svg-icon (get icons.svg/icons ( append-to-keyword icon-name " - " size) )]
22
+ (if-let [svg-icon (icons.svg/get-icon icon-name size)]
29
23
[svg-icon
30
24
{:size size
31
25
:color (when (valid-color? color) color)
Original file line number Diff line number Diff line change 34
34
" M9.15142 9.99998L7.07566 12.0757L7.9242 12.9243L9.99994 10.8485L12.0757 12.9242L12.9242 12.0757L10.8485 9.99998L12.9242 7.92421L12.0757 7.07568L9.99994 9.15145L7.92421 7.07572L7.07568 7.92425L9.15142 9.99998Z"
35
35
:fill color-2}]]))
36
36
37
- (def icons
37
+ (def ^:private icons
38
38
{:i/clear-20 clear-20})
39
+
40
+ (defn- append-to-keyword
41
+ [k & xs]
42
+ (keyword (apply str
43
+ (subs (str k) 1 )
44
+ xs)))
45
+
46
+ (defn get-icon
47
+ [icon-name size]
48
+ (get icons (append-to-keyword icon-name " -" size)))
You can’t perform that action at this time.
0 commit comments