Skip to content

Commit

Permalink
some polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
briansztamfater committed Sep 14, 2023
1 parent 1870e46 commit 3d1ad13
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 38 deletions.
16 changes: 8 additions & 8 deletions src/quo2/components/inputs/address_input/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@

(defn- f-address-input-internal
[]
(let [status (reagent/atom :default)
value (reagent/atom "")
clipboard (reagent/atom nil)
focused? (atom false)]
(let [status (reagent/atom :default)
value (reagent/atom "")
focused? (atom false)]
(fn [{:keys [scanned-value theme blur? on-change-text on-blur on-focus on-clear on-scan on-detect-ens
ens-regex
valid-ens?]}]
Expand All @@ -75,9 +74,11 @@
(reset! status :loading)
(on-detect-ens text))))
on-paste (fn []
(when-not (empty? @clipboard)
(on-change @clipboard)
(reset! value @clipboard)))
(clipboard/get-string
(fn [clipboard]
(when-not (empty? clipboard)
(on-change clipboard)
(reset! value clipboard)))))
on-clear (fn []
(reset! value "")
(reset! status (if @focused? :active :default))
Expand All @@ -100,7 +101,6 @@
(when-not (empty? scanned-value)
(on-change scanned-value)))
[scanned-value])
(clipboard/get-string #(reset! clipboard %))
[rn/view {:style style/container}
[rn/text-input
{:accessibility-label :address-text-input
Expand Down
6 changes: 4 additions & 2 deletions src/quo2/components/tabs/tabs/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
scroll-on-press?
scrollable?
style
content-style
size
blur?
in-scroll-view?
Expand Down Expand Up @@ -160,13 +161,14 @@
(when scroll-on-press?
{:initial-scroll-index (utils.collection/first-index #(= @active-tab-id (:id %)) data)})
{:ref #(reset! flat-list-ref %)
:style style
;:style style
;; The padding-top workaround is needed because on Android
;; {:overflow :visible} doesn't work on components inheriting
;; from ScrollView (e.g. FlatList). There are open issues, here's
;; just one about this topic:
;; https://github.com/facebook/react-native/issues/31218
:content-container-style {:padding-top (dec unread-count-offset)}
:content-container-style (merge content-style
{:padding-top (dec unread-count-offset)})
:horizontal true
:scroll-event-throttle 64
:shows-horizontal-scroll-indicator false
Expand Down
20 changes: 12 additions & 8 deletions src/status_im2/contexts/wallet/send/select_address/style.cljs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns status-im2.contexts.wallet.send.select-address.style
(ns status-im2.contexts.wallet.send.select-address.style
(:require [quo2.foundations.colors :as colors]))

(defn container
Expand All @@ -10,14 +10,18 @@
{:margin-horizontal 20
:margin-vertical 12})

(defn tabs
(defn divider
[theme]
{:border-top-width 1
:border-top-color (colors/theme-colors colors/neutral-10 colors/neutral-90 theme)
:padding-left 20
:padding-right 30
:padding-top 20
:padding-bottom 12})
{:border-top-width 1
:border-top-color (colors/theme-colors colors/neutral-10 colors/neutral-90 theme)})

(def tabs
{:padding-top 20
:padding-bottom 12})

(def tabs-content
{:padding-left 20
:padding-right 8})

(def empty-container-style
{:justify-content :center
Expand Down
42 changes: 22 additions & 20 deletions src/status_im2/contexts/wallet/send/select_address/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,31 @@
{:icon-name :i/close
:on-press #(rf/dispatch [:navigate-back])
:accessibility-label :top-bar
:right-side {:icon-name :i/my-icon
:on-press #(js/alert "Not implemented yet")
:accessibility-label :account-button}}]
[quo/text-combinations {:title (i18n/label :t/send-to)
:container-style style/title-container
:title-accessibility-label :title-label}]
:right-side :account-switcher}]
[quo/text-combinations
{:title (i18n/label :t/send-to)
:container-style style/title-container
:title-accessibility-label :title-label}]
[quo/address-input
{:on-scan #(js/alert "Not implemented yet")
:ens-regex constants/regx-ens
:on-detect-ens (fn [_]
(reset! valid-ens? false)
(when @timer
(js/clearTimeout @timer))
(reset! timer (js/setTimeout #(reset! valid-ens? false)
2000)))
{:on-scan #(js/alert "Not implemented yet")
:ens-regex constants/regx-ens
:on-detect-ens (fn [_]
(reset! valid-ens? false)
(when @timer
(js/clearTimeout @timer))
(reset! timer (js/setTimeout #(reset! valid-ens? false)
2000)))
:on-change-text #(reset! input-value %)}]
[rn/view {:style (style/divider theme)}]
[quo/tabs
{:style (style/tabs theme)
:size 32
:default-active @selected-tab
:data tabs-data
:scrollable? true
:on-change #(reset! selected-tab %)}]
{:style style/tabs
:content-style style/tabs-content
:size 32
:default-active @selected-tab
:data tabs-data
:scrollable? true
:scroll-on-press? true
:on-change #(reset! selected-tab %)}]
(case @selected-tab
:recent [quo/empty-state
{:title (i18n/label :t/no-recent-transactions)
Expand Down

0 comments on commit 3d1ad13

Please sign in to comment.