Skip to content

Commit

Permalink
[#19917] fix: resolve conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsen-ghafouri committed May 13, 2024
1 parent ece5532 commit 2ed6a3b
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@
[status-im.common.floating-button-page.view :as floating-button-page]
[status-im.common.not-implemented :as not-implemented]
[status-im.common.validation.general :as validators]
[status-im.constants :as constants]
[status-im.contexts.wallet.add-account.create-account.key-pair-name.style :as style]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))

(def ^:private key-pair-name-max-length 15)
(def ^:private key-pair-name-min-length 5)

(def error-messages
{:too-long (i18n/label :t/key-name-error-length)
:too-short (i18n/label :t/key-name-error-too-short {:count key-pair-name-min-length})
:too-short (i18n/label :t/key-name-error-too-short {:count constants/keypair-name-min-length})
:emoji (i18n/label :t/key-name-error-emoji)
:special-char (i18n/label :t/key-name-error-special-char)})

Expand All @@ -33,10 +31,10 @@
(fn [value]
(set-key-pair-name value)
(cond
(> (count value) key-pair-name-max-length)
(> (count value) constants/keypair-name-max-length)
(set-error :too-long)

(< 0 (count value) key-pair-name-min-length)
(< 0 (count value) constants/keypair-name-min-length)
(set-error :too-short)

(validators/has-emojis? value)
Expand Down Expand Up @@ -81,7 +79,7 @@
{:container-style style/input
:placeholder (i18n/label :t/keypair-name-input-placeholder)
:label (i18n/label :t/keypair-name)
:char-limit key-pair-name-max-length
:char-limit constants/keypair-name-max-length
:auto-focus true
:on-change-text on-change-text
:error error}]
Expand Down

0 comments on commit 2ed6a3b

Please sign in to comment.