Skip to content

Commit

Permalink
refactor: suggested routes rendering
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Sztamfater <brian@status.im>
  • Loading branch information
briansztamfater committed May 3, 2024
1 parent d8d1e03 commit 4f24cb6
Show file tree
Hide file tree
Showing 19 changed files with 865 additions and 443 deletions.
2 changes: 1 addition & 1 deletion src/quo/components/wallet/network_bridge/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
[{:keys [network status amount container-style on-press] :as args}]
(let [theme (quo.theme/use-theme)]
(if (= status :add)
[network-bridge-add args]
[network-bridge-add (assoc args :theme theme)]
[rn/pressable
{:style (merge (style/container network status theme) container-style)
:accessible true
Expand Down
4 changes: 2 additions & 2 deletions src/quo/components/wallet/network_link/style.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@

(def link-1x-container
{:flex 1
:height 58
:height 57
:justify-content :center})

(def link-2x-container
{:flex 1
:height 114
:height 112
:justify-content :center})
33 changes: 25 additions & 8 deletions src/quo/components/wallet/network_link/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -24,33 +24,50 @@
:strokeWidth "1"}]])

(defn- line
[stroke width]
[{:keys [stroke-color source-color destination-color width theme]}]
[svg/svg
{:height "10"
:width "100%"
:view-box (str "0 0 " width " 10")}
[svg/path
{:d (str "M0,5 L" width ",5")
:stroke stroke
:stroke-width "1"}]])
:stroke stroke-color
:stroke-width "1"}]
[svg/defs
[svg/linear-gradient
{:id "gradient"
:x1 "0%"
:x2 "100%"
:y1 "0%"
:y2 "0%"
:gradient-units "objectBoundingBox"}
[svg/stop {:offset "0%" :stop-color (colors/resolve-color source-color theme)}]
[svg/stop {:offset "100%" :stop-color (colors/resolve-color destination-color theme)}]]]])

(defn link-linear
[{:keys [source]}]
[{:keys [source destination]}]
(let [theme (quo.theme/use-theme)
[container-width
set-container-width] (rn/use-state 100)
stroke-color (colors/resolve-color source theme)
stroke-color "url(#gradient)"
source-color (colors/resolve-color source theme)
destination-color (colors/resolve-color destination theme)
fill-color (colors/theme-colors colors/white colors/neutral-90 theme)
on-layout (rn/use-callback #(set-container-width
(oget % :nativeEvent :layout :width)))]
[rn/view
{:style style/link-linear-container
:on-layout on-layout}
[line stroke-color container-width]
[line
{:stroke-color stroke-color
:source-color source-color
:destination-color destination-color
:width container-width
:theme theme}]
[rn/view {:style style/left-circle-container}
[circle fill-color stroke-color]]
[circle fill-color source-color]]
[rn/view {:style style/right-circle-container}
[circle fill-color stroke-color]]]))
[circle fill-color destination-color]]]))

(defn link-1x
[{:keys [source destination]}]
Expand Down
8 changes: 8 additions & 0 deletions src/status_im/contexts/wallet/common/utils.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,11 @@
{}
tokens)
(update-vals #(prettify-balance currency-symbol %))))

(defn format-token-id
[token collectible]
(if token
(:symbol token)
(str (get-in collectible [:id :contract-id :address])
":"
(get-in collectible [:id :token-id]))))
34 changes: 0 additions & 34 deletions src/status_im/contexts/wallet/common/utils/send.cljs

This file was deleted.

116 changes: 0 additions & 116 deletions src/status_im/contexts/wallet/common/utils/send_test.cljs

This file was deleted.

0 comments on commit 4f24cb6

Please sign in to comment.