Skip to content

Commit db83f4b

Browse files
authored
Merge branch 'develop' into bugfix/17956
2 parents f535d97 + dbc8df2 commit db83f4b

File tree

19 files changed

+266
-107
lines changed

19 files changed

+266
-107
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
(ns quo.components.text-combinations.channel-name.component-spec
2+
(:require [quo.components.text-combinations.channel-name.view :as channel-name]
3+
[test-helpers.component :as h]))
4+
5+
(h/describe "Channel name"
6+
(h/test "Renders Default"
7+
(h/render [channel-name/view {:channel-name "Test channel"}])
8+
(h/is-truthy (h/get-by-text "# Test channel")))
9+
10+
(h/test "Renders unlocked icon"
11+
(h/render [channel-name/view
12+
{:channel-name "Test channel"
13+
:unlocked? true}])
14+
(h/is-truthy (h/get-by-label-text :channel-name-unlocked-icon)))
15+
16+
(h/test "Renders muted icon"
17+
(h/render [channel-name/view
18+
{:channel-name "Test channel"
19+
:muted? true}])
20+
(h/is-truthy (h/get-by-label-text :channel-name-muted-icon)))
21+
22+
(h/test "Renders muted and unlocked icon"
23+
(h/render [channel-name/view
24+
{:channel-name "Test channel"
25+
:muted? true
26+
:unlocked? true}])
27+
(h/is-truthy (h/get-by-label-text :channel-name-unlocked-icon))
28+
(h/is-truthy (h/get-by-label-text :channel-name-muted-icon))))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
(ns quo.components.text-combinations.channel-name.style
2+
(:require [quo.foundations.colors :as colors]))
3+
4+
(def container {:flex-direction :row})
5+
6+
(def icons-container
7+
{:flex-direction :row
8+
:padding-top 8
9+
:padding-bottom 4
10+
:margin-left 6})
11+
12+
(def icon {:width 20 :height 20})
13+
14+
(def icons-gap {:width 4})
15+
16+
(defn- blur-icon-color
17+
[theme]
18+
(colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-40 theme))
19+
20+
(defn unlocked-icon-color
21+
[theme blur?]
22+
(if blur?
23+
(blur-icon-color theme)
24+
(colors/theme-colors colors/neutral-50 colors/neutral-40 theme)))
25+
26+
(defn muted-icon-color
27+
[theme blur?]
28+
(if blur?
29+
(blur-icon-color theme)
30+
(colors/theme-colors colors/neutral-40 colors/neutral-60 theme)))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
(ns quo.components.text-combinations.channel-name.view
2+
(:require [quo.components.icon :as icon]
3+
[quo.components.markdown.text :as text]
4+
[quo.components.text-combinations.channel-name.style :as style]
5+
[quo.theme]
6+
[react-native.core :as rn]))
7+
8+
(defn icons
9+
[{:keys [theme unlocked? muted? blur?]}]
10+
[rn/view {:style style/icons-container}
11+
(when unlocked?
12+
[rn/view
13+
{:style style/icon
14+
:accessibility-label :channel-name-unlocked-icon}
15+
[icon/icon :i/unlocked
16+
{:color (style/unlocked-icon-color theme blur?)
17+
:size 20}]])
18+
19+
(when (and unlocked? muted?)
20+
[rn/view {:style style/icons-gap}])
21+
22+
(when muted?
23+
[rn/view
24+
{:style style/icon
25+
:accessibility-label :channel-name-muted-icon}
26+
[icon/icon :i/muted
27+
{:color (style/muted-icon-color theme blur?)
28+
:size 20}]])])
29+
30+
(defn- view-internal
31+
[{:keys [unlocked? muted? channel-name] :as props}]
32+
[rn/view {:style style/container}
33+
[text/text
34+
{:size :heading-1
35+
:weight :semi-bold}
36+
(str "# " channel-name)]
37+
(when (or unlocked? muted?)
38+
[icons props])])
39+
40+
(def view (quo.theme/with-theme view-internal))

src/quo/components/wallet/keypair/style.cljs

+6
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,9 @@
2828
{:flex-direction :row
2929
:align-items :center
3030
:justify-content :space-between})
31+
32+
(defn subtitle
33+
[blur? theme]
34+
{:color (if blur?
35+
colors/white-opa-40
36+
(colors/theme-colors colors/neutral-50 colors/neutral-40 theme))})

src/quo/components/wallet/keypair/view.cljs

+15-13
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
[quo.foundations.colors :as colors]
1212
[quo.theme :as quo.theme]
1313
[react-native.core :as rn]
14+
[react-native.platform :as platform]
1415
[reagent.core :as reagent]
1516
[utils.i18n :as i18n]))
1617

