From 1d97561e4349bde660e4170cf6f6c058754a89d5 Mon Sep 17 00:00:00 2001 From: ibrkhalil Date: Fri, 19 Apr 2024 07:35:25 +0200 Subject: [PATCH] Refactors --- .../actions/share_community/style.cljs | 29 ++++++++++++------- .../actions/share_community/view.cljs | 5 ++-- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/status_im/contexts/communities/actions/share_community/style.cljs b/src/status_im/contexts/communities/actions/share_community/style.cljs index ab81fbe5527..bbe2c9b415b 100644 --- a/src/status_im/contexts/communities/actions/share_community/style.cljs +++ b/src/status_im/contexts/communities/actions/share_community/style.cljs @@ -1,9 +1,15 @@ (ns status-im.contexts.communities.actions.share-community.style (:require [quo.foundations.colors :as colors])) +(def flex-direction-row {:flex-direction :row}) +(def horizontal-padding 20) +(def vertical-padding 12) +(def gradient-cover-padding 20) +(def qr-code-padding 12) + (def header-container - {:padding-horizontal 20 - :padding-vertical 12}) + {:padding-horizontal horizontal-padding + :padding-vertical vertical-padding}) (def scan-notice {:color colors/white-70-blur @@ -16,12 +22,9 @@ {:margin-left (when thumbnail 8)}) (def qr-code-wrapper - {:padding-horizontal 20 + {:padding-horizontal horizontal-padding :margin-top 8}) -(def gradient-cover-padding 20) -(def qr-code-padding 12) - (defn qr-code-size [total-width] (- total-width (* gradient-cover-padding 2) (* qr-code-padding 2))) @@ -42,11 +45,17 @@ (def qr-top-wrapper {:margin 12 :margin-bottom 0 - :flex-direction :row + :flex-direction (:flex-direction flex-direction-row) :align-items :center :justify-content :space-between}) +(def community-avatar-dimension 32) + (def community-avatar - {:border-radius 32 - :width 32 - :height 32}) + {:border-radius community-avatar-dimension + :width community-avatar-dimension + :height community-avatar-dimension}) + +(def qr-code-view + {:padding-vertical vertical-padding + :align-items :center}) diff --git a/src/status_im/contexts/communities/actions/share_community/view.cljs b/src/status_im/contexts/communities/actions/share_community/view.cljs index cdcd14f0386..d3fe5e4429f 100644 --- a/src/status_im/contexts/communities/actions/share_community/view.cljs +++ b/src/status_im/contexts/communities/actions/share_community/view.cljs @@ -54,7 +54,7 @@ :bottom-color-override colors/white-opa-5}] [rn/view {:style style/qr-top-wrapper} - [rn/view {:flex-direction :row} + [rn/view style/flex-direction-row (when thumbnail [fast-image/fast-image {:source thumbnail @@ -74,8 +74,7 @@ :on-press on-press-share} :i/share]]] [rn/view - {:style {:padding-vertical 12 - :align-items :center}} + {:style style/qr-code-view} [qr-codes/qr-code {:size (style/qr-code-size window-width) :url url