Skip to content

Commit

Permalink
make lint-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
siddarthkay committed Mar 26, 2024
1 parent 7cf2e20 commit 32fe10a
Show file tree
Hide file tree
Showing 33 changed files with 117 additions and 136 deletions.
12 changes: 6 additions & 6 deletions src/legacy/status_im/bottom_sheet/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -187,19 +187,19 @@
(with-animation (+ bg-height-expanded (.-value pan-y))))
;; Workaround for
;; https://github.com/software-mansion/react-native-reanimated/issues/1758#issue-817145741
;; withTiming/withSpring callback not working on-expanded should
;; be called as a callback of with-animation instead, once this
;; issue has been resolved
;; withTiming/withSpring callback not working on-expanded
;; should be called as a callback of with-animation instead,
;; once this issue has been resolved
(timer/set-timeout on-expanded animation-delay))
(do
(reanimated/set-shared-value
bottom-sheet-dy
(with-animation (+ bg-height (.-value pan-y))))
;; Workaround for
;; https://github.com/software-mansion/react-native-reanimated/issues/1758#issue-817145741
;; withTiming/withSpring callback not working on-collapsed should
;; be called as a callback of with-animation instead, once this
;; issue has been resolved
;; withTiming/withSpring callback not working on-collapsed
;; should be called as a callback of with-animation instead,
;; once this issue has been resolved
(timer/set-timeout on-collapsed animation-delay)))

