Skip to content

Commit

Permalink
Cleaned up as per the PR Review
Browse files Browse the repository at this point in the history
Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
  • Loading branch information
smohamedjavid committed Aug 24, 2023
1 parent 48fa02a commit 78892aa
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 25 deletions.
Binary file removed resources/images/mock2/coin-gecko@2x.png
Binary file not shown.
Binary file removed resources/images/mock2/coin-gecko@3x.png
Binary file not shown.
6 changes: 3 additions & 3 deletions src/quo2/components/list_items/preview_list/properties.cljs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
(ns quo2.components.list-items.preview-list.properties)

(def ^:private types-for-squared-border #{:accounts :collectibles})

(defn border-type
[type]
(case type
(:accounts :collectibles) :squared
:rounded))
(if (types-for-squared-border type) :squared :rounded))

(def sizes
{:size/s-32 {:size 32
Expand Down
18 changes: 9 additions & 9 deletions src/quo2/components/list_items/preview_list/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
colors/neutral-20
colors/neutral-90
theme)}}
(if (some more-icon-for-sizes [size])
(if (more-icon-for-sizes size)
[quo2.icons/icon :i/more
{:size 12
:color (get-overflow-color
Expand Down Expand Up @@ -93,12 +93,13 @@

(defn- list-item
[{:keys [index type size-key item number]}]
(let [last-item? (= index (- number 1))
margin-left (get-in properties/sizes [size-key :margin-left])
hole-size (get-in properties/sizes [size-key :hole-size])
hole-radius (get-in properties/sizes [size-key :hole-radius (properties/border-type type)])
hole-x (get-in properties/sizes [size-key :hole-x])
hole-y (get-in properties/sizes [size-key :hole-y])]
(let [last-item? (= index (dec number))
border-type (properties/border-type type)
{margin-left :margin-left
hole-size :hole-size
hole-x :hole-x
hole-y :hole-y
{hole-radius border-type} :hole-radius} (properties/sizes size-key)]
[hole-view/hole-view
{:style {:margin-left (if (= index 0) 0 margin-left)}
:holes (if last-item?
Expand All @@ -124,7 +125,6 @@
"
[{:keys [type size number blur? theme more-than-99-label]} items]
(let [size-key (if (contains? properties/sizes size) size :size/s-24)
items-arr (into [] items)
number (or number (count items))
margin-left (get-in properties/sizes [size-key :margin-left])
border-radius (get-in properties/sizes [size-key :border-radius (properties/border-type type)])]
Expand All @@ -135,7 +135,7 @@
{:index index
:type type
:size-key size-key
:item (get items-arr index)
:item (get (vec items) index)
:number number}])
(when (> number 4)
[overflow-label
Expand Down
1 change: 0 additions & 1 deletion src/status_im2/common/resources.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
(def mock-images
{:diamond (js/require "../resources/images/mock2/diamond.png")
:coinbase (js/require "../resources/images/mock2/coinbase.png")
:coin-gecko (js/require "../resources/images/mock2/coin-gecko.png")
:collectible (js/require "../resources/images/mock2/collectible.png")
:contact (js/require "../resources/images/mock2/contact.png")
:community-banner (js/require "../resources/images/mock2/community-banner.png")
Expand Down
4 changes: 2 additions & 2 deletions src/status_im2/contexts/quo_preview/list_items/dapp.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
(:require [quo2.core :as quo]
[react-native.core :as rn]
[reagent.core :as reagent]
[status-im2.common.resources :as resources]
[quo2.foundations.resources :as resources]
[status-im2.contexts.quo-preview.preview :as preview]))

(def descriptor
Expand All @@ -23,7 +23,7 @@

(defn preview
[]
(let [state (reagent/atom {:dapp {:avatar (resources/get-mock-image :coin-gecko)
(let [state (reagent/atom {:dapp {:avatar (resources/get-dapp :coingecko)
:name "Coingecko"
:value "coingecko.com"}
:state :default
Expand Down
16 changes: 6 additions & 10 deletions src/status_im2/contexts/quo_preview/list_items/preview_lists.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
[status-im2.contexts.quo-preview.preview :as preview]))

(def descriptor
[{:label "Type:"
:key :type
[{:key :type
:type :select
:options [{:key :user
:value "User"}
Expand All @@ -23,8 +22,7 @@
:value "Accounts"}
{:key :network
:value "Network"}]}
{:label "Size:"
:key :size
{:key :size
:type :select
:options [{:key :size/s-32
:value "32"}
Expand All @@ -36,12 +34,10 @@
:value "16"}
{:key :size/s-14
:value "14"}]}
{:label "Number"
:key :number
:type :text}
{:label "blur"
:key :blur?
:type :boolean}])
{:key :number
:type :text}
{:key :blur?
:type :boolean}])

(def user-list
[{:full-name "A Y"
Expand Down

0 comments on commit 78892aa

Please sign in to comment.