feat(swap): show and link to provider terms and conditions (#21311)
Signed-off-by: Brian Sztamfater <brian@status.im>
This commit is contained in:
parent
9c73d9d03c
commit
24f482014b
|
@ -595,7 +595,7 @@
|
||||||
(def ^:const max-slippage-decimal-places 2)
|
(def ^:const max-slippage-decimal-places 2)
|
||||||
(def ^:const swap-provider-paraswap
|
(def ^:const swap-provider-paraswap
|
||||||
{:name :paraswap
|
{:name :paraswap
|
||||||
:full-name "Paraswap"
|
:full-name "ParaSwap"
|
||||||
:color :blue
|
:color :blue
|
||||||
:contract-address "0xdef171fe48cf0115b1d80b88dc8eab59176fee57"
|
:contract-address "0xdef171fe48cf0115b1d80b88dc8eab59176fee57"
|
||||||
:terms-and-conditions-url "https://files.paraswap.io/tos_v4.pdf"})
|
:terms-and-conditions-url "https://files.paraswap.io/tos_v4.pdf"})
|
||||||
|
|
|
@ -10,6 +10,9 @@
|
||||||
:height 36
|
:height 36
|
||||||
:background-color :transparent})
|
:background-color :transparent})
|
||||||
|
|
||||||
|
(def scroll-view-container
|
||||||
|
{:padding-bottom 150})
|
||||||
|
|
||||||
(def content-container
|
(def content-container
|
||||||
{:padding-top 12
|
{:padding-top 12
|
||||||
:padding-horizontal 20
|
:padding-horizontal 20
|
||||||
|
@ -38,3 +41,20 @@
|
||||||
[theme]
|
[theme]
|
||||||
{:margin-bottom 8
|
{:margin-bottom 8
|
||||||
:color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)})
|
:color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)})
|
||||||
|
|
||||||
|
(def providers-container
|
||||||
|
{:align-items :center
|
||||||
|
:margin-top 12})
|
||||||
|
|
||||||
|
(defn swaps-powered-by
|
||||||
|
[theme]
|
||||||
|
{:color (colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-70 theme)})
|
||||||
|
|
||||||
|
(defn terms-and-conditions
|
||||||
|
[theme]
|
||||||
|
{:color (colors/theme-colors colors/neutral-100 colors/white theme)})
|
||||||
|
|
||||||
|
(defn footer-container
|
||||||
|
[theme]
|
||||||
|
{:margin-bottom -10
|
||||||
|
:background-color (colors/theme-colors colors/white colors/neutral-100 theme)})
|
||||||
|
|
|
@ -228,9 +228,25 @@
|
||||||
|
|
||||||
(defn- footer
|
(defn- footer
|
||||||
[]
|
[]
|
||||||
[rn/view {:style {:margin-bottom -10}}
|
(let [provider (rf/sub [:wallet/swap-proposal-provider])
|
||||||
[transaction-details]
|
theme (quo.theme/use-theme)
|
||||||
[slide-button]])
|
on-press (rn/use-callback #(when provider
|
||||||
|
(rf/dispatch [:open-url (:terms-and-conditions-url provider)]))
|
||||||
|
[provider])]
|
||||||
|
[rn/view {:style (style/footer-container theme)}
|
||||||
|
[transaction-details]
|
||||||
|
[slide-button]
|
||||||
|
[rn/view {:style style/providers-container}
|
||||||
|
[quo/text
|
||||||
|
{:size :paragraph-2
|
||||||
|
:style (style/swaps-powered-by theme)}
|
||||||
|
(i18n/label :t/swaps-powered-by
|
||||||
|
{:provider (if provider (:full-name provider) (i18n/label :t/unknown))})]
|
||||||
|
[quo/text
|
||||||
|
{:size :paragraph-2
|
||||||
|
:style (style/terms-and-conditions theme)
|
||||||
|
:on-press on-press}
|
||||||
|
(i18n/label :t/terms-and-conditions)]]]))
|
||||||
|
|
||||||
(defn view
|
(defn view
|
||||||
[]
|
[]
|
||||||
|
@ -247,7 +263,7 @@
|
||||||
:footer [footer]
|
:footer [footer]
|
||||||
:gradient-cover? true
|
:gradient-cover? true
|
||||||
:customization-color (:color account)}
|
:customization-color (:color account)}
|
||||||
[:<>
|
[rn/scroll-view {:style style/scroll-view-container}
|
||||||
[swap-title]
|
[swap-title]
|
||||||
[spending-cap-section]
|
[spending-cap-section]
|
||||||
[account-section]
|
[account-section]
|
||||||
|
|
|
@ -41,3 +41,7 @@
|
||||||
(defn swaps-powered-by
|
(defn swaps-powered-by
|
||||||
[theme]
|
[theme]
|
||||||
{:color (colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-70 theme)})
|
{:color (colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-70 theme)})
|
||||||
|
|
||||||
|
(defn terms-and-conditions
|
||||||
|
[theme]
|
||||||
|
{:color (colors/theme-colors colors/neutral-100 colors/white theme)})
|
||||||
|
|
|
@ -177,7 +177,10 @@
|
||||||
(defn footer
|
(defn footer
|
||||||
[]
|
[]
|
||||||
(let [provider (rf/sub [:wallet/swap-proposal-provider])
|
(let [provider (rf/sub [:wallet/swap-proposal-provider])
|
||||||
theme (quo.theme/use-theme)]
|
theme (quo.theme/use-theme)
|
||||||
|
on-press (rn/use-callback #(when provider
|
||||||
|
(rf/dispatch [:open-url (:terms-and-conditions-url provider)]))
|
||||||
|
[provider])]
|
||||||
[:<>
|
[:<>
|
||||||
[transaction-details]
|
[transaction-details]
|
||||||
[slide-button]
|
[slide-button]
|
||||||
|
@ -186,7 +189,12 @@
|
||||||
{:size :paragraph-2
|
{:size :paragraph-2
|
||||||
:style (style/swaps-powered-by theme)}
|
:style (style/swaps-powered-by theme)}
|
||||||
(i18n/label :t/swaps-powered-by
|
(i18n/label :t/swaps-powered-by
|
||||||
{:provider (if provider (:full-name provider) (i18n/label :t/unknown))})]]]))
|
{:provider (if provider (:full-name provider) (i18n/label :t/unknown))})]
|
||||||
|
[quo/text
|
||||||
|
{:size :paragraph-2
|
||||||
|
:style (style/terms-and-conditions theme)
|
||||||
|
:on-press on-press}
|
||||||
|
(i18n/label :t/terms-and-conditions)]]]))
|
||||||
|
|
||||||
(defn view
|
(defn view
|
||||||
[]
|
[]
|
||||||
|
|
|
@ -2403,7 +2403,7 @@
|
||||||
"swap-failed": "Swap failed",
|
"swap-failed": "Swap failed",
|
||||||
"swapped-to": "Swapped {{pay-amount}} {{pay-token-symbol}} to {{receive-amount}} {{receive-token-symbol}}",
|
"swapped-to": "Swapped {{pay-amount}} {{pay-token-symbol}} to {{receive-amount}} {{receive-token-symbol}}",
|
||||||
"swapping-to": "Swapping {{pay-amount}} {{pay-token-symbol}} to {{receive-amount}} {{receive-token-symbol}}",
|
"swapping-to": "Swapping {{pay-amount}} {{pay-token-symbol}} to {{receive-amount}} {{receive-token-symbol}}",
|
||||||
"swaps-powered-by": "Swaps powered by {{provider}}",
|
"swaps-powered-by": "Powered by {{provider}}",
|
||||||
"switch-to-simple-interface": "Switch to simple interface",
|
"switch-to-simple-interface": "Switch to simple interface",
|
||||||
"symbol": "Symbol",
|
"symbol": "Symbol",
|
||||||
"sync-all-devices": "Sync all devices",
|
"sync-all-devices": "Sync all devices",
|
||||||
|
@ -2436,6 +2436,7 @@
|
||||||
"tap": "Tap",
|
"tap": "Tap",
|
||||||
"tap-card-again": "Tap the card to the back of your phone again",
|
"tap-card-again": "Tap the card to the back of your phone again",
|
||||||
"tap-on": "Tap on",
|
"tap-on": "Tap on",
|
||||||
|
"terms-and-conditions": "Terms and Conditions",
|
||||||
"terms-of-service": "Terms of Use",
|
"terms-of-service": "Terms of Use",
|
||||||
"testnet-mode": "Testnet mode",
|
"testnet-mode": "Testnet mode",
|
||||||
"testnet-mode-disable-description": "Are you sure you want to turn off Testnet mode? All future transactions will be performed on live networks with real funds.",
|
"testnet-mode-disable-description": "Are you sure you want to turn off Testnet mode? All future transactions will be performed on live networks with real funds.",
|
||||||
|
|
Loading…
Reference in New Issue