Skip to content

Commit

Permalink
review notes
Browse files Browse the repository at this point in the history
  • Loading branch information
vkjr committed Oct 6, 2023
1 parent 622b517 commit 94dca62
Show file tree
Hide file tree
Showing 10 changed files with 180 additions and 160 deletions.
1 change: 1 addition & 0 deletions src/quo2/components/wallet/wallet_overview/style.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
{:padding-horizontal 20
:padding-top 12
:padding-bottom 32
:flex-grow 1
:max-height 98})

(def container-info-top
Expand Down
3 changes: 1 addition & 2 deletions src/status_im2/common/scroll_page/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@
(let [scroll-height (reagent/atom negative-scroll-position-0)]
(fn [{:keys [theme cover-image logo on-scroll
collapsed? height top-nav title-colum background-color navigate-back? page-nav-props
overlay-shown?]}
sticky-header
overlay-shown? sticky-header]}
children]
[:<>
[:f> f-scroll-page-header
Expand Down
22 changes: 10 additions & 12 deletions src/status_im2/contexts/communities/discover/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -206,18 +206,16 @@
featured-communities-count (count featured-communities)]
(fn []
[scroll-page/scroll-page
{:theme theme
:on-scroll #(reset! scroll-height %)
:background-color (colors/theme-colors
colors/white
colors/neutral-95)
:navigate-back? :true
:height (if (> @scroll-height 360)
208
148)}
[render-sticky-header
{:selected-tab selected-tab
:scroll-height scroll-height}]
{:theme theme
:on-scroll #(reset! scroll-height %)
:navigate-back? :true
:height (if (> @scroll-height 360)
208
148)
:sticky-header [render-sticky-header
{:selected-tab selected-tab
:scroll-height scroll-height}]}

[render-communities
selected-tab
featured-communities-count
Expand Down
37 changes: 18 additions & 19 deletions src/status_im2/contexts/communities/overview/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -317,25 +317,24 @@
collapsed? (and initial-joined? (:joined community))
overlay-shown? (boolean (:sheets (rf/sub [:bottom-sheet])))]
[scroll-page/scroll-page
{:cover-image cover
:collapsed? collapsed?
:logo logo
:name name
:on-scroll #(reset! scroll-height %)
:navigate-back? true
:background-color (colors/theme-colors colors/white colors/neutral-95)
:height 148
:overlay-shown? overlay-shown?
:page-nav-props {:type :community
:right-side (page-nav-right-section-buttons id)
:community-name name
:community-logo logo}}
[sticky-category-header
{:enabled (> @scroll-height @first-channel-height)
:label (pick-first-category-by-height
@scroll-height
@first-channel-height
@categories-heights)}]
{:cover-image cover
:collapsed? collapsed?
:logo logo
:name name
:on-scroll #(reset! scroll-height %)
:navigate-back? true
:height 148
:overlay-shown? overlay-shown?
:page-nav-props {:type :community
:right-side (page-nav-right-section-buttons id)
:community-name name
:community-logo logo}
:sticky-header [sticky-category-header
{:enabled (> @scroll-height @first-channel-height)
:label (pick-first-category-by-height
@scroll-height
@first-channel-height
@categories-heights)}]}
[community-content
community
pending?
Expand Down
187 changes: 100 additions & 87 deletions src/status_im2/contexts/wallet/collectible/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,103 @@
[status-im2.contexts.wallet.collectible.style :as style]
[status-im2.contexts.wallet.common.temp :as temp]))

(defn header
[{:keys [name description collection-image]}]
[rn/view {:style style/header}
[quo/text
{:weight :semi-bold
:size :heading-1} name]
[rn/view style/collection-container
[quo/collection-avatar {:image collection-image}]
[quo/text
{:weight :semi-bold
:size :paragraph-1}
description]]])

(defn cta-buttons
[]
[rn/view {:style style/buttons-container}
[quo/button
{:container-style style/send-button
:type :outline
:size 40
:icon-left :i/send}
(i18n/label :t/send)]
[quo/button
{:container-style style/opensea-button
:type :outline
:size 40
:icon-left :i/opensea}
(i18n/label :t/opensea)]])

(defn tabs
[]
[quo/tabs
{:size 32
:style style/tabs
:scrollable? true
:data [{:id :overview
:label (i18n/label :t/overview)
:accessibility-label :overview-tab}
{:id :activity
:label (i18n/label :t/activity)
:accessibility-label :activity-tab}
{:id :permissions
:label (i18n/label :t/permissions)
:accessibility-label :permissions-tab}
{:id :about
:label (i18n/label :t/about)
:accessibility-label :about-tab}]}])

(defn traits-section
[traits]
[rn/view {:style style/traits-section}
[quo/section-label
{:section (i18n/label :t/traits)}]]

[rn/flat-list
{:render-fn (fn [{:keys [title subtitle]}]
[rn/view {:style style/traits-item}
[quo/data-item
{:description :default
:card? true
:status :default
:size :default
:title title
:subtitle subtitle}]])
:data traits
:key :collectibles-list
:key-fn :id
:num-columns 2
:content-container-style style/traits-container}])

(defn info
[]
[rn/view
{:style style/info-container}
[rn/view {:style style/account}
[quo/data-item
{:description :account
:card? true
:status :default
:size :default
:title (i18n/label :t/account-title)
:subtitle "Collectibles vault"
:emoji "🎮"
:customization-color :yellow}]]

[rn/view {:style style/network}
[quo/data-item
{:description :network
:card? true
:status :default
:size :default
:title (i18n/label :t/network)
:subtitle (i18n/label :t/mainnet)}]]])

(defn view
[]
(let [{:keys [name description image collection-image traits]} temp/collectible-details]
(let [{:keys [name description image traits] :as props} temp/collectible-details]
[scroll-page/scroll-page
{:navigate-back? true
:height 148
Expand All @@ -18,93 +112,12 @@
:right-side [{:icon-name :i/options
:on-press #(js/alert "pressed")}]
:picture image}}
nil
[rn/view {:style style/container}

[rn/image
{:source image
:style style/preview}]

[rn/view {:style style/header}
[quo/text
{:weight :semi-bold
:size :heading-1} name]
[rn/view style/collection-container
[quo/collection-avatar {:image collection-image}]
[quo/text
{:weight :semi-bold
:size :paragraph-1}
description]]]

[rn/view {:style style/buttons-container}
[quo/button
{:container-style style/send-button
:type :outline
:size 40
:icon-left :i/send}
(i18n/label :t/send)]
[quo/button
{:container-style style/opensea-button
:type :outline
:size 40
:icon-left :i/opensea}
(i18n/label :t/opensea)]]

[quo/tabs
{:size 32
:style style/tabs
:scrollable? true
:data [{:id :overview
:label (i18n/label :t/overview)
:accessibility-label :overview-tab}
{:id :activity
:label (i18n/label :t/activity)
:accessibility-label :activity-tab}
{:id :permissions
:label (i18n/label :t/permissions)
:accessibility-label :permissions-tab}
{:id :about
:label (i18n/label :t/about)
:accessibility-label :about-tab}]}]

[rn/view
{:style style/info-container}
[rn/view {:style style/account}
[quo/data-item
{:description :account
:card? true
:status :default
:size :default
:title (i18n/label :t/account-title)
:subtitle "Collectibles vault"
:emoji "🎮"
:customization-color :yellow}]]

[rn/view {:style style/network}
[quo/data-item
{:description :network
:card? true
:status :default
:size :default
:title (i18n/label :t/network)
:subtitle "Mainnet"}]]]

[rn/view {:style style/traits-section}
[quo/section-label
{:section (i18n/label :t/traits)}]]

[rn/flat-list
{:render-fn (fn [{:keys [title subtitle]}]
[rn/view {:style style/traits-item}
[quo/data-item
{:description :default
:card? true
:status :default
:size :default
:title title
:subtitle subtitle}]])
:data traits
:key :collectibles-list
:key-fn :id
:num-columns 2
:content-container-style style/traits-container}]]]))
[header props]
[cta-buttons]
[tabs]
[info]
[traits-section traits]]]))
49 changes: 24 additions & 25 deletions src/status_im2/contexts/wallet/common/temp.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@
[quo/button {:on-press #(rf/dispatch [:navigate-to :wallet-create-account])}
"Create Account"]
[quo/button {:on-press #(rf/dispatch [:navigate-to :wallet-saved-addresses])}
"Saved Addresses"]
[quo/button {:on-press #(rf/dispatch [:navigate-to :wallet-collectibles])}
"Collectibles"]])
"Saved Addresses"]])

