Skip to content

Commit

Permalink
Keyword param and namespace formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ulisesmac committed Oct 27, 2023
1 parent cce7981 commit 0eaec99
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 58 deletions.
58 changes: 29 additions & 29 deletions src/quo/components/share/share_qr_code/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -136,38 +136,38 @@

(def ^:private known-networks #{:ethereum :optimism :arbitrum})

(defn- get-network-image-source
[network]
{:source (quo.resources/get-network (get known-networks network :unknown))})

(defn wallet-multichain-bottom
[{:keys [share-qr-type component-width qr-data on-text-press on-text-long-press
on-share-press networks on-settings-press]}]
(let [network-image-source (fn [network]
{:source (-> known-networks
(get network :unknown)
(quo.resources/get-network))})]
[rn/view {:style style/wallet-multichain-container}
[rn/view {:style style/wallet-multichain-networks}
[preview-list/view {:type :network :size :size-32}
(map network-image-source networks)]
[button/button
{:icon-only? true
:type :grey
:background :blur
:size 32
:accessibility-label :share-qr-code-settings
:on-press on-settings-press}
:i/advanced]]
[rn/view {:style style/divider-container}
[dashed-line component-width]]
[rn/view {:style style/wallet-multichain-data-container}
[info-label share-qr-type]
[rn/view {:style style/wallet-data-and-share-container}
[info-text
{:width component-width
:on-press on-text-press
:on-long-press on-text-long-press}
[wallet-multichain-colored-address qr-data]]
[share-button
{:alignment :top
:on-press on-share-press}]]]]))
[rn/view {:style style/wallet-multichain-container}
[rn/view {:style style/wallet-multichain-networks}
[preview-list/view {:type :network :size :size-32}
(map get-network-image-source networks)]
[button/button
{:icon-only? true
:type :grey
:background :blur
:size 32
:accessibility-label :share-qr-code-settings
:on-press on-settings-press}
:i/advanced]]
[rn/view {:style style/divider-container}
[dashed-line component-width]]
[rn/view {:style style/wallet-multichain-data-container}
[info-label share-qr-type]
[rn/view {:style style/wallet-data-and-share-container}
[info-text
{:width component-width
:on-press on-text-press
:on-long-press on-text-long-press}
[wallet-multichain-colored-address qr-data]]
[share-button
{:alignment :top
:on-press on-share-press}]]]])

(defn- share-qr-code
[{:keys [share-qr-type qr-image-uri component-width customization-color full-name
Expand Down
6 changes: 3 additions & 3 deletions src/status_im2/common/qr_codes/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@
[quo/qr-code (assoc props :qr-image-uri qr-media-server-uri)]))

(defn- get-network-short-name-url
[network-kw]
(case network-kw
[network]
(case network
:ethereum "eth:"
:optimism "opt:"
:arbitrum "arb1:"
(str (name network-kw) ":")))
(str (name network) ":")))

(defn- get-qr-data-for-wallet-multichain
[qr-data networks]
Expand Down
21 changes: 11 additions & 10 deletions src/status_im2/contexts/quo_preview/share/share_qr_code.cljs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
(ns status-im2.contexts.quo-preview.share.share-qr-code
(:require [quo.core :as quo]
[react-native.core :as rn]
[reagent.core :as reagent]
[status-im2.common.resources :as resources]
[status-im2.contexts.quo-preview.preview :as preview]
[utils.image-server :as image-server]
[utils.re-frame :as rf]))
(:require
[quo.core :as quo]
[react-native.core :as rn]
[reagent.core :as reagent]
[status-im2.common.resources :as resources]
[status-im2.contexts.quo-preview.preview :as preview]
[utils.image-server :as image-server]
[utils.re-frame :as rf]))

(def descriptor
[{:key :qr-data
Expand Down Expand Up @@ -59,12 +60,12 @@
:value "Ethereum, Optimism, Arbitrum and unknown"}]}])

(defn- get-network-short-name-url
[network-kw]
(case network-kw
[network]
(case network
:ethereum "eth:"
:optimism "opt:"
:arbitrum "arb1:"
(str (name network-kw) ":")))
(str (name network) ":")))

(def ^:private profile-link
"https://join.status.im/u/zQ3shfc5Wqnu")
Expand Down
33 changes: 17 additions & 16 deletions src/status_im2/contexts/shell/share/view.cljs
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
(ns status-im2.contexts.shell.share.view
(:require [clojure.string :as string]
[quo.core :as quo]
[quo.foundations.colors :as colors]
[react-native.blur :as blur]
[react-native.core :as rn]
[react-native.platform :as platform]
[react-native.safe-area :as safe-area]
[reagent.core :as reagent]
[status-im.multiaccounts.core :as multiaccounts]
[status-im.ui.components.list-selection :as list-selection]
[status-im2.common.qr-codes.view :as qr-codes]
[status-im2.contexts.shell.share.style :as style]
[utils.address :as address]
[utils.i18n :as i18n]
[utils.image-server :as image-server]
[utils.re-frame :as rf]))
(:require
[clojure.string :as string]
[quo.core :as quo]
[quo.foundations.colors :as colors]
[react-native.blur :as blur]
[react-native.core :as rn]
[react-native.platform :as platform]
[react-native.safe-area :as safe-area]
[reagent.core :as reagent]
[status-im.multiaccounts.core :as multiaccounts]
[status-im.ui.components.list-selection :as list-selection]
[status-im2.common.qr-codes.view :as qr-codes]
[status-im2.contexts.shell.share.style :as style]
[utils.address :as address]
[utils.i18n :as i18n]
[utils.image-server :as image-server]
[utils.re-frame :as rf]))

(defn header
[]
Expand Down

0 comments on commit 0eaec99

Please sign in to comment.