Skip to content

Commit 9a55dfb

Browse files
committed
tweak: augment quo input component to allow for styling of the input, the input container, and container
1 parent 02b93f4 commit 9a55dfb

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/quo/components/inputs/input/view.cljs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@
5757
"Custom properties that must be removed from properties map passed to InputText."
5858
[:type :blur? :error? :right-icon :left-icon :disabled? :small? :button
5959
:label :char-limit :on-char-limit-reach :icon-name :multiline? :on-focus :on-blur
60-
:container-style :ref])
60+
:container-style :input-container-style :input-style :ref])
6161

6262
(defn- base-input
6363
[{:keys [blur? error? right-icon left-icon disabled? small? button
64-
label char-limit multiline? clearable? on-focus on-blur container-style
65-
on-change-text on-char-limit-reach weight default-value on-clear]
64+
label char-limit multiline? clearable? on-focus on-blur container-style input-container-style
65+
input-style on-change-text on-char-limit-reach weight default-value on-clear]
6666
:as props}]
6767
(let [theme (quo.theme/use-theme-value)
6868
ref (rn/use-ref-atom nil)
@@ -115,15 +115,18 @@
115115
:label label
116116
:current-chars char-count
117117
:char-limit char-limit}])
118-
[rn/view {:style (style/input-container colors-by-status small? disabled?)}
118+
[rn/view
119+
{:style (merge (style/input-container colors-by-status small? disabled?) input-container-style)}
119120
(when-let [{:keys [icon-name]} left-icon]
120121
[left-accessory
121122
{:variant-colors variant-colors
122123
:small? small?
123124
:icon-name icon-name}])
124125
[rn/text-input
125126
(cond-> {:ref on-ref
126-
:style (style/input colors-by-status small? multiple-lines? weight)
127+
:style (merge
128+
(style/input colors-by-status small? multiple-lines? weight)
129+
input-style)
127130
:accessibility-label :input
128131
:placeholder-text-color (:placeholder colors-by-status)
129132
:keyboard-appearance (quo.theme/theme-value :light :dark theme)

0 commit comments

Comments
 (0)