Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarBasem committed Apr 2, 2024
1 parent 74885a0 commit c7cefc4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/status_im/common/validation/general.cljs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(ns status-im.common.validation.general
(:require
[status-im.constants :as constants]))
[status-im.constants :as constants]
[utils.emojilib :as emoji]))

(defn valid-public-key?
[s]
Expand All @@ -14,7 +15,7 @@
(not-empty s)
(boolean (re-matches constants/regx-compressed-key s))))

(defn has-emojis? [s] (boolean (re-find utils.emojilib/emoji-regex s)))
(defn has-emojis? [s] (boolean (re-find emoji/emoji-regex s)))

(def no-special-chars-regex #"^[a-zA-Z0-9\-_ ]+$")
(defn has-special-characters?
Expand Down
5 changes: 3 additions & 2 deletions src/status_im/common/validation/profile_test.cljs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
(ns status-im.common.validation.profile-test
(:require
[cljs.test :refer-macros [deftest are]]
[status-im.common.validation.general :as validator]
[status-im.common.validation.profile :as profile-validator]
[utils.i18n :as i18n]))

(deftest has-emojis-test
(are [arg expected]
(expected (profile-validator/has-emojis? arg))
(expected (validator/has-emojis? arg))
"Hello 😊" true?
"Hello" false?))

Expand All @@ -18,7 +19,7 @@

(deftest has-special-characters-test
(are [arg expected]
(expected (profile-validator/has-special-characters? arg))
(expected (validator/has-special-characters? arg))
"@name" true?
"name" false?))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

(defn navigate-back [] (rf/dispatch [:navigate-back]))

(defn view-internal
[{:keys [theme]}]
(defn view
[]
(let [[keypair-name set-keypair-name] (rn/use-state "")
customization-color (rf/sub [:profile/customization-color])
[error set-error] (rn/use-state false)
Expand Down Expand Up @@ -71,4 +71,3 @@
:icon :i/info
:container-style style/error-container}
(get error-messages error)])]]))
(def view (quo.theme/with-theme view-internal))

0 comments on commit c7cefc4

Please sign in to comment.