(def wallet-overview-state
{:state :default
Expand Down Expand Up @@ -84,28 +82,29 @@
:id 6}])

(def collectible-details
{:name "#5946"
:description "Bored Ape Yacht Club"
:image (status.resources/get-mock-image :collectible-monkey)
:collection-image (status.resources/get-mock-image :bored-ape)
:traits [{:title "Background"
:subtitle "Blue"
:id 1}
{:title "Clothes"
:subtitle "Bayc T Black"
:id 2}
{:title "Eyes"
:subtitle "Sleepy"
:id 3}
{:title "Fur"
:subtitle "Black"
:id 4}
{:title "Hat"
:subtitle "Beanie"
:id 5}
{:title "Mouth"
:subtitle "Bored Pipe"
:id 6}]})
nil
#_{:name "#5946"
:description "Bored Ape Yacht Club"
:image (status.resources/get-mock-image :collectible-monkey)
:collection-image (status.resources/get-mock-image :bored-ape)
:traits [{:title "Background"
:subtitle "Blue"
:id 1}
{:title "Clothes"
:subtitle "Bayc T Black"
:id 2}
{:title "Eyes"
:subtitle "Sleepy"
:id 3}
{:title "Fur"
:subtitle "Black"
:id 4}
{:title "Hat"
:subtitle "Beanie"
:id 5}
{:title "Mouth"
:subtitle "Bored Pipe"
:id 6}]})

(def account-overview-state
{:current-value "€0.00"
Expand Down
3 changes: 3 additions & 0 deletions src/status_im2/contexts/wallet/home/style.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
(def accounts-container
{:height 112})

(def overview-container
{:height 86})

(def accounts-list
{:padding-horizontal 20
:padding-top 32
Expand Down
Loading

0 comments on commit 94dca62

Please sign in to comment.