mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-12 17:54:32 +00:00
fix(wallet)_: wallet card flexible width (#21746)
This commit - adds container-style prop to the wallet card component - makes the Buy and Receive CTAs (cards) width flexible as we display two cards, and it needs to fill the screen width. NOTE: The component's fixed width is 161, but in certain phones, it's small and does not fill the screen's whole width. Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
This commit is contained in:
parent
32ccca0912
commit
8a88aac34d
@ -10,5 +10,6 @@
|
||||
[:subtitle :string]
|
||||
[:dismissible? {:optional true} :boolean]
|
||||
[:on-press {:optional true} fn?]
|
||||
[:on-press-close {:optional true} fn?]]]]
|
||||
[:on-press-close {:optional true} fn?]
|
||||
[:container-style {:optional true} :map]]]]
|
||||
:any])
|
||||
|
@ -3,13 +3,14 @@
|
||||
[quo.foundations.shadows :as shadows]))
|
||||
|
||||
(defn root-container
|
||||
[theme]
|
||||
(assoc (shadows/get 2 theme)
|
||||
:border-radius 16
|
||||
:padding-vertical 10
|
||||
:padding-horizontal 12
|
||||
:width 161
|
||||
:background-color (colors/theme-colors colors/white colors/neutral-90 theme)))
|
||||
[theme container-style]
|
||||
(merge (shadows/get 2 theme)
|
||||
{:border-radius 16
|
||||
:padding-vertical 10
|
||||
:padding-horizontal 12
|
||||
:width 161
|
||||
:background-color (colors/theme-colors colors/white colors/neutral-90 theme)}
|
||||
container-style))
|
||||
|
||||
(def top-container
|
||||
{:flex-direction :row
|
||||
|
@ -9,12 +9,12 @@
|
||||
[schema.core :as schema]))
|
||||
|
||||
(defn- view-internal
|
||||
[{:keys [image title subtitle dismissible? on-press on-press-close]}]
|
||||
[{:keys [image title subtitle dismissible? on-press on-press-close container-style]}]
|
||||
(let [theme (quo.theme/use-theme)]
|
||||
[rn/pressable
|
||||
{:on-press on-press
|
||||
:accessibility-label :wallet-card}
|
||||
[rn/view {:style (style/root-container theme)}
|
||||
[rn/view {:style (style/root-container theme container-style)}
|
||||
[rn/pressable
|
||||
{:on-press on-press
|
||||
:accessibility-label :wallet-card}
|
||||
[rn/view {:style style/top-container}
|
||||
[fast-image/fast-image
|
||||
{:style style/image
|
||||
|
@ -7,6 +7,8 @@
|
||||
|
||||
(def buy-and-receive-cta-container
|
||||
{:flex-direction :row
|
||||
:justify-content :space-between
|
||||
:padding-horizontal 20
|
||||
:padding-vertical 8})
|
||||
|
||||
(def cta-card
|
||||
{:flex 1})
|
||||
|
@ -26,15 +26,17 @@
|
||||
[rn/view
|
||||
{:style style/buy-and-receive-cta-container}
|
||||
[quo/wallet-card
|
||||
{:image (resources/get-image :buy)
|
||||
:title (i18n/label :t/ways-to-buy)
|
||||
:subtitle (i18n/label :t/via-card-or-bank)
|
||||
:on-press buy-assets}]
|
||||
{:image (resources/get-image :buy)
|
||||
:title (i18n/label :t/ways-to-buy)
|
||||
:subtitle (i18n/label :t/via-card-or-bank)
|
||||
:container-style (assoc style/cta-card :margin-right 12)
|
||||
:on-press buy-assets}]
|
||||
[quo/wallet-card
|
||||
{:image (resources/get-image :receive)
|
||||
:title (i18n/label :t/receive)
|
||||
:subtitle (i18n/label :t/deposit-to-your-wallet)
|
||||
:on-press receive-assets}]])
|
||||
{:image (resources/get-image :receive)
|
||||
:title (i18n/label :t/receive)
|
||||
:subtitle (i18n/label :t/deposit-to-your-wallet)
|
||||
:container-style style/cta-card
|
||||
:on-press receive-assets}]])
|
||||
(if tokens-loading?
|
||||
[quo/skeleton-list
|
||||
{:content :assets
|
||||
|
Loading…
x
Reference in New Issue
Block a user