Skip to content

Commit 01736de

Browse files
committed
Small refactor & add customization color to info-count component
1 parent 9f5e7ce commit 01736de

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

src/quo2/components/notifications/info_count.cljs

+17-12
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,27 @@
33
[quo2.foundations.typography :as typography]
44
[react-native.core :as rn]))
55

6+
(defn- counter-style
7+
[customization-color overwritten-styles]
8+
(merge {:width 16
9+
:height 16
10+
:position :absolute
11+
:right 22
12+
:border-radius 6
13+
:justify-content :center
14+
:align-items :center
15+
:background-color (colors/custom-color-by-theme customization-color 50 60)}
16+
overwritten-styles))
17+
618
(defn info-count
719
([amount]
820
(info-count {} amount))
9-
([props amount]
21+
([{:keys [customization-color style]
22+
:or {customization-color :blue}
23+
:as props}
24+
amount]
1025
(when (> amount 0)
11-
[rn/view
12-
(merge props
13-
{:style (merge {:width 16
14-
:height 16
15-
:position :absolute
16-
:right 22
17-
:border-radius 6
18-
:justify-content :center
19-
:align-items :center
20-
:background-color (colors/theme-colors colors/primary-50 colors/primary-60)}
21-
(:style props))})
26+
[rn/view (merge props {:style (counter-style customization-color style)})
2227
[rn/text
2328
{:style (merge typography/font-medium
2429
typography/label

0 commit comments

Comments
 (0)