chore(quo): update styles for account card variant missing keypair (#20279)
This commit is contained in:
parent
ec00ddf10e
commit
e1317f503f
|
@ -11,4 +11,4 @@
|
||||||
|
|
||||||
(defn alert-icon-color
|
(defn alert-icon-color
|
||||||
[theme]
|
[theme]
|
||||||
(colors/theme-colors colors/neutral-50 colors/white theme))
|
(colors/theme-colors colors/neutral-80-opa-60 colors/white-70-blur theme))
|
||||||
|
|
|
@ -12,29 +12,38 @@
|
||||||
|
|
||||||
(defn card
|
(defn card
|
||||||
[{:keys [customization-color type theme pressed? metrics?]}]
|
[{:keys [customization-color type theme pressed? metrics?]}]
|
||||||
|
(let [missing-keypair? (= :missing-keypair type)
|
||||||
|
watch-only? (= :watch-only type)]
|
||||||
{:width 161
|
{:width 161
|
||||||
:height (if metrics? 88 68)
|
:height (if metrics? 88 68)
|
||||||
:background-color (when (not= :watch-only type)
|
:background-color (when (and (not missing-keypair?) (not watch-only?))
|
||||||
(colors/theme-colors
|
(colors/theme-colors
|
||||||
(colors/resolve-color customization-color
|
(colors/resolve-color customization-color
|
||||||
theme
|
theme
|
||||||
(when (= :missing-keypair type) (if pressed? 20 10)))
|
(when missing-keypair? (if pressed? 20 10)))
|
||||||
(colors/resolve-color customization-color
|
(colors/resolve-color customization-color
|
||||||
theme
|
theme
|
||||||
(when (= :missing-keypair type) (if pressed? 30 20)))
|
(when missing-keypair? (if pressed? 30 20)))
|
||||||
theme))
|
theme))
|
||||||
:border-radius 16
|
:border-radius 16
|
||||||
|
:border-style (if missing-keypair? :dashed :solid)
|
||||||
:border-width 1
|
:border-width 1
|
||||||
:border-color (if (or (= :missing-keypair type)
|
:border-color (cond
|
||||||
(= :watch-only type))
|
watch-only?
|
||||||
(colors/theme-colors
|
(colors/theme-colors
|
||||||
(if pressed? colors/neutral-80-opa-10 colors/neutral-80-opa-5)
|
(if pressed? colors/neutral-80-opa-10 colors/neutral-80-opa-5)
|
||||||
(if pressed? colors/white-opa-10 colors/white-opa-5)
|
(if pressed? colors/white-opa-10 colors/white-opa-5)
|
||||||
theme)
|
theme)
|
||||||
|
missing-keypair?
|
||||||
|
(colors/theme-colors
|
||||||
|
(if pressed? colors/neutral-40 colors/neutral-30)
|
||||||
|
(if pressed? colors/neutral-70 colors/neutral-80)
|
||||||
|
theme)
|
||||||
|
:else
|
||||||
colors/neutral-80-opa-10)
|
colors/neutral-80-opa-10)
|
||||||
:padding-horizontal 12
|
:padding-horizontal 12
|
||||||
:padding-top 6
|
:padding-top 6
|
||||||
:padding-bottom 9})
|
:padding-bottom 9}))
|
||||||
|
|
||||||
(def profile-container
|
(def profile-container
|
||||||
{:margin-bottom 8
|
{:margin-bottom 8
|
||||||
|
@ -100,10 +109,12 @@
|
||||||
:line-height 20})
|
:line-height 20})
|
||||||
|
|
||||||
(defn loader-view
|
(defn loader-view
|
||||||
[{:keys [width height watch-only? theme]}]
|
[{:keys [width height watch-only? theme missing-keypair?]}]
|
||||||
{:width width
|
{:width width
|
||||||
:height height
|
:height height
|
||||||
:background-color (if (and watch-only? (= :light theme)) colors/neutral-80-opa-5 colors/white-opa-10)
|
:background-color (if (and (or missing-keypair? watch-only?) (= :light theme))
|
||||||
|
colors/neutral-80-opa-5
|
||||||
|
colors/white-opa-10)
|
||||||
:border-radius 6})
|
:border-radius 6})
|
||||||
|
|
||||||
(def loader-container
|
(def loader-container
|
||||||
|
|
|
@ -15,7 +15,8 @@
|
||||||
|
|
||||||
(defn- loading-view
|
(defn- loading-view
|
||||||
[{:keys [customization-color type theme metrics?]}]
|
[{:keys [customization-color type theme metrics?]}]
|
||||||
(let [watch-only? (= :watch-only type)
|
(let [missing-keypair? (= :missing-keypair type)
|
||||||
|
watch-only? (= :watch-only type)
|
||||||
empty-type? (= :empty type)]
|
empty-type? (= :empty type)]
|
||||||
[rn/view
|
[rn/view
|
||||||
{:accessibility-label :loading
|
{:accessibility-label :loading
|
||||||
|
@ -28,6 +29,7 @@
|
||||||
[rn/view
|
[rn/view
|
||||||
{:style (assoc (style/loader-view {:width 16
|
{:style (assoc (style/loader-view {:width 16
|
||||||
:height 16
|
:height 16
|
||||||
|
:missing-keypair? missing-keypair?
|
||||||
:watch-only? watch-only?
|
:watch-only? watch-only?
|
||||||
:theme theme})
|
:theme theme})
|
||||||
:margin-right 8
|
:margin-right 8
|
||||||
|
@ -36,12 +38,14 @@
|
||||||
[rn/view
|
[rn/view
|
||||||
{:style (style/loader-view {:width 57
|
{:style (style/loader-view {:width 57
|
||||||
:height 8
|
:height 8
|
||||||
|
:missing-keypair? missing-keypair?
|
||||||
:watch-only? watch-only?
|
:watch-only? watch-only?
|
||||||
:theme theme})}]
|
:theme theme})}]
|
||||||
(when watch-only? [icon/icon :i/reveal {:color colors/neutral-50 :size 12}])]]
|
(when watch-only? [icon/icon :i/reveal {:color colors/neutral-50 :size 12}])]]
|
||||||
[rn/view
|
[rn/view
|
||||||
{:style (assoc (style/loader-view {:width (if empty-type? 56 80)
|
{:style (assoc (style/loader-view {:width (if empty-type? 56 80)
|
||||||
:height 16
|
:height 16
|
||||||
|
:missing-keypair? missing-keypair?
|
||||||
:watch-only? watch-only?
|
:watch-only? watch-only?
|
||||||
:theme theme})
|
:theme theme})
|
||||||
:margin-top
|
:margin-top
|
||||||
|
@ -51,6 +55,7 @@
|
||||||
{:accessibility-label :metrics
|
{:accessibility-label :metrics
|
||||||
:style (assoc (style/loader-view {:width (if empty-type? 37 96)
|
:style (assoc (style/loader-view {:width (if empty-type? 37 96)
|
||||||
:height 8
|
:height 8
|
||||||
|
:missing-keypair? missing-keypair?
|
||||||
:watch-only? watch-only?
|
:watch-only? watch-only?
|
||||||
:theme theme})
|
:theme theme})
|
||||||
:margin-top
|
:margin-top
|
||||||
|
@ -154,7 +159,7 @@
|
||||||
[gradient-overview theme customization-color])])))
|
[gradient-overview theme customization-color])])))
|
||||||
|
|
||||||
(defn- add-account-view
|
(defn- add-account-view
|
||||||
[{:keys [on-press customization-color metrics?]}]
|
[{:keys [on-press metrics?]}]
|
||||||
(let [theme (quo.theme/use-theme)
|
(let [theme (quo.theme/use-theme)
|
||||||
[pressed? set-pressed] (rn/use-state false)
|
[pressed? set-pressed] (rn/use-state false)
|
||||||
on-press-in (rn/use-callback #(set-pressed true))
|
on-press-in (rn/use-callback #(set-pressed true))
|
||||||
|
@ -168,13 +173,12 @@
|
||||||
:pressed? pressed?})}
|
:pressed? pressed?})}
|
||||||
[button/button
|
[button/button
|
||||||
{:on-press on-press
|
{:on-press on-press
|
||||||
:type :primary
|
:type :ghost
|
||||||
:size 24
|
:size 32
|
||||||
:icon true
|
:icon true
|
||||||
:accessibility-label :add-account
|
:accessibility-label :add-account
|
||||||
:pressed? pressed?
|
:pressed? pressed?
|
||||||
:icon-only? true
|
:icon-only? true}
|
||||||
:customization-color customization-color}
|
|
||||||
:i/add]]))
|
:i/add]]))
|
||||||
|
|
||||||
(defn- view-internal
|
(defn- view-internal
|
||||||
|
|
Loading…
Reference in New Issue