feat: add feature flag for swaps (#19920)
Signed-off-by: Brian Sztamfater <brian@status.im>
This commit is contained in:
parent
10f5f9ec7d
commit
842dbbbd8d
|
@ -24,7 +24,7 @@
|
||||||
:color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)}} text]])
|
:color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)}} text]])
|
||||||
|
|
||||||
(defn view
|
(defn view
|
||||||
[{:keys [buy-action send-action receive-action bridge-action container-style]}]
|
[{:keys [buy-action send-action receive-action bridge-action swap-action container-style]}]
|
||||||
(let [theme (quo.theme/use-theme)]
|
(let [theme (quo.theme/use-theme)]
|
||||||
[rn/view {:style container-style}
|
[rn/view {:style container-style}
|
||||||
[rn/view {:style style/inner-container}
|
[rn/view {:style style/inner-container}
|
||||||
|
@ -46,6 +46,13 @@
|
||||||
:on-press receive-action
|
:on-press receive-action
|
||||||
:theme theme
|
:theme theme
|
||||||
:accessibility-label :receive}]
|
:accessibility-label :receive}]
|
||||||
|
(when swap-action
|
||||||
|
[action-button
|
||||||
|
{:icon :i/swap
|
||||||
|
:text (i18n/label :t/swap)
|
||||||
|
:on-press swap-action
|
||||||
|
:theme theme
|
||||||
|
:accessibility-label :swap}])
|
||||||
[action-button
|
[action-button
|
||||||
{:icon :i/bridge
|
{:icon :i/bridge
|
||||||
:text (i18n/label :t/bridge)
|
:text (i18n/label :t/bridge)
|
||||||
|
|
|
@ -14,4 +14,5 @@
|
||||||
:buy-action #(js/alert "Buy button pressed")
|
:buy-action #(js/alert "Buy button pressed")
|
||||||
:send-action #(js/alert "Send button pressed")
|
:send-action #(js/alert "Send button pressed")
|
||||||
:receive-action #(js/alert "Receive button pressed")
|
:receive-action #(js/alert "Receive button pressed")
|
||||||
:bridge-action #(js/alert "Bridge button pressed")}]])
|
:bridge-action #(js/alert "Bridge button pressed")
|
||||||
|
:swap-action #(js/alert "Swap button pressed")}]])
|
||||||
|
|
|
@ -51,6 +51,8 @@
|
||||||
{:status :receive}])
|
{:status :receive}])
|
||||||
:buy-action #(rf/dispatch [:show-bottom-sheet
|
:buy-action #(rf/dispatch [:show-bottom-sheet
|
||||||
{:content buy-token/view}])
|
{:content buy-token/view}])
|
||||||
|
:swap-action (when (ff/enabled? ::ff/wallet.swap)
|
||||||
|
#(rf/dispatch [:wallet/start-swap]))
|
||||||
:bridge-action #(rf/dispatch [:wallet/start-bridge])}])
|
:bridge-action #(rf/dispatch [:wallet/start-bridge])}])
|
||||||
[quo/tabs
|
[quo/tabs
|
||||||
{:style style/tabs
|
{:style style/tabs
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
(ns status-im.contexts.wallet.swap.events
|
||||||
|
(:require [re-frame.core :as rf]))
|
||||||
|
|
||||||
|
(rf/reg-event-fx :wallet/start-swap
|
||||||
|
(fn [{:keys [_db]}]
|
||||||
|
{:fx [[:dispatch
|
||||||
|
[:toasts/upsert
|
||||||
|
{:id :swap-error
|
||||||
|
:type :negative
|
||||||
|
:text "Swap is under construction"}]]]}))
|
|
@ -39,6 +39,7 @@
|
||||||
status-im.contexts.wallet.events
|
status-im.contexts.wallet.events
|
||||||
status-im.contexts.wallet.send.events
|
status-im.contexts.wallet.send.events
|
||||||
status-im.contexts.wallet.signals
|
status-im.contexts.wallet.signals
|
||||||
|
status-im.contexts.wallet.swap.events
|
||||||
[status-im.db :as db]
|
[status-im.db :as db]
|
||||||
status-im.navigation.effects
|
status-im.navigation.effects
|
||||||
status-im.navigation.events
|
status-im.navigation.events
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
::wallet.graph (enabled-in-env? :FLAG_GRAPH_ENABLED)
|
::wallet.graph (enabled-in-env? :FLAG_GRAPH_ENABLED)
|
||||||
::wallet.import-private-key (enabled-in-env? :FLAG_IMPORT_PRIVATE_KEY_ENABLED)
|
::wallet.import-private-key (enabled-in-env? :FLAG_IMPORT_PRIVATE_KEY_ENABLED)
|
||||||
::wallet.long-press-watch-only-asset (enabled-in-env? :FLAG_LONG_PRESS_WATCH_ONLY_ASSET_ENABLED)
|
::wallet.long-press-watch-only-asset (enabled-in-env? :FLAG_LONG_PRESS_WATCH_ONLY_ASSET_ENABLED)
|
||||||
|
::wallet.swap (enabled-in-env? :FLAG_SWAP_ENABLED)
|
||||||
::wallet.wallet-connect (enabled-in-env? :FLAG_WALLET_CONNECT_ENABLED)}))
|
::wallet.wallet-connect (enabled-in-env? :FLAG_WALLET_CONNECT_ENABLED)}))
|
||||||
|
|
||||||
(defn feature-flags [] @feature-flags-config)
|
(defn feature-flags [] @feature-flags-config)
|
||||||
|
|
Loading…
Reference in New Issue