Skip to content

Commit

Permalink
One-time & recurrent tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
ajayesivan committed May 17, 2024
1 parent 6cf87e8 commit c6e0426
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 6 deletions.
14 changes: 14 additions & 0 deletions src/status_im/contexts/wallet/common/temp.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,17 @@
:image :icon-avatar
:image-props {:icon (status.resources/get-service-image :latamex)}
:on-press #(rn/open-url "https://latamex.com")}])

(def buy-tokens-list-recurrent
[{:title "Ramp"
:description :text
:description-props {:text (i18n/label :t/ramp-description)}
:tag :context
:tag-props {:icon :i/fees
:context "0.49% - 2.9%"}
:action :arrow
:action-props {:alignment :flex-start
:icon :i/external}
:image :icon-avatar
:image-props {:icon (status.resources/get-service-image :ramp)}
:on-press #(rn/open-url "https://ramp.com")}])
25 changes: 19 additions & 6 deletions src/status_im/contexts/wallet/sheets/buy_token/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,22 @@

(defn view
[]
[:<>
[quo/drawer-top {:title (i18n/label :t/buy-assets)}]
[rn/flat-list
{:data temp/buy-tokens-list
:style style/list-container
:render-fn quo/settings-item}]])
(let [[selected-tab set-selected-tab] (rn/use-state :one-time)]
[:<>
[quo/drawer-top {:title (i18n/label :t/buy-assets)}]
[quo/segmented-control
{:size 32
:container-style {:margin-horizontal 20
:margin-top 8
:margin-bottom 12}
:default-active :one-time
:on-change set-selected-tab
:data [{:id :one-time
:label "One time"}
{:id :recurrent
:label "Recurrent"}]}]
(print selected-tab)
[rn/flat-list
{:data (if (= selected-tab :one-time) temp/buy-tokens-list temp/buy-tokens-list-recurrent)
:style style/list-container
:render-fn quo/settings-item}]]))

0 comments on commit c6e0426

Please sign in to comment.