(= @show-bottom-sheet? false)
Expand Down
13 changes: 7 additions & 6 deletions src/legacy/status_im/chat/models/loading.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,13 @@
{:keys [message-id from]
:as message}]
(let [message
;; For example, when a user receives a list of 4 image messages while inside
;; the chat screen we shouldn't group the images into albums. When the user
;; exists the chat screen then enters the chat screen again, we now need to
;; group the images into albums (like WhatsApp). The albumize? boolean is used
;; to know whether we need to group these images into albums now or not. The
;; album-id can't be used for this because it will always be there.
;; For example, when a user receives a list of 4 image messages while
;; inside the chat screen we shouldn't group the images into albums. When
;; the user exists the chat screen then enters the chat screen again, we
;; now need to group the images into albums (like WhatsApp). The albumize?
;; boolean is used to know whether we need to group these images into
;; albums now or not. The album-id can't be used for this because it will
;; always be there.
(if (and (:album-id message) (nil? (get all-messages message-id)))
(assoc message :albumize? true)
message)]
Expand Down
23 changes: 5 additions & 18 deletions src/legacy/status_im/chat/models/message_test.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
:alias "alias"
:name "name"
:from "from"}]
;; <- cursor
;; <- message
;; <- top of the chat
;; <- cursor <- message <- top of the chat
(testing "there's no hidden item"
(with-redefs [list.state/first-not-visible-item (atom nil)]
(is
Expand All @@ -41,10 +39,7 @@
cofx
#js {:messages (to-array [message])})
:utils/dispatch-later)))))
;; <- cursor
;; <- first-hidden-item
;; <- message
;; <- top of the chat
;; <- cursor <- first-hidden-item <- message <- top of the chat
(testing "the hidden item has a clock value less than the current"
(with-redefs [list.state/first-not-visible-item (atom {:clock-value (dec clock-value)})]
(is
Expand All @@ -61,10 +56,7 @@
cofx
#js {:messages (to-array [message])})
:utils/dispatch-later)))))
;; <- cursor
;; <- message
;; <- first-hidden-item
;; <- top of the chat
;; <- cursor <- message <- first-hidden-item <- top of the chat
(testing "the message falls between the first-hidden-item and cursor"
(with-redefs [list.state/first-not-visible-item (atom {:clock-value (inc clock-value)})]
(let [result (dissoc (message/receive-many
Expand All @@ -77,9 +69,7 @@
(is (= clock-value (get-in result [:db :pagination-info chat-id :cursor-clock-value])))
(is (= (loading/clock-value->cursor clock-value)
(get-in result [:db :pagination-info chat-id :cursor])))))))
;; <- message
;; <- first-hidden-item
;; <- top of the chat
;; <- message <- first-hidden-item <- top of the chat
(testing "the message falls between the first-hidden-item and cursor is nil"
(with-redefs [list.state/first-not-visible-item (atom {:clock-value (inc clock-value)})]
(let [result (dissoc (message/receive-many
Expand All @@ -96,10 +86,7 @@
(is (= clock-value (get-in result [:db :pagination-info chat-id :cursor-clock-value])))
(is (= (loading/clock-value->cursor clock-value)
(get-in result [:db :pagination-info chat-id :cursor])))))))
;; <- message
;; <- cursor
;; <- first-hidden-item
;; <- top of the chat
;; <- message <- cursor <- first-hidden-item <- top of the chat
(testing "the message falls before both the first-hidden-item and cursor"
(with-redefs [list.state/first-not-visible-item (atom {:clock-value (inc clock-value)})]
(let [message #js
Expand Down
10 changes: 4 additions & 6 deletions src/legacy/status_im/ens/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@
(rf/defn redirect-to-ens-summary
{:events [::redirect-to-ens-summary]}
[cofx]
;; we reset navigation so that navigate back doesn't return
;; into the registration flow
;; we reset navigation so that navigate back doesn't return into the registration flow
(rf/merge cofx
(navigation/navigate-back-to :my-profile)
(navigation/navigate-to :ens-confirmation {})))
Expand Down Expand Up @@ -161,8 +160,8 @@
(and (= response utils.ens/default-address) (not custom-domain?))
(re-frame/dispatch [::name-resolved username :available])

;; if we get an address back, we try to get the public key associated
;; with the username as well
;; if we get an address back, we try to get the public key associated with the username as
;; well
(get addresses (eip55/address->checksum response))
(ens/pubkey
chain-id
Expand Down Expand Up @@ -271,8 +270,7 @@
(rf/merge cofx
;; clear registration data
{:db (dissoc db :ens/registration)}
;; we reset navigation so that navigate back doesn't return
;; into the registration flow
;; we reset navigation so that navigate back doesn't return into the registration flow
(navigation/navigate-back-to :my-profile)
(navigation/navigate-to :ens-main {})))

Expand Down
4 changes: 2 additions & 2 deletions src/legacy/status_im/keycard/fx.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@
;; TODO: Should act differently on different views
(re-frame/reg-fx
:keycard/listen-to-hardware-back-button
;;NOTE: not done in view because effect should happen under different conditions and is not dependent on
;;particular screen to be loaded. An fx is easier to re-use and test.
;;NOTE: not done in view because effect should happen under different conditions and is not
;;dependent on particular screen to be loaded. An fx is easier to re-use and test.
(fn []
(re-frame/dispatch [:keycard/add-listener-to-hardware-back-button
(.addEventListener BackHandler
Expand Down
4 changes: 2 additions & 2 deletions src/legacy/status_im/popover/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
(let [delay-ms (or (:delay-ms value) 250)
value (dissoc value :delay-ms)]
{:show-popover nil
;; We should probably refactor to start the animation on mount, so that the
;; delay can be removed. See comment for more details:
;; We should probably refactor to start the animation on mount, so that the delay can be
;; removed. See comment for more details:
;; https://github.com/status-im/status-mobile/pull/15222#issuecomment-1450162137
:dispatch-later [{:ms delay-ms :dispatch [:show-popover-db value]}]
:dismiss-keyboard nil}))
Expand Down
4 changes: 2 additions & 2 deletions src/legacy/status_im/ui/components/action_sheet.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

(defn- prepare-options
[title message options]
(let [destructive-opt-index (utils/first-index :destructive? options)] ;; TODO Can only be a single
;; destructive?
(let [destructive-opt-index (utils/first-index :destructive? options)] ;; TODO Can only be a
;; single destructive?
(clj->js (merge {:options (conj (mapv :label options) (i18n/label :t/cancel))
:cancelButtonIndex (count options)}
(when destructive-opt-index
Expand Down
18 changes: 12 additions & 6 deletions src/legacy/status_im/ui/components/colors.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@
{:positive-01 "rgba(68,208,88,1)" ; Primary Positive, text, icons color
:positive-02 "rgba(78,188,96,0.1)" ; Secondary Positive, Supporting color for success
; illustrations
:positive-03 "rgba(78,188,96,1)" ; Lighter Positive, Supporting color for success illustrations
:positive-03 "rgba(78,188,96,1)" ; Lighter Positive, Supporting color for success
; illustrations
:negative-01 "rgba(255,45,85,1)" ; Primary Negative, text, icons color
:negative-02 "rgba(255,45,85,0.1))" ; Secondary Negative, Supporting color for errors
; illustrations
:warning-01 "rgba(255, 202, 15, 1)"
:warning-02 "rgba(255, 202, 15, 0.1)"
:interactive-01 "rgba(67,96,223,1)" ; Accent color, buttons, own message, actions,active state
:interactive-01 "rgba(67,96,223,1)" ; Accent color, buttons, own message, actions,active
; state
:interactive-02 "rgba(236,239,252,1)" ; Light Accent, buttons background, actions background,
; messages
:interactive-03 "rgba(255,255,255,0.1)" ; Background for interactive above accent
Expand Down Expand Up @@ -130,12 +132,14 @@
(def mentioned-background (:mentioned-background old-colors-mapping-light))
(def mentioned-border (:mentioned-border old-colors-mapping-light))

(def red-light "#ffe5ea") ;; error tooltip TODO (andrey) should be white, but shadow needed
(def red-light "#ffe5ea") ;; error tooltip TODO (andrey) should be white, but shadow
;; needed

;; BLACK
(def black (:text-01 light-theme)) ;; Used as the default text color
(def black-persist (:ui-background dark-theme)) ;; this doesn't with theme
(def black-transparent (:ui-02 light-theme)) ;; Used as background color for rounded button on dark background and as background
(def black-transparent (:ui-02 light-theme)) ;; Used as background color for rounded button on dark background and as
;; background
;; color for containers like "Backup recovery phrase"
(def black-transparent-20 (:backdrop light-theme)) ; accounts divider
(def black-transparent-40 (:backdrop light-theme))
Expand All @@ -145,15 +149,17 @@
(def black-transparent-86 (:ui-03 light-theme))

;; DARK GREY
(def gray (:text-02 light-theme)) ;; Dark grey, used as a background for a light foreground and as
(def gray (:text-02 light-theme)) ;; Dark grey, used as a background for a light foreground and
;; as
;; section header and secondary text color
(def gray-transparent-10 (alpha gray 0.1))
(def gray-transparent-40 (alpha gray 0.4))
;; LIGHT GREY
(def gray-lighter (:ui-01 light-theme)) ;; Light Grey, used as a background or shadow

;; ACCENT BLUE
(def blue (:interactive-01 light-theme)) ;; Accent blue, used as main wallet color, and ios home add button
(def blue (:interactive-01 light-theme)) ;; Accent blue, used as main wallet color, and ios home add
;; button
(def blue-persist (:interactive-01 light-theme))
;; LIGHT BLUE
(def blue-light (:interactive-02 light-theme)) ;; Light Blue
Expand Down
12 changes: 6 additions & 6 deletions src/legacy/status_im/ui/components/list/item.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@

(and title subtitle)
[:<>
;; FIXME(Ferossgp): ReactNative 63 will support view inside text on andrid, remove thess if when
;; migrating
;; FIXME(Ferossgp): ReactNative 63 will support view inside text on andrid, remove thess if
;; when migrating
(if (string? title)
[text/text
{:weight (or title-text-weight :medium)
Expand Down Expand Up @@ -179,13 +179,13 @@
{:style (merge {:align-items :center
:justify-content :flex-end
:flex-direction :row
;; Grow to occupy full space, shrink when need be, but always maitaining 16px left
;; gutter
;; Grow to occupy full space, shrink when need be, but always maitaining 16px
;; left gutter
:flex-grow 1
:flex-shrink 0
:margin-left 16
;; When the left-side leaves no room for right-side, the rendered element is pushed
;; out. A flex-basis ensures that there is some room reserved.
;; When the left-side leaves no room for right-side, the rendered element is
;; pushed out. A flex-basis ensures that there is some room reserved.
;; The number 80px was determined by trial and error.
:flex-basis 80}
accessory-style)}
Expand Down
7 changes: 3 additions & 4 deletions src/legacy/status_im/ui/components/text_input.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@
:on-press #(reset! visible true)}

:else after)
secure (boolean (and secure-text-entry (not @visible))) ; must be a boolean to work on
; iOS
secure (boolean (and secure-text-entry (not @visible))) ; must be a boolean to
; work on iOS
auto-complete (cond
(= keyboard-type :visible-password)
:off
Expand All @@ -211,8 +211,7 @@
:default

; the correct approach on Android would be keep secure-text-entry on set
; keyboard type
; to visible-password. But until
; keyboard type to visible-password. But until
; https://github.com/facebook/react-native/issues/27946
; is solved that's the second best way.
(and platform/android? secure-text-entry)
Expand Down
5 changes: 3 additions & 2 deletions src/legacy/status_im/ui/components/topbar.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@

(defn topbar
[{:keys [navigation use-insets right-accessories modal? content border-bottom? new-ui?] ;; remove
;; new-ui? key,
;; temp fix
;; new-ui?
;; key, temp
;; fix
:or {border-bottom? true
new-ui? false}
:as props}]
Expand Down
Loading

0 comments on commit 32fe10a

Please sign in to comment.