Skip to content

Commit

Permalink
tidy: clean up de-structuring and passing of props
Browse files Browse the repository at this point in the history
  • Loading branch information
seanstrom committed May 8, 2024
1 parent a6ca4c1 commit 19b0d9b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@

(defn view
[props]
[quo/drawer-top
(merge props {:blur? true})])
[quo/drawer-top props])
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,29 @@
:theme theme}]))

(defn- keypair
[item index _
[{:keys [accounts name]}
index _
{:keys [profile-picture compressed-key customization-color]}]
(let [theme (quo.theme/use-theme)
accounts (parse-accounts (:accounts item))
accounts (parse-accounts accounts)
default-keypair? (zero? index)
details {:full-name (:name item)
:address (when default-keypair?
(utils/get-shortened-compressed-key compressed-key))}
shortened-key (when default-keypair?
(utils/get-shortened-compressed-key compressed-key))
on-press (rn/use-callback
(fn []
(on-options-press
(merge {:theme theme
:title (:full-name details)}
:blur? true
:title name}
(if default-keypair?
{:type :default-keypair
:description (:address details)
:description shortened-key
:customization-color customization-color
:profile-picture profile-picture}
{:type :keypair
:icon-avatar :i/seed}))))
[customization-color default-keypair? details profile-picture theme])]
[customization-color default-keypair? name
profile-picture shortened-key theme])]
[quo/keypair
{:blur? false
:status-indicator false
Expand All @@ -71,7 +73,8 @@
:profile-picture (when default-keypair? profile-picture)
:type (if default-keypair? :default-keypair :other)
:on-options-press on-press
:details details}]))
:details {:full-name name
:address shortened-key}}]))

(defn view
[]
Expand Down

0 comments on commit 19b0d9b

Please sign in to comment.