@@ -19,11 +20,6 @@
1920
(let [first-name (first (string/split full-name #" "))]
2021
(i18n/label :t/keypair-title {:name first-name})))
2122

22-
(defn details-string
23-
[address stored]
24-
(str (when address (str address ""))
25-
(if (= stored :on-device) (i18n/label :t/on-device) (i18n/label :t/on-keycard))))
26-
2723
(defn avatar
2824
[{{:keys [full-name]} :details
2925
avatar-type :type
@@ -67,15 +63,21 @@
6763
[{:keys [details stored blur? theme]}]
6864
(let [{:keys [address]} details]
6965
[rn/view
70-
{:style {:flex-direction :row
71-
:align-items :center}}
66+
{:style {:flex-direction :row
67+
:align-items :center}
68+
:accessibility-label :details}
69+
[text/text
70+
{:size :paragraph-2
71+
:style (style/subtitle blur? theme)}
72+
address]
73+
[text/text
74+
{:size :paragraph-2
75+
:style (merge (style/subtitle blur? theme) {:bottom (if platform/ios? 2 -2)})}
76+
""]
7277
[text/text
73-
{:size :paragraph-2
74-
:accessibility-label :details
75-
:style {:color (if blur?
76-
colors/white-opa-40
77-
(colors/theme-colors colors/neutral-50 colors/neutral-40 theme))}}
78-
(details-string address stored)]
78+
{:size :paragraph-2
79+
:style (style/subtitle blur? theme)}
80+
(if (= stored :on-device) (i18n/label :t/on-device) (i18n/label :t/on-keycard))]
7981
(when (= stored :on-keycard)
8082
[rn/view {:style {:margin-left 4}}
8183
[icon/icon :i/keycard-card

src/quo/core.cljs

+2
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@
136136
quo.components.tags.tags
137137
quo.components.tags.tiny-tag.view
138138
quo.components.tags.token-tag.view
139+
quo.components.text-combinations.channel-name.view
139140
quo.components.text-combinations.view
140141
quo.components.wallet.account-card.view
141142
quo.components.wallet.account-origin.view
@@ -369,6 +370,7 @@
369370

370371
;;;; Text combinations
371372
(def text-combinations quo.components.text-combinations.view/view)
373+
(def channel-name quo.components.text-combinations.channel-name.view/view)
372374

373375
;;;; Wallet
374376
(def account-card quo.components.wallet.account-card.view/view)

src/quo/core_spec.cljs

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
[quo.components.tags.status-tags-component-spec]
7676
[quo.components.tags.summary-tag.component-spec]
7777
[quo.components.tags.tiny-tag.component-spec]
78+
[quo.components.text-combinations.channel-name.component-spec]
7879
[quo.components.wallet.account-card.component-spec]
7980
[quo.components.wallet.account-origin.component-spec]
8081
[quo.components.wallet.account-overview.component-spec]

src/status_im/ethereum/subscriptions.cljs

+3
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,7 @@
8282
"wallet-owned-collectibles-filtering-done" {:fx [[:dispatch
8383
[:wallet/owned-collectibles-filtering-done
8484
event]]]}
85+
"wallet-get-collectibles-details-done" {:fx [[:dispatch
86+
[:wallet/get-collectible-details-done
87+
event]]]}
8588
(log/warn ::unknown-wallet-event :type type :event event)))

src/status_im2/contexts/profile/config.cljs

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88

99
(defn login
1010
[]
11-
{;; Temporary fix until https://github.com/status-im/status-go/issues/3024 is
12-
;; resolved
11+
{;; Temporary fix until https://github.com/status-im/status-go/issues/3024 is resolved
1312
:wakuV2Nameserver "8.8.8.8"
1413
:openseaAPIKey config/opensea-api-key
1514
:poktToken config/POKT_TOKEN

src/status_im2/contexts/quo_preview/main.cljs

+5-1
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@
158158
[status-im2.contexts.quo-preview.tags.tags :as tags]
159159
[status-im2.contexts.quo-preview.tags.tiny-tag :as tiny-tag]
160160
[status-im2.contexts.quo-preview.tags.token-tag :as token-tag]
161+
[status-im2.contexts.quo-preview.text-combinations.channel-name :as
162+
channel-name]
161163
[status-im2.contexts.quo-preview.text-combinations.preview :as
162164
text-combinations]
163165
[status-im2.contexts.quo-preview.wallet.account-card :as account-card]
@@ -445,7 +447,9 @@
445447
{:name :token-tag
446448
:component token-tag/view}]
447449
:text-combinations [{:name :text-combinations
448-
:component text-combinations/view}]
450+
:component text-combinations/view}
451+
{:name :channel-name
452+
:component channel-name/view}]
449453
:wallet [{:name :account-card :component account-card/view}
450454
{:name :account-origin :component account-origin/view}
451455
{:name :account-overview
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
(ns status-im2.contexts.quo-preview.text-combinations.channel-name
2+
(:require [quo.core :as quo]
3+
[reagent.core :as reagent]
4+
[status-im2.contexts.quo-preview.preview :as preview]))
5+
6+
7+
(def descriptor
8+
[{:key :channel-name
9+
:type :text}
10+
{:key :unlocked?
11+
:type :boolean}
12+
{:key :muted?
13+
:type :boolean}
14+
{:key :blur?
15+
:type :boolean}])
16+
17+
(defn view
18+
[]
19+
(let [state (reagent/atom {:channel-name "random"
20+
:unlocked? true
21+
:muted? true
22+
:blur? false})]
23+
(fn []
24+
[preview/preview-container
25+
{:state state
26+
:descriptor descriptor
27+
:show-blur-background? true
28+
:blur? (:blur? @state)}
29+
[quo/channel-name @state]])))

src/status_im2/contexts/wallet/collectible/style.cljs

+14-6
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@
44
{:margin-top 100
55
:margin-bottom 34})
66

7-
(def preview
7+
(def preview-container
88
{:margin-horizontal 8
99
:margin-top 12})
1010

11+
(def preview
12+
{:width "100%"
13+
:aspect-ratio 1
14+
:border-radius 16})
15+
1116
(def header
1217
{:margin-horizontal 20
1318
:margin-top 16
@@ -17,6 +22,9 @@
1722
{:flex-direction :row
1823
:margin-top 6})
1924

25+
(def collection-avatar-container
26+
{:margin-right 8})
27+
2028
(def buttons-container
2129
{:flex-direction :row
2230
:align-items :stretch
@@ -50,13 +58,13 @@
5058
{:margin-left 6
5159
:flex 1})
5260

53-
(def traits-section
54-
{:margin-horizontal 20
55-
:margin-top 8})
61+
(def traits-title-container
62+
{:margin-left 20
63+
:margin-top 8})
5664

5765
(def traits-item
58-
{:margin-horizontal 6
59-
:flex 1})
66+
{:margin 6
67+
:flex 1})
6068

6169
(def traits-container
6270
{:margin-horizontal 14

src/status_im2/contexts/wallet/collectible/view.cljs

+34-30
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@
44
[react-native.core :as rn]
55
[status-im2.common.scroll-page.view :as scroll-page]
66
[status-im2.contexts.wallet.collectible.style :as style]
7-
[status-im2.contexts.wallet.common.temp :as temp]
8-
[utils.i18n :as i18n]))
7+
[utils.i18n :as i18n]
8+
[utils.re-frame :as rf]))
99

1010
(defn header
11-
[{:keys [name description collection-image]}]
11+
[{:keys [name description collection-image-url]}]
1212
[rn/view {:style style/header}
1313
[quo/text
1414
{:weight :semi-bold
1515
:size :heading-1} name]
16-
[rn/view style/collection-container
17-
[quo/collection-avatar {:image collection-image}]
16+
[rn/view {:style style/collection-container}
17+
[rn/view {:style style/collection-avatar-container}
18+
[quo/collection-avatar {:image collection-image-url}]]
1819
[quo/text
1920
{:weight :semi-bold
2021
:size :paragraph-1}
@@ -57,25 +58,26 @@
5758

5859
(defn traits-section
5960
[traits]
60-
[rn/view {:style style/traits-section}
61-
[quo/section-label
62-
{:section (i18n/label :t/traits)}]]
63-
64-
[rn/flat-list
65-
{:render-fn (fn [{:keys [title subtitle]}]
66-
[rn/view {:style style/traits-item}
67-
[quo/data-item
68-
{:description :default
69-
:card? true
70-
:status :default
71-
:size :default
72-
:title title
73-
:subtitle subtitle}]])
74-
:data traits
75-
:key :collectibles-list
76-
:key-fn :id
77-
:num-columns 2
78-
:content-container-style style/traits-container}])
61+
(when (pos? (count traits))
62+
[rn/view
63+
[quo/section-label
64+
{:section (i18n/label :t/traits)
65+
:container-style style/traits-title-container}]
66+
[rn/flat-list
67+
{:render-fn (fn [{:keys [trait-type value]}]
68+
[quo/data-item
69+
{:description :default
70+
:card? true
71+
:status :default
72+
:size :default
73+
:title trait-type
74+
:subtitle value
75+
:container-style style/traits-item}])
76+
:data traits
77+
:key :collectibles-list
78+
:key-fn :id
79+
:num-columns 2
80+
:content-container-style style/traits-container}]]))
7981

8082
(defn info
8183
[]
@@ -103,7 +105,8 @@
103105

104106
(defn view
105107
[]
106-
(let [{:keys [name description image traits] :as props} temp/collectible-details]
108+
(let [collectible-details (rf/sub [:wallet/last-collectible-details])
109+
{:keys [name description preview-url traits]} collectible-details]
107110
[scroll-page/scroll-page
108111
{:navigate-back? true
109112
:height 148
@@ -112,12 +115,13 @@
112115
:description description
113116
:right-side [{:icon-name :i/options
114117
:on-press #(js/alert "pressed")}]
115-
:picture image}}
118+
:picture preview-url}}
116119
[rn/view {:style style/container}
117-
[rn/image
118-
{:source image
119-
:style style/preview}]
120-
[header props]
120+
[rn/view {:style style/preview-container}
121+
[rn/image
122+
{:source preview-url
123+
:style style/preview}]]
124+
[header collectible-details]
121125
[cta-buttons]
122126
[tabs]
123127
[info]

0 commit comments

Comments
 (0)