From 3a114a971f95d940b310be7dc2517868fdbbc68f Mon Sep 17 00:00:00 2001 From: Mohsen Date: Mon, 13 May 2024 16:39:44 +0300 Subject: [PATCH] [#19917] fix: resolve conflict --- src/status_im/common/validation/keypair.cljs | 4 ++-- src/status_im/constants.cljs | 4 ++-- .../wallet/keypairs_and_accounts/rename/view.cljs | 4 ++-- .../create_account/key_pair_name/view.cljs | 12 +++++------- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/status_im/common/validation/keypair.cljs b/src/status_im/common/validation/keypair.cljs index 3d13da8a362..5a717498179 100644 --- a/src/status_im/common/validation/keypair.cljs +++ b/src/status_im/common/validation/keypair.cljs @@ -7,11 +7,11 @@ (defn keypair-too-short? [s] - (< (-> s str string/trim count) constants/keypair-name-min-length)) + (< (-> s str string/trim count) constants/key-pair-name-min-length)) (defn keypair-too-long? [s] - (> (-> s str string/trim count) constants/keypair-name-max-length)) + (> (-> s str string/trim count) constants/key-pair-name-max-length)) (defn validation-keypair-name [s] diff --git a/src/status_im/constants.cljs b/src/status_im/constants.cljs index 67d65779acd..b1c9d5086de 100644 --- a/src/status_im/constants.cljs +++ b/src/status_im/constants.cljs @@ -77,8 +77,8 @@ (def ^:const contact-request-message-state-declined 3) (def ^:const contact-request-message-max-length 280) -(def ^:const keypair-name-max-length 20) -(def ^:const keypair-name-min-length 5) +(def ^:const key-pair-name-max-length 20) +(def ^:const key-pair-name-min-length 5) (def request-to-join-pending-state 1) diff --git a/src/status_im/contexts/settings/wallet/keypairs_and_accounts/rename/view.cljs b/src/status_im/contexts/settings/wallet/keypairs_and_accounts/rename/view.cljs index 748c1852761..8836d1d06f7 100644 --- a/src/status_im/contexts/settings/wallet/keypairs_and_accounts/rename/view.cljs +++ b/src/status_im/contexts/settings/wallet/keypairs_and_accounts/rename/view.cljs @@ -67,8 +67,8 @@ :placeholder (i18n/label :t/keypair-name-input-placeholder) :label (i18n/label :t/keypair-name) :default-value unsaved-keypair-name - :char-limit constants/keypair-name-max-length - :max-length constants/keypair-name-max-length + :char-limit constants/key-pair-name-max-length + :max-length constants/key-pair-name-max-length :auto-focus true :clearable? (not (string/blank? unsaved-keypair-name)) :on-clear on-clear diff --git a/src/status_im/contexts/wallet/add_account/create_account/key_pair_name/view.cljs b/src/status_im/contexts/wallet/add_account/create_account/key_pair_name/view.cljs index a2c3cf1137f..254b9a2158b 100644 --- a/src/status_im/contexts/wallet/add_account/create_account/key_pair_name/view.cljs +++ b/src/status_im/contexts/wallet/add_account/create_account/key_pair_name/view.cljs @@ -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/key-pair-name-min-length}) :emoji (i18n/label :t/key-name-error-emoji) :special-char (i18n/label :t/key-name-error-special-char)}) @@ -33,10 +31,10 @@ (fn [value] (set-key-pair-name value) (cond - (> (count value) key-pair-name-max-length) + (> (count value) constants/key-pair-name-max-length) (set-error :too-long) - (< 0 (count value) key-pair-name-min-length) + (< 0 (count value) constants/key-pair-name-min-length) (set-error :too-short) (validators/has-emojis? value) @@ -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/key-pair-name-max-length :auto-focus true :on-change-text on-change-text :error error}]