Skip to content

Commit

Permalink
Address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
ajayesivan committed May 24, 2024
1 parent 6ce9d4d commit d5bb9d9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 25 deletions.
12 changes: 0 additions & 12 deletions src/quo/components/avatars/dapp_avatar/schema.cljs

This file was deleted.

37 changes: 24 additions & 13 deletions src/quo/components/avatars/dapp_avatar/view.cljs
Original file line number Diff line number Diff line change
@@ -1,25 +1,36 @@
(ns quo.components.avatars.dapp-avatar.view
(:require [quo.components.avatars.dapp-avatar.schema :as dapp-avatar.schema]
[quo.components.avatars.dapp-avatar.style :as style]
(:require [quo.components.avatars.dapp-avatar.style :as style]
[react-native.core :as rn]
[react-native.hole-view :as hole-view]
[react-native.platform :as platform]
[schema.core :as schema]))

(defn view-internal
(def ?schema
[:=>
[:catn
[:props
[:map {:closed true}
[:context? {:optional true} [:maybe :boolean]]
[:image :schema.common/image-source]
[:network-image {:optional true} [:maybe :schema.common/image-source]]
[:container-style {:optional true} [:maybe :map]]]]]
:any])

(defn- view-internal
[{:keys [context? image network-image container-style]}]
[rn/view
{:style (merge style/container container-style)
:accessibility-label :dapp-avatar}
[hole-view/hole-view
{:key (hash context?)
:holes (if context?
[{:x 19
:y 19
:width 18
:height 18
:borderRadius 9}]
[])
:style style/hole-view}
(cond-> {:holes (if context?
[{:x 19
:y 19
:width 18
:height 18
:borderRadius 9}]
[])
:style style/hole-view}
platform/android? (assoc :key context?))
[rn/image
{:source image
:style style/image}]]
Expand All @@ -28,4 +39,4 @@
{:source network-image
:style style/context}])])

(def view (schema/instrument #'view-internal dapp-avatar.schema/?schema))
(def view (schema/instrument #'view-internal ?schema))

0 comments on commit d5bb9d9

Please sign in to comment.