diff --git a/src/status_im2/contexts/share/style.cljs b/src/status_im2/contexts/share/style.cljs index 42e8cc0fd730..67777aae80a7 100644 --- a/src/status_im2/contexts/share/style.cljs +++ b/src/status_im2/contexts/share/style.cljs @@ -25,9 +25,9 @@ {:padding-left screen-padding}) (defn qr-code-container [window-width & wallet-tab] - {:padding-vertical 20 + {:padding 12 :border-radius qr-container-radius - :margin-top (if wallet-tab 8 20) + :margin-top 12 :margin-bottom 4 :margin-horizontal (* window-width 0.053) :width :89.3% @@ -37,13 +37,13 @@ :align-items :center}) (def profile-address-column - {:align-self :flex-start}) + {:align-self :flex-start + :flex-direction :column}) (def profile-address-label {:align-self :flex-start :color colors/white-opa-40 - :padding-horizontal 20 :padding-top 10}) (def copyable-text-container-style @@ -53,7 +53,6 @@ (defn profile-address-content [max-width] {:color colors/white :align-self :flex-start - :padding-horizontal 20 :padding-top 2 :font-weight :500 :font-size 16 @@ -79,8 +78,7 @@ (def profile-address-container {:flex-direction :row - :margin-top 6 - :width :98%}) + :margin-top 6}) (def emoji-hash-label {:color colors/white-opa-40 @@ -93,12 +91,11 @@ (defn emoji-hash-content [max-width] {:color colors/white :align-self :flex-start - :padding-horizontal 20 + :padding-left 20 :padding-top 4 :padding-bottom 8 :font-weight :500 - :font-size 10 - :max-width max-width}) + :font-size 10}) (def emoji-share-button-container {:padding 8 @@ -109,4 +106,5 @@ :top 2}) (def tabs-container - {:padding screen-padding}) + {:padding-horizontal screen-padding + :margin-vertical 8}) diff --git a/src/status_im2/contexts/share/view.cljs b/src/status_im2/contexts/share/view.cljs index ed4e8536e22d..f59e46a6d336 100644 --- a/src/status_im2/contexts/share/view.cljs +++ b/src/status_im2/contexts/share/view.cljs @@ -39,32 +39,39 @@ (defn profile-tab [window-width] (let [multiaccount (rf/sub [:multiaccount]) emoji-hash (string/join " " (get multiaccount :emoji-hash)) - keyuid (get multiaccount :key-uid) + key-uid (get multiaccount :key-uid) current-pk (get multiaccount :public-key) port (rf/sub [:mediaserver/port]) + qr-size (- window-width 64) profile-qr-url (str "https://join.status.im/u/" current-pk) + base-64-qr-url (js/btoa profile-qr-url) + profile-image-type "large" + error-correction-level 4 + superimpose-profile? true media-server-url (str "https://localhost:" port - "/GenerateQRCode?level=2&url=" - (js/btoa profile-qr-url) + "/GenerateQRCode?level=" + error-correction-level + "&url=" + base-64-qr-url "&keyUid=" - keyuid - "&allowProfileImage=true" - "&size=200" - "&imageName=large")] + key-uid + "&allowProfileImage=" + superimpose-profile? + "&size=" + qr-size + "&imageName=" + profile-image-type) + ] (log/info "emoji-hash ->" (string/join " " (get multiaccount :emoji-hash))) [:<> [rn/view {:style (style/qr-code-container window-width)} [rn/view {:style {:flex-direction :row :justify-content :center}} [rn/image {:source {:uri media-server-url} - :style {:width 303 - :height 303 - :margin-top 30 - :border-radius 4 - :margin-right 4}} - ] - ] + :style {:width qr-size + :height qr-size + :border-radius 12}}]] [rn/view {:style style/profile-address-container} [rn/view {:style style/profile-address-column} [quo/text @@ -79,14 +86,16 @@ :number-of-lines 1} profile-qr-url]]] - [rn/view + [rn/view {:style {:flex-direction :column + :justify-content :center + :align-items :center + }} [quo/button {:icon true :type :blur-bg :size 32 :accessibility-label :link-to-profile :override-theme :dark - :style style/header-button ;;:on-press ;;;; TODO(siddarthay) : figure this out and take appropriate action } :i/share]]]] @@ -99,18 +108,18 @@ :style style/emoji-hash-label} (i18n/label :t/emoji-hash)] [copyable-text/copyable-text-view {:copied-text emoji-hash :container-style style/copyable-text-container-style} + [rn/view {:style {:flex-direction :row}} [rn/text {:style (style/emoji-hash-content (* window-width 0.7))} emoji-hash] - [rn/view - [quo/button - {:icon true - :type :blur-bg - :size 32 - :accessibility-label :link-to-profile - :override-theme :dark - :style style/header-button - ;;:on-press ;;;; TODO(siddarthay) : probably do nothing here? idk - } - :i/share]]]]]] + [quo/button + {:icon true + :type :blur-bg + :size 32 + :accessibility-label :link-to-profile + :override-theme :dark + :style style/header-button + } + :i/share]] + ]]]] ])) (defn wallet-tab [window-width]