Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a42289f387 |
@@ -1,12 +1,10 @@
|
|||||||
(ns quo.components.list-items.token-value.view
|
(ns quo.components.list-items.token-value.view
|
||||||
(:require
|
(:require
|
||||||
[clojure.string :as string]
|
|
||||||
[quo.components.icon :as icon]
|
[quo.components.icon :as icon]
|
||||||
[quo.components.list-items.token-value.style :as style]
|
[quo.components.list-items.token-value.style :as style]
|
||||||
[quo.components.markdown.text :as text]
|
[quo.components.markdown.text :as text]
|
||||||
[quo.components.utilities.token.view :as token]
|
[quo.components.utilities.token.view :as token]
|
||||||
[quo.foundations.colors :as colors]
|
[quo.foundations.colors :as colors]
|
||||||
[quo.foundations.common :as common]
|
|
||||||
[quo.theme :as quo.theme]
|
[quo.theme :as quo.theme]
|
||||||
[react-native.core :as rn]
|
[react-native.core :as rn]
|
||||||
[reagent.core :as reagent]))
|
[reagent.core :as reagent]))
|
||||||
@@ -14,7 +12,8 @@
|
|||||||
(defn- internal-view
|
(defn- internal-view
|
||||||
[]
|
[]
|
||||||
(let [state (reagent/atom :default)]
|
(let [state (reagent/atom :default)]
|
||||||
(fn [{:keys [theme customization-color status token metrics? values on-press on-long-press]}]
|
(fn [{:keys [theme customization-color status token metrics? values on-press
|
||||||
|
on-long-press]}]
|
||||||
(let [bg-opacity (case @state
|
(let [bg-opacity (case @state
|
||||||
:active 10
|
:active 10
|
||||||
:pressed 5
|
:pressed 5
|
||||||
@@ -34,13 +33,13 @@
|
|||||||
{:style {:flex-direction :row
|
{:style {:flex-direction :row
|
||||||
:align-items :center
|
:align-items :center
|
||||||
:flex 1}}
|
:flex 1}}
|
||||||
[token/view {:token token :size :size-32}]
|
[token/view {:token (:symbol token) :size :size-32}]
|
||||||
[rn/view {:style {:margin-left 8}}
|
[rn/view {:style {:margin-left 8}}
|
||||||
[text/text {:weight :semi-bold} (common/token-label token)]
|
[text/text {:weight :semi-bold} (:name token)]
|
||||||
[text/text
|
[text/text
|
||||||
{:size :paragraph-2
|
{:size :paragraph-2
|
||||||
:style {:color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)}}
|
:style {:color (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)}}
|
||||||
(str crypto-value " " (if token (string/upper-case (clj->js token)) ""))]]]
|
(str crypto-value " " (:symbol token))]]]
|
||||||
[rn/view
|
[rn/view
|
||||||
{:style {:align-items :flex-end
|
{:style {:align-items :flex-end
|
||||||
:justify-content :space-between}}
|
:justify-content :space-between}}
|
||||||
|
|||||||
@@ -3,8 +3,3 @@
|
|||||||
(def currency-label
|
(def currency-label
|
||||||
{:eur "€"
|
{:eur "€"
|
||||||
:usd "$"})
|
:usd "$"})
|
||||||
|
|
||||||
(def token-label
|
|
||||||
{:eth "Ethereum"
|
|
||||||
:snt "Status"
|
|
||||||
:dai "Dai"})
|
|
||||||
|
|||||||
@@ -5,11 +5,7 @@
|
|||||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||||
|
|
||||||
(def descriptor
|
(def descriptor
|
||||||
[{:key :token
|
[{:key :status
|
||||||
:type :select
|
|
||||||
:options [{:key :eth}
|
|
||||||
{:key :snt}]}
|
|
||||||
{:key :status
|
|
||||||
:type :select
|
:type :select
|
||||||
:options [{:key :empty}
|
:options [{:key :empty}
|
||||||
{:key :positive}
|
{:key :positive}
|
||||||
@@ -19,7 +15,8 @@
|
|||||||
|
|
||||||
(defn view
|
(defn view
|
||||||
[]
|
[]
|
||||||
(let [state (reagent/atom {:token :snt
|
(let [state (reagent/atom {:token {:symbol "SNT"
|
||||||
|
:name "Status Network Token"}
|
||||||
:state :default
|
:state :default
|
||||||
:status :empty
|
:status :empty
|
||||||
:customization-color :blue
|
:customization-color :blue
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
(case selected-tab
|
(case selected-tab
|
||||||
:assets [rn/flat-list
|
:assets [rn/flat-list
|
||||||
{:render-fn token-value/view
|
{:render-fn token-value/view
|
||||||
|
:style {:flex 1}
|
||||||
:data tokens
|
:data tokens
|
||||||
:content-container-style {:padding-horizontal 8}}]
|
:content-container-style {:padding-horizontal 8}}]
|
||||||
:collectibles [collectibles/view]
|
:collectibles [collectibles/view]
|
||||||
|
|||||||
@@ -104,7 +104,8 @@
|
|||||||
{:keys [price change-pct-24hour]} market-values
|
{:keys [price change-pct-24hour]} market-values
|
||||||
fiat-change (utils/calculate-fiat-change crypto-value change-pct-24hour)]
|
fiat-change (utils/calculate-fiat-change crypto-value change-pct-24hour)]
|
||||||
(when crypto-value
|
(when crypto-value
|
||||||
{:token (keyword (string/lower-case (:symbol item)))
|
{:token {:symbol (:symbol item)
|
||||||
|
:name (:name item)}
|
||||||
:state :default
|
:state :default
|
||||||
:status (cond
|
:status (cond
|
||||||
(pos? change-pct-24hour) :positive
|
(pos? change-pct-24hour) :positive
|
||||||
|
|||||||
Reference in New Issue
Block a user