Skip to content

Commit

Permalink
chore(wallet): hide share button on scanner pages except universal sc…
Browse files Browse the repository at this point in the history
…anner
  • Loading branch information
J-Son89 authored May 21, 2024
1 parent 32123d2 commit ed88170
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
30 changes: 16 additions & 14 deletions src/status_im/common/scan_qr_code/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
(defonce camera-permission-granted? (reagent/atom false))

(defn- header
[{:keys [title subtitle]}]
[{:keys [title subtitle share-button?]}]
[:<>
[rn/view {:style style/header-container}
[quo/button
Expand All @@ -31,16 +31,17 @@
:accessibility-label :close-scan-qr-code
:on-press #(rf/dispatch [:navigate-back])}
:i/close]
[quo/button
{:icon-only? true
:type :grey
:background :blur
:size 32
:accessibility-label :show-qr-button
:on-press (fn []
(rf/dispatch [:navigate-back])
(rf/dispatch [:open-modal :screen/share-shell]))}
:i/qr-code]]
(when share-button?
[quo/button
{:icon-only? true
:type :grey
:background :blur
:size 32
:accessibility-label :show-qr-button
:on-press (fn []
(rf/dispatch [:navigate-back])
(rf/dispatch [:open-modal :screen/share-shell]))}
:i/qr-code])]
[quo/text
{:size :heading-1
:weight :semi-bold
Expand Down Expand Up @@ -195,7 +196,7 @@
true)

(defn view
[{:keys [title subtitle validate-fn on-success-scan error-message]}]
[{:keys [title subtitle validate-fn on-success-scan error-message share-button?]}]
(let [insets (safe-area/get-insets)
qr-code-succeed? (reagent/atom false)
qr-view-finder (reagent/atom {})
Expand Down Expand Up @@ -237,8 +238,9 @@
:set-rescan-timeout set-rescan-timeout}])
[rn/view {:style (style/root-container (:top insets))}
[header
{:title title
:subtitle subtitle}]
{:title title
:subtitle subtitle
:share-button? share-button?}]
(when (empty? @qr-view-finder)
[:<>
[rn/view {:style style/scan-qr-code-container}]
Expand Down
1 change: 1 addition & 0 deletions src/status_im/contexts/shell/qr_reader/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
(rn/dismiss-keyboard!))
[scan-qr-code/view
{:title (i18n/label :t/scan-qr)
:share-button? true
:on-success-scan on-qr-code-scanned}]]))

(defn view
Expand Down

0 comments on commit ed88170

Please sign in to comment.